More Related Content Similar to Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microservice Migration (20) More from Christian Posta (20) Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microservice Migration1. 1 | Copyright © 2019
Lowering the risk of Monolith to
Microservices Migration with
Envoy Proxy and GraphQL
@christianposta
2. 2 | Copyright © 2019 @christianposta
CHRISTIAN POSTA
• Field CTO @ solo.io
• Author of a few books
• Contributor to many open-source projects
• Architect, blogger, speaker, mentor, leader
https://bit.ly/istio-in-action
@christianposta
christian@solo.io
https://blog.christianposta.com
https://slideshare.net/ceposta
3. 3 | Copyright © 2019 @christianposta
Risk
“The existence of more than one possibility. The “true” outcome/state/result/value is not know”
“A state of uncertainty where some of the possibilities involve a loss, catastrophe, or other
undesirable outcome”
- Douglas Hubbard
4. 4 | Copyright © 2019 @christianposta
Monolith
An existing large application developed over the course of many years by different
teams that provides proven business value. Its structure has eroded insofar it
has become very difficult to update and maintain.
5. 5 | Copyright © 2019 @christianposta
Microservice
A highly distracting word that serves to confuse developers, architects,
and IT leaders into believing that we can actually have a utopian application
architecture.
6. 6 | Copyright © 2019 @christianposta
Microservice
A highly distracting word that serves to confuse developers, architects,
and IT leaders into believing that we can actually have a utopian application
architecture.
An architecture optimization that treats the modules of an application
as independently owned and deployed services for the purposes of
increasing an organization’s velocity
7. 7 | Copyright © 2019 @christianposta
Moving monolith to microservices
• Identify boundaries / APIs
• Async or Sync communication patterns?
• What to do with data?
• Need new tools!
• Debugging
• Observability
• Resilience
• Infrastructure optimized for this pattern
8. 8 | Copyright © 2019
Move fast, safely
https://puppet.com/resources/whitepaper/state-of-devops-report
9. 9 | Copyright © 20199 | Copyright © 2019
Controlling the application network
to strangle the monolith
10. 10 | Copyright © 2019 @christianposta
Strangler Pattern
“gradually create a new system around the edges of the old”
https://martinfowler.com/bliki/StranglerFigApplication.html
19. 19 | Copyright © 2019 @christianposta
Meet Envoy Proxy
http://envoyproxy.io
20. 20 | Copyright © 2019 @christianposta
Envoy Proxy
• service proxy
• written in C++, highly parallel, non-blocking
• L3/4 network filter
• out of the box L7 filters
• HTTP 1.1/2, gRPC, websockets, Kafka, AMQP, NATS
• baked in service discovery/health checking
• advanced load balancing
• stats, metrics, tracing
• dynamic configuration through xDS
21. 21 | Copyright © 2019 @christianposta
Envoy Proxy implements:
• zone aware, least request load balancing
• circuit breaking
• outlier detection
• retries, retry policies
• timeout (including budgets)
• traffic shadowing
• rate limiting
• access logging, statistics collection
• Many other features!
23. 23 | Copyright © 201923 | Copyright © 2019
The API is what we care about
26. 26 | Copyright © 2019 @christianposta
API Gateway Pattern
“A service that’s the entry point into the microservices-
based application … is responsible for request routing,
API composition, protocol translation …
and edge functions like authentication,
authorization, rate limiting, caching, et. al.”
See also:
https://microservices.io/patterns/apigateway.html
https://www.manning.com/books/microservices-patterns
27. 27 | Copyright © 2019 @christianposta
API Gateway pattern built on Envoy
https://github.com/solo-io/gloo
28. 28 | Copyright © 2019 @christianposta
What is Gloo?
● Open-source; ASLv2
● Built on Envoy Proxy
● Routing engine for “function” composition
● SOAP, Swagger/REST, gRPC, HTTP/1, HTTP/2,
WebSockets
● Transformations
● Powerful discovery mechanisms
● Extensible control plane
https://gloo.solo.io
29. 29 | Copyright © 2019 @christianposta
What is Gloo?
● Weighted routing, canary releases
● Offload authentication/authorization
● OAuth flows
● Plugin in to platform auth services
● TLS termination, passthrough, mTLS
● Rate limiting
● Dynamic configuration
● Deploy to any infrastructure
● Kubernetes native (when deployed to Kubernetes)
https://gloo.solo.io
30. 30 | Copyright © 2019 @christianposta
Gloo composes functions
● Request path
● Method
● Headers
● Body shape/type
● AWS Lambdas
● Google Cloud Functions
● Azure Functions
func updateShoppingCart(custId int, item Item)
Cart
31. 31 | Copyright © 2019 @christianposta
Gloo composes functions
● Request path
● Method
● Headers
● Body shape/type
● AWS Lambdas
● Google Cloud Functions
● Azure Functions
32. 32 | Copyright © 2019 @christianposta
Functions?
● Request path
● Method
● Headers
● Body shape/type
● AWS Lambdas
● Google Cloud Functions
● Azure Functions
34. 34 | Copyright © 2019 @christianposta
Use Gloo to build a API Gateway
foo.io/customer foo.io/order bar.io/account bar.io/order
Monolith Microservice
s
Cloud Functions Hybrid Application
35. 35 | Copyright © 201935 | Copyright © 2019
Composing APIs with GraphQL
36. 36 | Copyright © 2019 @christianposta
GraphQL: provide query API for API gateway
Query
Monolith Microservice
s
Cloud Functions
Result
37. 37 | Copyright © 2019 @christianposta
Gloo companion project: Sqoop
Query
Monolith Microservice
s
Cloud Functions
Result
https://sqoop.solo.io
38. 38 | Copyright © 2019 @christianposta
Gloo companion project: Sqoop
https://sqoop.solo.io
● OpenSource GraphQL engine built on top of Gloo
● Configure GraphQL Schemas and Resolvers
● Default use Gloo upstreams as resolvers
● Leverage Gloo
○ Caching
○ Transformations
○ Security
○ Routing
○ Observability
● Can extend resolvers
• Part of newly announced GraphQL Foundation
http://bit.ly/graphql-foundation
39. 39 | Copyright © 2019 @christianposta
Check out Gloo!
https://gloo.solo.io https://sqoop.solo.io https://supergloo.solo.io
40. 40 | Copyright © 2019 @christianposta
CHRISTIAN POSTA
@christianposta
christian@solo.io
https://blog.christianposta.com
https://slideshare.net/ceposta
Editor's Notes …… new challenge….. Let’s come back to that….. …… new challenge….. Let’s come back to that….. …… new challenge….. Let’s come back to that….. …… new challenge….. Let’s come back to that….. …… new challenge….. Let’s come back to that….. …… new challenge….. Let’s come back to that….. …… new challenge….. Let’s come back to that….. Get back to first principles.
Focus on principles, patterns, methodologies.
Tools will help, but you cannot start with tools. Get back to first principles.
Focus on principles, patterns, methodologies.
Tools will help, but you cannot start with tools. Get back to first principles.
Focus on principles, patterns, methodologies.
Tools will help, but you cannot start with tools. Get back to first principles.
Focus on principles, patterns, methodologies.
Tools will help, but you cannot start with tools. \