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 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
What problem do we solve? Consume use-cases in a microservice-based ecosystem 3 2019 KrakenD API Gateway
Catalog Promotions Android Basket ? Payments SPA Orders Pricing Stock iOS Authentication 4 2019 KrakenD API Gateway
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 2019 KrakenD API Gateway
Use cases Common scenarios for KrakenD
Transition to microservices Catalog Promotions Basket MONOLITH Payments Orders Pricing Stock Database Authentication 8 2019 KrakenD API Gateway
1 2 JWT Authentication 3 Aggregate Service 1 Service 2 9 2019 KrakenD API Gateway
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
Catalog Promotions Basket Payments JWT token MONOLITH /checkout Orders Pricing Authentication Stock 11 2019 KrakenD API Gateway
π MONOLITH MONOLITH Catalog Promotions Orders Basket Pricing Payments Stock 12 2019 KrakenD API Gateway
Event-driven architecture 4 Notifications /notify QUEUE Azure Service Bus Topic 13 2019 KrakenD API Gateway
Client Apps (consume a use-case) Catalog Promotions Basket /frontpage Payments Orders { Pricing "catalog": {}, Stock "promos": {}, "pricing": {} Authentication } 14 2019 KrakenD API Gateway
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
KrakenD as a 3rd party provider 3rd party services { "3dparty": {}, Company services "internal": {} } 16 2019 KrakenD API Gateway
Transformation API Services rename id_user => user_id rename alias => username remove password add static_data 17 2019 KrakenD API Gateway
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
TL;DR - Instant creation of high-performance API through a configuration file 19 2019 KrakenD API Gateway
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 2019 KrakenD API Gateway
Differences With similar products
API Managers Proxies with GW API Gateways Service Mesh GraphQL 23 2019 KrakenD API Gateway Photo by @voyagefervor, Instagram
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
API GW: North-south traffic API GW Mesh: east-west traffic 25 2019 KrakenD API Gateway
Proxy with API Gateway capabilities Catalog Promotions Android Basket Payments PROXY SPA Orders Pricing Stock iOS Authentication 26 2019 KrakenD API Gateway
Stateless vs Stateful
Stateful 28 2019 KrakenD API Gateway
Stateless 29 2019 KrakenD API Gateway
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
Deployment
Simple deployment (stateless) + β 70MB Dockerfile FROM devopsfaith/krakend COPY krakend.json \ /etc/krakend/krakend.json 34 2019 KrakenD API Gateway
Deploy anywhere Platforms Orchestration 35 2019 KrakenD API Gateway
Assign a KrakenD to each team (client type) Catalog Promotions Android Basket Payments SPA Orders Pricing Stock iOS Authentication 36 2019 KrakenD API Gateway
Assign a KrakenD to each team (micro frontends) } } } 37 2019 KrakenD API Gateway
Not necessarily the single point of entry Catalog Promotions Payments Orders Pricing Stock Authentication 38 2019 KrakenD API Gateway
Performance
Benchmarks 40 2019 KrakenD API Gateway
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
18.000 reqs/sec On a raspberry 2 42 2019 KrakenD API Gateway
Without KrakenD 43 2019 KrakenD API Gateway
With KrakenD (concurrence=3) 44 2019 KrakenD API Gateway
Observability Visualize the entire ecosystem from a central place
1-click export of logging, metrics and traces 46 2019 KrakenD API Gateway
Enable monitoring 47 2019 KrakenD API Gateway
Metrics and Tracer exporters for every taste 48 2019 KrakenD API Gateway
49 2019 KrakenD API Gateway
KrakenD in production
KrakenD Users 51 2019 KrakenD API Gateway
Open-source adoption 52 2019 KrakenD API Gateway
120,000 KrakenD sessions (12mo) 1 session = 1 cluster with at least 12 hours uptime 53 2019 KrakenD API Gateway
β 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
Questions? Letβs have a beer! @devopsfaith | @alombarte 55 2019 KrakenD API Gateway Photo by Patrick Fore
Recommend
More recommend