krakend api gateway
play

KrakenD API Gateway Product overview @devopsfaith Microservices - PowerPoint PPT Presentation

KrakenD API Gateway Product overview @devopsfaith Microservices are challenging The need for agility and scalability has driven Microservices adoption, but: 91% of Internet businesses are using or have plans to use microservices 86% expect


  1. KrakenD API Gateway Product overview @devopsfaith

  2. Microservices are challenging The need for agility and scalability has driven Microservices adoption, but: 91% of Internet businesses are using or have plans to use microservices 86% expect microservices to be the default architecture within five years 99% report challenges in using microservices * Independent research study conducted by Dimensional Research, April 2018 2 2019 KrakenD API Gateway

  3. What problem do we solve? Consume use-cases in a microservice-based ecosystem 3 2019 KrakenD API Gateway

  4. Catalog Promotions Android Basket ? Payments SPA Orders Pricing Stock iOS Authentication 4 2019 KrakenD API Gateway

  5. KrakenD offloads shared needs Catalog Promotions Aggregation Manipulation Service Discovery Basket Filtering Metrics/Tracing Authorization Payments Security Encoding Circuit Breaker Rate Limit Monitoring Logging Orders Pub/Sub Transport adapter Load Balancer Pricing Stub Data Traffic Mirroring Queues Stock Lambda Bot detection I/O validation Authentication Serverless functions 5 2019 KrakenD API Gateway

  6. 6 2019 KrakenD API Gateway

  7. Use cases Common scenarios for KrakenD

  8. Transition to microservices Catalog Promotions Basket MONOLITH Payments Orders Pricing Stock Database Authentication 8 2019 KrakenD API Gateway

  9. 1 2 JWT Authentication 3 Aggregate Service 1 Service 2 9 2019 KrakenD API Gateway

  10. krakend.json "endpoint": " /basket " , "extra_config": { " github.com/devopsfaith/krakend-jose/validator ": { "alg": "HS256", "audience": ["http://api.example.com"], "roles_key": "roles", "roles": ["user", "admin"], Authorization "jwk-url": "https://monolith/jwk/symmetric.json" } granularity }, "output_encoding": "no-op", "headers_to_pass": ["Authentication"], "backend": [{ "url_pattern": "/bar", "encoding": "no-op" }] 10 2019 KrakenD API Gateway

  11. Catalog Promotions Basket Payments JWT token MONOLITH /checkout Orders Pricing Authentication Stock 11 2019 KrakenD API Gateway

  12. 🎊 MONOLITH MONOLITH Catalog Promotions Orders Basket Pricing Payments Stock 12 2019 KrakenD API Gateway

  13. Event-driven architecture 4 Notifications /notify QUEUE Azure Service Bus Topic 13 2019 KrakenD API Gateway

  14. Client Apps (consume a use-case) Catalog Promotions Basket /frontpage Payments Orders { Pricing "catalog": {}, Stock "promos": {}, "pricing": {} Authentication } 14 2019 KrakenD API Gateway

  15. Aggregation Catalog Aggregated <id_product>2</id_product> { <name>Wireless Headset</name> "id_product": 2, <date fmt="Y-m-d">2019-06-04</date> } "name": "Wireless Headset", "date": "2019-06-04", + "code": "PromoChristmas", "discount": 0.15, Promotions "products": [1,2,15] { } "code": "PromoChristmas", "discount": 0.15, "products": [1,2,15] } 15 2019 KrakenD API Gateway

  16. KrakenD as a 3rd party provider 3rd party services { "3dparty": {}, Company services "internal": {} } 16 2019 KrakenD API Gateway

  17. Transformation API Services rename id_user => user_id rename alias => username remove password add static_data 17 2019 KrakenD API Gateway

  18. Manipulation/Filtering/Grouping/Transformation Catalog Aggregated <id_product>2</id_product> { <name>Wireless Headset</name> " catalog ": { <date fmt="Y-m-d">2019-06-04</date> } "id_product": 2, "name": "Wireless Headset", Promotions + "date": "2019-06-04", }, " promotions ": { "code": "PromoChristmas", { " save discount": 0.15, "code": "PromoChristmas", "products": [1,2,15], "discount": 0.15, } "products": [1,2,15] } } 18 2019 KrakenD API Gateway

  19. TL;DR - Instant creation of high-performance API through a configuration file 19 2019 KrakenD API Gateway

  20. More components and features… (open source) https://github.com/devopsfaith/krakend-contrib Enterprise components - KrakenD Studio - KrakenD Developer Portal - KrakenD Management Portal - KrakenD Enterprise Plugins - KrakenD gRPC plugin generator - KrakenD Dashboard 20 2019 KrakenD API Gateway

  21. 21 2019 KrakenD API Gateway

  22. Differences With similar products

  23. API Managers Proxies with GW API Gateways Service Mesh GraphQL 23 2019 KrakenD API Gateway Photo by @voyagefervor, Instagram

  24. Products with overlapping features Access management (generate API Keys), billing, developer portal, usage API Managers statistics 1:1 mapping endpoint-backends - No business logic - Offload cross-cutting Proxy with GW concerns. No aggregation Services aggregation - Business logic - API Contract - No coupling to API Gateway backend - Offload cross-cutting concerns. Can implement the BFF pattern. Internal communication between services (not for the end-user). No business Service Mesh logic HTTP only - Single Endpoint - Allows the client to choose exactly the data in GraphQL the response. ~BFF. E.g: you provide an API to developers out of your organization 24 2019 KrakenD API Gateway

  25. API GW: North-south traffic API GW Mesh: east-west traffic 25 2019 KrakenD API Gateway

  26. Proxy with API Gateway capabilities Catalog Promotions Android Basket Payments PROXY SPA Orders Pricing Stock iOS Authentication 26 2019 KrakenD API Gateway

  27. Stateless vs Stateful

  28. Stateful 28 2019 KrakenD API Gateway

  29. Stateless 29 2019 KrakenD API Gateway

  30. A gateway is not the new monolith Stateless Stateful β˜… No node coordination β˜… Coordination required β˜… No synchronization β˜… Data synchronization β˜… Zero complexity β˜… Datastore as source of truth β˜… No challenges for Multi-region β˜… Complexity β˜… Declarative configuration β˜… Multi-region lag β˜… Immutable infrastructure β˜… Mutable configuration LINEAR SCALABILITY NON-LINEAR SCALABILITY DB-LESS != stateless 30 2019 KrakenD API Gateway

  31. Deployment

  32. Simple deployment (stateless) + ≃ 70MB Dockerfile FROM devopsfaith/krakend COPY krakend.json \ /etc/krakend/krakend.json 34 2019 KrakenD API Gateway

  33. Deploy anywhere Platforms Orchestration 35 2019 KrakenD API Gateway

  34. Assign a KrakenD to each team (client type) Catalog Promotions Android Basket Payments SPA Orders Pricing Stock iOS Authentication 36 2019 KrakenD API Gateway

  35. Assign a KrakenD to each team (micro frontends) } } } 37 2019 KrakenD API Gateway

  36. Not necessarily the single point of entry Catalog Promotions Payments Orders Pricing Stock Authentication 38 2019 KrakenD API Gateway

  37. Performance

  38. Benchmarks 40 2019 KrakenD API Gateway

  39. Benchmark Overview # Hardware specs Requests second Average response 1. Amazon EC2 (c4.2xlarge) 10126.1613 reqs/s 9.8ms 2. Amazon EC2 (c4.xlarge) 8465.4012 reqs/s 11.7ms 3. Amazon EC2 (m4.large) 3634.1247 reqs/s 27.3ms 4. Amazon EC2 (t2.medium) 2781.8611 reqs/s 351.3ms 5. Amazon EC2 (t2.micro) 2757.6407 reqs/s 35.8ms 6. MacBook Pro (Aug 2015) 2,2 GHz Intel Core i7 18157.4274 reqs/s 5.5ms 41 2019 KrakenD API Gateway

  40. 18.000 reqs/sec On a raspberry 2 42 2019 KrakenD API Gateway

  41. Without KrakenD 43 2019 KrakenD API Gateway

  42. With KrakenD (concurrence=3) 44 2019 KrakenD API Gateway

  43. Observability Visualize the entire ecosystem from a central place

  44. 1-click export of logging, metrics and traces 46 2019 KrakenD API Gateway

  45. Enable monitoring 47 2019 KrakenD API Gateway

  46. Metrics and Tracer exporters for every taste 48 2019 KrakenD API Gateway

  47. 49 2019 KrakenD API Gateway

  48. KrakenD in production

  49. KrakenD Users 51 2019 KrakenD API Gateway

  50. Open-source adoption 52 2019 KrakenD API Gateway

  51. 120,000 KrakenD sessions (12mo) 1 session = 1 cluster with at least 12 hours uptime 53 2019 KrakenD API Gateway

  52. βž” Automatic API generation and integration Takeaways βž” Consumers (iOS, Android, Web, Server devs) in control of the API βž” Homogeneous consumption of data formats and encodings βž” Reduced bandwidth and errors βž” Increased speed βž” Better quality of service 54 2019 KrakenD API Gateway

  53. Questions? Let’s have a beer! @devopsfaith | @alombarte 55 2019 KrakenD API Gateway Photo by Patrick Fore

Recommend


More recommend