SlideShare a Scribd company logo
1 of 41
Download to read offline
The ultra-high
performance API
Gateway with
middlewares
What is an API
Gateway?
TL;DR
A REST service that exposes
endpoints with use cases
What is an API
Gateway?
TL;DR
It’s also an entry point for clients to
your microservices
What is and what
is not an API GW
Extended version
https://medium.com/devops-faith/an-
api-gateway-is-not-the-new-unicorn-
303a3863f2a6
And a
Middleware?
TL;DR
An application that wraps the
original application, adding more
functionality
Introducing KrakenD
Project overview
- Started Nov 2016
- Product built in Go language
- Concurrency
- High performance
- Coded after facing problems with unreliable APIs in production
- 3 core developers. More contributors are joining.
- 100% Open Source
Direct consumption of (micro)services?
API Gateway
KrakenD is a PURE API Gateway
Why KrakenD? There are many API GW solutions!
Yes, there are, but:
- Most of them cover features beyond an API Gateway
- Do not perform well or have poor performance
- Unfortunate architectures (e.g: share state between nodes)
- Single points of failure
- Paid, expensive and very limited. Monthly plans including X calls/month.
Convert that to reqs/sec!!
- Need complicated coding to make them work
- Not really extensible
The KrakenD
principles
- Reactive is key (even failing fast is
better than succeeding slow)
- The simpler, the better
- Everything is pluggable
- Each request must be processed in
its own request-scoped context
The Reactive Manifesto
http://www.reactivemanifesto.org/
Features
Features overview
KrakenD features
● Aggregates information from many sources into single endpoints.
● Manipulates responses and allows you to group, wrap, rename...
● Filters and shrinks responses, hiding unwanted attributes or selecting them
● Throttles (rate limits) connections against KrakenD and against backends
● Protects your backends with circuit breakers and implements all kinds of
security measures.
● Discovers your service instances by integrating with your SD provider
● Extends your ecosystem as it supports a myriad of middlewares and plugins,
such as OAuth or security layers.
● Speaks different encoding formats and protocols.
● Fine control of manipulations, validations and filtering with DSL configurations
Security features
● User quota
● Support for SSL
● OAuth client credentials grant supported
● Restrict connections by host
● HTTP Strict Transport Security (HSTS)
● Clickjacking protection
● HTTP Public Key Pinning (HPKP)
● MIME-Sniffing prevention
● Cross-site scripting (XSS) protection
Use cases
● Increase user experience in apps. Less data consumption and faster responses
● Instant creation of a new REST API
● Add APIs in legacy systems
● Unify data coming from different sources and encodings
● Publish a fixed interface, let the backends evolve and change contracts.
● Quick Microservices adoption
● Create aggregated views from a lot of services
● Build MVPs using data from anywhere (bonus: backend for api2html)
● Smooth transition over different API version releases
Performance
Performance
Requests per second in equal conditions. See benchmarks
Response time distribution
(real example)
Without KrakenD
~30% responses under 300ms
~60% responses between 300-1250ms
~10% responses over 1250ms
With KrakenD
~35% responses under 100ms
~55% responses between 100-300ms
~10% responses over 300ms
Do one thing and do it well.
KrakenD ecosystem
● KrakenD CE: KrakenD distribution ready to use.
● KrakenD framework: the core of the KrakenD is an open sourced library that
everyone can use, extend and modify. The project has several examples for
the integration with other third party libs (gorilla, negroni, gin, etc)
● KrakenD Contrib: A collection of components and middlewares to extend the
functionality
Designer (UI)
Try:
http://www.krakend.io/designer/
- No coding required
- The UI produces a
configuration file ready to
serve
How KrakenD works?
KrakenD uses two different states: building and working.
Building: When the service is initially being prepared to serve the requests,
prepares all the middlewares and defines the pipes. Each pipe is binded to an
endpoint via their outer common interface, resulting in a HTTP handler function.
Only when the configuration is parsed and the service being prepared.
Working: The router maps every request to a HTTP handler function and triggers
the pipe execution. As HTTP handler functions are built in the previous step,
KrakenD doesn't penalize the performance depending on the number of endpoints
or the possible cardinality of the URI requested by the users.
Architecture from
30.000ft
Composed of a set of go packages designed as building
blocks to create pipes and processors between an exposed
endpoint and one or several backends resources
CONFIG ROUTER PROXY
Components
Service definition Endpoints exposed
to the clients
Processing and
backend interaction
CONFIG ROUTER PROXY
The config package
The config package defines the entire service.
In the building stage, all the pipes are defined, with their tasks, helpers and
generators. Each pipe will be binded to an endpoint via their outer common
interface, resulting in a HTTP handler function.
The router package
The router layer is responsible for setting up the HTTP(S) services, binding the
endpoints defined by the config and transforming the HTTP request into proxy
requests before delegating the task to the inner layer (proxy).
When the internal proxy layer returns a response, the router layer converts it into a
proper HTTP response and sends it to the user.
This layer can be easily extended in order to use any HTTP router, framework or
middleware. Adding transport layer adapters for other protocols (Thrift, gRPC,
AMQP, NATS, etc) is in the roadmap.
The proxy package
Where most of the KrakenD components and features are placed. It defines two
important interfaces, designed to be stacked:
● Proxy is a function that converts a given context and request into a response.
● Middleware is a function that accepts one or more proxies and returns a single
proxy wrapping them.
This layer transforms the request received from the router into a single or several
requests to your backend services, processes the responses and returns a single
response.
Middlewares
Middlewares generate custom proxies that are chained depending on the workflow
defined in the configuration until each possible branch ends in a transport-related
proxy.
Each of these generated proxies is able to transform the input or even clone it
several times and pass it or them to the next element in the chain.
They can modify the received response or responses adding all kinds of features to
the generated pipe.
Middleware examples (open source)
● Balancing: uses some type of strategy for selecting a backend host to query.
● Concurrent: improves the QoS by sending several concurrent requests to the
next step of the chain and returning the first successful response using a
timeout for canceling the generated workload.
● Logging: logs the received request and response and also the duration of the
segment execution.
Middleware examples (open source)
● Merging: a fork-and-join middleware. Splits the process of the request into
several concurrent processes, each one against a different backend, and to
merge all the received responses from those created pipes into a single one. It
applies a timeout, as the concurrent one does.
● HTTP: completes the received proxy request by replacing the parameters
extracted from the user request in a defined URL Pattern.
● More middlewares and components:
https://github.com/devopsfaith/krakend-contrib
Live demo
KrakenD Playground
https://github.com/devopsfaith/krakend-playgroun
d
Get it
KrakenD:
http://www.krakend.io/download/
- Source code (compile yourself)
- Tarball
- Debian package
- RPM package
- Docker image
- Brew Formula
Install and run
Mac:
brew install krakend
krakend run -c krakend.json
---
Linux:
docker pull devopsfaith/krakend
docker run -p 8080:8080 -v $PWD:/etc/krakend/ devopsfaith/krakend
Give us a star if you like the project!
https://github.com/devopsfaith/krakend/stargazers

More Related Content

What's hot

How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...Amazon Web Services
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseAraf Karsh Hamid
 
Benefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use CasesBenefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use Casesconfluent
 
Keycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler WebinarKeycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler Webinarmarcuschristie
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudNew Relic
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsAmazon Web Services
 
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Timothy McAliley
 
Anthos Application Modernization Platform
Anthos Application Modernization PlatformAnthos Application Modernization Platform
Anthos Application Modernization PlatformGDG Cloud Bengaluru
 
Cloud Migration, Application Modernization and Security for Partners
Cloud Migration, Application Modernization and Security for PartnersCloud Migration, Application Modernization and Security for Partners
Cloud Migration, Application Modernization and Security for PartnersAmazon Web Services
 
Azure Arc Overview from Microsoft
Azure Arc Overview from MicrosoftAzure Arc Overview from Microsoft
Azure Arc Overview from MicrosoftDavid J Rosenthal
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overviewJames Serra
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API ManagementCallon Campbell
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?LunchBadger
 
Migrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with ConfidenceMigrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with ConfidenceDavid J Rosenthal
 
Azure key vault
Azure key vaultAzure key vault
Azure key vaultRahul Nath
 
Microsoft Azure VM Cheat Sheet
Microsoft Azure VM Cheat SheetMicrosoft Azure VM Cheat Sheet
Microsoft Azure VM Cheat SheetMilos Halecka
 

What's hot (20)

How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-Premise
 
Benefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use CasesBenefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use Cases
 
Keycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler WebinarKeycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler Webinar
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
 
Azure migration
Azure migrationAzure migration
Azure migration
 
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
 
Anthos Application Modernization Platform
Anthos Application Modernization PlatformAnthos Application Modernization Platform
Anthos Application Modernization Platform
 
Cloud Migration, Application Modernization and Security for Partners
Cloud Migration, Application Modernization and Security for PartnersCloud Migration, Application Modernization and Security for Partners
Cloud Migration, Application Modernization and Security for Partners
 
Azure Arc Overview from Microsoft
Azure Arc Overview from MicrosoftAzure Arc Overview from Microsoft
Azure Arc Overview from Microsoft
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
Migrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with ConfidenceMigrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with Confidence
 
Cost Optimization on AWS
Cost Optimization on AWSCost Optimization on AWS
Cost Optimization on AWS
 
Cloud Migration: A How-To Guide
Cloud Migration: A How-To GuideCloud Migration: A How-To Guide
Cloud Migration: A How-To Guide
 
Azure key vault
Azure key vaultAzure key vault
Azure key vault
 
Microsoft Azure VM Cheat Sheet
Microsoft Azure VM Cheat SheetMicrosoft Azure VM Cheat Sheet
Microsoft Azure VM Cheat Sheet
 

Similar to KrakenD API Gateway

The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stackLuca Mattia Ferrari
 
CNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to EnvoyCNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to EnvoyHarish
 
Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017Idit Levine
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Md. Sadhan Sarker
 
Open Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshOpen Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshCloudOps2005
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsSrdjan Strbanovic
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)QAware GmbH
 
Service Meshes with Istio
Service Meshes with IstioService Meshes with Istio
Service Meshes with IstioRandyGupta
 
All About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksAll About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksMohammad Asif Siddiqui
 
Gwt session
Gwt sessionGwt session
Gwt sessionMans Jug
 
Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerJorge Juan Mendoza
 
APIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSFAPIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSFAndrei Savu
 

Similar to KrakenD API Gateway (20)

The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
 
CNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to EnvoyCNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to Envoy
 
Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
 
Open Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshOpen Source Networking Days- Service Mesh
Open Source Networking Days- Service Mesh
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
gRPC
gRPCgRPC
gRPC
 
Java one2013
Java one2013Java one2013
Java one2013
 
Service Meshes with Istio
Service Meshes with IstioService Meshes with Istio
Service Meshes with Istio
 
All About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksAll About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice Frameworks
 
Gwt session
Gwt sessionGwt session
Gwt session
 
Gwt session
Gwt sessionGwt session
Gwt session
 
Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in docker
 
APIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSFAPIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSF
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 

Recently uploaded

Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...SUHANI PANDEY
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
 

Recently uploaded (20)

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 

KrakenD API Gateway

  • 2. What is an API Gateway? TL;DR A REST service that exposes endpoints with use cases
  • 3. What is an API Gateway? TL;DR It’s also an entry point for clients to your microservices
  • 4. What is and what is not an API GW Extended version https://medium.com/devops-faith/an- api-gateway-is-not-the-new-unicorn- 303a3863f2a6
  • 5. And a Middleware? TL;DR An application that wraps the original application, adding more functionality
  • 7. Project overview - Started Nov 2016 - Product built in Go language - Concurrency - High performance - Coded after facing problems with unreliable APIs in production - 3 core developers. More contributors are joining. - 100% Open Source
  • 8. Direct consumption of (micro)services?
  • 10. KrakenD is a PURE API Gateway
  • 11. Why KrakenD? There are many API GW solutions! Yes, there are, but: - Most of them cover features beyond an API Gateway - Do not perform well or have poor performance - Unfortunate architectures (e.g: share state between nodes) - Single points of failure - Paid, expensive and very limited. Monthly plans including X calls/month. Convert that to reqs/sec!! - Need complicated coding to make them work - Not really extensible
  • 12. The KrakenD principles - Reactive is key (even failing fast is better than succeeding slow) - The simpler, the better - Everything is pluggable - Each request must be processed in its own request-scoped context
  • 16. KrakenD features ● Aggregates information from many sources into single endpoints. ● Manipulates responses and allows you to group, wrap, rename... ● Filters and shrinks responses, hiding unwanted attributes or selecting them ● Throttles (rate limits) connections against KrakenD and against backends ● Protects your backends with circuit breakers and implements all kinds of security measures. ● Discovers your service instances by integrating with your SD provider ● Extends your ecosystem as it supports a myriad of middlewares and plugins, such as OAuth or security layers. ● Speaks different encoding formats and protocols. ● Fine control of manipulations, validations and filtering with DSL configurations
  • 17. Security features ● User quota ● Support for SSL ● OAuth client credentials grant supported ● Restrict connections by host ● HTTP Strict Transport Security (HSTS) ● Clickjacking protection ● HTTP Public Key Pinning (HPKP) ● MIME-Sniffing prevention ● Cross-site scripting (XSS) protection
  • 18. Use cases ● Increase user experience in apps. Less data consumption and faster responses ● Instant creation of a new REST API ● Add APIs in legacy systems ● Unify data coming from different sources and encodings ● Publish a fixed interface, let the backends evolve and change contracts. ● Quick Microservices adoption ● Create aggregated views from a lot of services ● Build MVPs using data from anywhere (bonus: backend for api2html) ● Smooth transition over different API version releases
  • 20. Performance Requests per second in equal conditions. See benchmarks
  • 22. Without KrakenD ~30% responses under 300ms ~60% responses between 300-1250ms ~10% responses over 1250ms
  • 23. With KrakenD ~35% responses under 100ms ~55% responses between 100-300ms ~10% responses over 300ms
  • 24. Do one thing and do it well.
  • 25. KrakenD ecosystem ● KrakenD CE: KrakenD distribution ready to use. ● KrakenD framework: the core of the KrakenD is an open sourced library that everyone can use, extend and modify. The project has several examples for the integration with other third party libs (gorilla, negroni, gin, etc) ● KrakenD Contrib: A collection of components and middlewares to extend the functionality
  • 26. Designer (UI) Try: http://www.krakend.io/designer/ - No coding required - The UI produces a configuration file ready to serve
  • 27. How KrakenD works? KrakenD uses two different states: building and working. Building: When the service is initially being prepared to serve the requests, prepares all the middlewares and defines the pipes. Each pipe is binded to an endpoint via their outer common interface, resulting in a HTTP handler function. Only when the configuration is parsed and the service being prepared. Working: The router maps every request to a HTTP handler function and triggers the pipe execution. As HTTP handler functions are built in the previous step, KrakenD doesn't penalize the performance depending on the number of endpoints or the possible cardinality of the URI requested by the users.
  • 29. Composed of a set of go packages designed as building blocks to create pipes and processors between an exposed endpoint and one or several backends resources CONFIG ROUTER PROXY
  • 30. Components Service definition Endpoints exposed to the clients Processing and backend interaction CONFIG ROUTER PROXY
  • 31. The config package The config package defines the entire service. In the building stage, all the pipes are defined, with their tasks, helpers and generators. Each pipe will be binded to an endpoint via their outer common interface, resulting in a HTTP handler function.
  • 32. The router package The router layer is responsible for setting up the HTTP(S) services, binding the endpoints defined by the config and transforming the HTTP request into proxy requests before delegating the task to the inner layer (proxy). When the internal proxy layer returns a response, the router layer converts it into a proper HTTP response and sends it to the user. This layer can be easily extended in order to use any HTTP router, framework or middleware. Adding transport layer adapters for other protocols (Thrift, gRPC, AMQP, NATS, etc) is in the roadmap.
  • 33. The proxy package Where most of the KrakenD components and features are placed. It defines two important interfaces, designed to be stacked: ● Proxy is a function that converts a given context and request into a response. ● Middleware is a function that accepts one or more proxies and returns a single proxy wrapping them. This layer transforms the request received from the router into a single or several requests to your backend services, processes the responses and returns a single response.
  • 34. Middlewares Middlewares generate custom proxies that are chained depending on the workflow defined in the configuration until each possible branch ends in a transport-related proxy. Each of these generated proxies is able to transform the input or even clone it several times and pass it or them to the next element in the chain. They can modify the received response or responses adding all kinds of features to the generated pipe.
  • 35. Middleware examples (open source) ● Balancing: uses some type of strategy for selecting a backend host to query. ● Concurrent: improves the QoS by sending several concurrent requests to the next step of the chain and returning the first successful response using a timeout for canceling the generated workload. ● Logging: logs the received request and response and also the duration of the segment execution.
  • 36. Middleware examples (open source) ● Merging: a fork-and-join middleware. Splits the process of the request into several concurrent processes, each one against a different backend, and to merge all the received responses from those created pipes into a single one. It applies a timeout, as the concurrent one does. ● HTTP: completes the received proxy request by replacing the parameters extracted from the user request in a defined URL Pattern. ● More middlewares and components: https://github.com/devopsfaith/krakend-contrib
  • 39. Get it KrakenD: http://www.krakend.io/download/ - Source code (compile yourself) - Tarball - Debian package - RPM package - Docker image - Brew Formula
  • 40. Install and run Mac: brew install krakend krakend run -c krakend.json --- Linux: docker pull devopsfaith/krakend docker run -p 8080:8080 -v $PWD:/etc/krakend/ devopsfaith/krakend
  • 41. Give us a star if you like the project! https://github.com/devopsfaith/krakend/stargazers