Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
NATS vs HTTP
Inter service communication
Agenda
● Traditional HTTP Architecture
● NATS Microservice Architecture
● Benchmark setup
● Benchmark results
● Migration ...
Traditional HTTP Architecture
● Drawbacks:
○ Load Balancing
○ Service Discovery
○ Each service must have a
dedicated WebSe...
NATS Microservice Architecture
● Fits the new
Microservice
patterns
● NATS is
○ Lightweight
○ Flexible
○ Highly Performant...
Benchmark setup
● Running with Docker
● One Client
● One Proxy
● One Service
● Source code
○ https://github.com/diogogmt/n...
Benchmark Results
● Each request is
executed serially
● Client times how long
it takes to execute
all requests
Benchmark Results
● Client executes
requests concurrently
with a factor of 20%
Considerations
● Different NATS strategies
○ Pub/Sub
○ Request/Reply
○ Queuing
● Keep in mind
○ Concurrency
○ Session Mana...
Questions?
diogogmt.com
@diogogmt
Upcoming SlideShare
Loading in …5
×

NATS vs HTTP for Interservice Communication

2,739 views

Published on

Presentation from a talk given by Diogo Monteiro (@diogogmt) at a recent NATS Meetup in Toronto. The talk covered why NATS is a simple, fast method for microservices communication, and provides some latency benchmarks from Diogo's design of a solution using NATS.

You can learn more about NATS at http://www.nats.io

Published in: Software
  • Be the first to comment

NATS vs HTTP for Interservice Communication

  1. 1. NATS vs HTTP Inter service communication
  2. 2. Agenda ● Traditional HTTP Architecture ● NATS Microservice Architecture ● Benchmark setup ● Benchmark results ● Migration Considerations
  3. 3. Traditional HTTP Architecture ● Drawbacks: ○ Load Balancing ○ Service Discovery ○ Each service must have a dedicated WebServer ● Doesn't fit the microservice model
  4. 4. NATS Microservice Architecture ● Fits the new Microservice patterns ● NATS is ○ Lightweight ○ Flexible ○ Highly Performant ● It becomes easier to create microservices ○ Load Balancing ○ Service Discovery
  5. 5. Benchmark setup ● Running with Docker ● One Client ● One Proxy ● One Service ● Source code ○ https://github.com/diogogmt/nats-rest-benchmark
  6. 6. Benchmark Results ● Each request is executed serially ● Client times how long it takes to execute all requests
  7. 7. Benchmark Results ● Client executes requests concurrently with a factor of 20%
  8. 8. Considerations ● Different NATS strategies ○ Pub/Sub ○ Request/Reply ○ Queuing ● Keep in mind ○ Concurrency ○ Session Management ○ Metadata ○ Message status ○ NATS-Proxy framework ■ Author: Radomír Sohlich ■ https://github.com/sohlich/nats-proxy
  9. 9. Questions? diogogmt.com @diogogmt

×