Professional Documents
Culture Documents
Amar
What is API Gateway?
An API gateway provides a single, unified API entry point across one or
more internal APIs. They typically layer rate limiting and security as well.
Advantages:
Prevents exposing internal concerns to external clients.
Adds an additional layer of security to your microservices.
Enables support for mixing communication protocols.
Decreased microservice complexity.
Microservice Mocking and Virtualization.
API Gateway - with and without
Forward Proxy
Forward Proxy is the proxy for the client and it hides the identities of
the clients. It receives the request from the client and sends the
requests to the server on behalf of the clients.
The main purpose of forward proxy is to act on behalf of clients by
hiding their identities.
Reverse Proxy
Reverse Proxy does the opposite of what the Forward Proxy does.
It hides the identities of the servers and receive the requests from clients
on behalf of servers.
Behind the reverse proxy there might be different web services and servers
may exist.
The main purpose of reverse proxy is to server client applications on
behalf of set of backend applications deployed in behind the reverse proxy.
What is Zuul??
Netflix created
It is open-source
It is API Gateway
It is a reverse proxy
Zuul is an edge service that proxies requests to multiple backing services.
It provides a unified “front door” to your system, which allows a browser,
mobile app, or other user interface to consume services from multiple
hosts without managing cross-origin resource sharing (CORS) and
authentication for each one.
It is can be used to manage routing rules, filters, and load balancing
across your system.
Spring Platform Microservice Ecosystem
Dynamic Properties
(ARCHAIS)
Spring Platform
(Karyon, Hystrix)
Micro
Service
(Zuul)
S
Monitoring EC2
3
(Atlas)
Discovery
(Eureka)
Deployment Pipeline
AWS
7
Request Lifecycle of a Request
Unless otherwise indicated, these slides are © 2013-2016 Pivotal S oftware, Inc. and licensed under a C reative C ommons 8
Attribution- NonC ommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Zuul in a Nutshell
Unless otherwise indicated, these slides are © 2013-2016 Pivotal S oftware, Inc. and licensed under a C reative C ommons 9
Attribution- NonC ommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Principles of Zuul Gateway
Creative Routing
Dynamic Routing
Delivery Focused
Traffic Shaping
React Fast
Insights
Zuul Responsibilities
• Top L evel request context
– Geolocation
– Cookie / T oken decryption
• Authentication
– Hand off to Authentication Se rvices
• Request/Response “normalization”
– D evice specific “weirdness”
• C h u nked Encoding
• Header truncations
• U R L fixes
zuul.ratelimit.default-policy-list[0].limit=10
zuul.ratelimit.default-policy-list[0].quota=1000
zuul.ratelimit.default-policy-list[0].refresh-interval=60
• Zuul 2.0
– Netty (non-blocking,
async)
– RxJava chained filters
– Coming to O S S soon.
16
Why Zuul 2?
17
Drawbacks:
Zuul 1 is that calls to the API Gateway are all blocking
the Spring Cloud Framework does not integrate Zuul 2.
Alternatives:
Demo
Thank you