SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
OTTIMIZZARE LE PERFORMANCE
DELL'API SERVER K8S:
COME UTILIZZARE CACHE ED
EVENTI PER IMPLEMENTARE IL
CHANGE DATA CAPTURE
By
Diego Braga, Product Manager
@ Krateo PlatformOps
&
Luigi Fugaro, Sr. Solution Architect
@ Redis
”STOP QUERYING
AND START
CACHING”
- Kubernetes API server
WHY ARE WE PRESENTING THIS TALK?
Kubernetes is becoming the de facto industrial standard for
orchestrating cloud-native applications.
What if we want to treat Kubernetes as a platform that is
interrogated by different clients via API? This could generate a
lot of requests to the API server.
Kubernetes doesn't offer caching out of the box, so
what could be the best pattern to implement it?
WHAT IS A CACHE
Prompt: "Briefly describe what is a cache."
Response: "A cache is a hardware or software
component that stores data so future requests
for that data can be served faster. The data
stored in a cache might be the results of an
earlier computation, or duplicates of data
stored elsewhere. A cache hit occurs when the
requested data can be found in a cache, while a
cache miss occurs when it cannot."
Caches are utilized because the data
stored in a cache can often be
delivered faster than re-fetching or
recomputing the original data. This is
due to the principles of the locality of
reference, where programs access data
and instructions in localized areas.
Common types of caches include CPU
caches, web caches, and database
caches. By storing frequently accessed
information, caches reduce data access
latency, decrease bandwidth
consumption, and improve overall
system performance.
CACHE-ASIDE
READ-THROUGH
WRITE-THROUGH
Cache-miss managed at application
level.
Cache-miss managed at cache
provider level.
Write data in the cache and
automatically update the db. SYNC
CACHING PATTERNS
WRITE-BEHIND Write data in the cache and
automatically update the db. ASYNC
CHANGE DATA CAPTURE
Prompt: "Briefly describe what is change data
capture."
Response: "Change Data Capture (CDC) is a
design pattern that enables tracking and
capturing changes in data so that other software
(like ETL tools, data replication tools, or data
auditing tools) can respond to those changes.
The changes might include insertions, updates,
and deletions that are performed on a database
table."
AUTOMATION
OFFLOADING
CQRS DESIGN PATTERN
KUBERNETES API SERVER
The API server is a component of the
Kubernetes control plane that exposes the
Kubernetes API. The API server is the
front end for the Kubernetes control plane
KUBERNETES
INFORMERS
As the center of Kubernetes
communication components,
API Server receives requests,
contacts etcd, and manages all
the resource objects. So it
would be under pressure easily.
To ease API Server’s
pressure, Kubernetes
employed a message
system called Informer,
which guarantees message
delivery and provides high-
performance real-time
delivery, like any other
famous message system.
Informers query the
resource data and store it in
a local cache. Once stored,
an event is only generated
when it detects a change in
the object (or resource)
state.
KUBERNETES CLIENT
The following client libraries are officially maintained
by Kubernetes SIG API Machinery.
C
DOTNET
GO
HASKELL
JAVA
JAVASCRIPT
PERL
PYTHON
RUBY
USE CASE
Leveraging client-javascript, we wrote a
backend that exposes an API to query
Kubernetes resources: via query parameter is
it possible to use Redis as cache or interact
directly with the API server
USE CASE
ARCHITECTURE
CACHE WARM UP
When the Informer is instantiated, all
the existing resources are pushed
into the cache
AVOID CACHE MISS
The client will always find an entry in
the cache if the resource exists in
Kubernetes
CACHE UPDATE
The Change Data Capture is
implemented via the Informer that
is notified for every resource
change from the API server - and
the microservice will set, update or
delete the key
2
3
1
Client
Webserver
(express.js)
Cache
Kubernetes API server
Informer
(client-javascript)
/cache=true
/cache=false
CODE SNIPPET A new Informer is instantiated for any kind of Resource
available in the cluster (namespaces or cluster-scoped)
and it interacts directly with the cache
CODE SNIPPET If the 'cache' query parameter is set to 'true' (or not
specified), the webservice will inquiry the cache,
otherwise it will call directly the API server
LOG SNIPPET When a new Kubernetes Resource is created / updated /
deleted (i.e. via 'kubectl'), the Change Data Capture pattern is
implemented with the Informer that creates / updates /
deletes the key in the cache
MAX No Cache MAX Cache
0
1000
2000
3000
4000
5000
10 requests 50 requests 100 requests 150 requests 200 requests
USE CASE
RESULTS
Max 10 concurrent requests
to inquiry a single resource
Duration of 30 seconds
AVG No Cache AVG Cache
0.00
500.00
1000.00
1500.00
2000.00
10 requests 50 requests 100 requests 150 requests 200 requests
USE CASE
RESULTS
Max 10 concurrent requests
to inquiry a single resource
Duration of 30 seconds
CONCLUSIONS
Kubernetes is not only an
orchestrator for containerized
applications but a platform
that can be elevated by
leveraging all the existing
features.
One feature that is missing
is caching for clients that
interact with Kubernetes as
a backend that exposes
resources via API.
Change Data Capture is a
pattern that is already
implemented in Kubernetes
client libraries with the
Informer object.
There are different caching
patterns that can be
implemented at the
application level or cache
provider level.
Placing a cache between
the client and the API server
can enhance latencies by
one order of magnitude.
THANK YOU

Mais conteúdo relacionado

Semelhante a Ottimizzare le performance dell'API Server K8s come utilizzare cache e eventi per implementare il Change Data Capture

01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMwareVMUG IT
 
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech TalkOperatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech TalkRed Hat Developers
 
Introducing windows server_app_fabric
Introducing windows server_app_fabricIntroducing windows server_app_fabric
Introducing windows server_app_fabricMarco Titta
 
Elastic Morocco Meetup Nov 2020
Elastic Morocco Meetup Nov 2020Elastic Morocco Meetup Nov 2020
Elastic Morocco Meetup Nov 2020Anna Ossowski
 
Event Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDBEvent Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDBScyllaDB
 
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
Service Discovery in MicroServices
Service Discovery in MicroServicesService Discovery in MicroServices
Service Discovery in MicroServicesSRINIVAS KOLAPARTHI
 
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Codemotion
 
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 PreviewCloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 PreviewChip Childers
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...Tobias Schneck
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptxRyuzaki360
 
Cinema booking system | Movie Booking System
Cinema booking system | Movie Booking SystemCinema booking system | Movie Booking System
Cinema booking system | Movie Booking Systemsekarsadasivam
 
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...Michael Elder
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 
Simplify and Boost Spark 3 Deployments with Hypervisor-Native Kubernetes
Simplify and Boost Spark 3 Deployments with Hypervisor-Native KubernetesSimplify and Boost Spark 3 Deployments with Hypervisor-Native Kubernetes
Simplify and Boost Spark 3 Deployments with Hypervisor-Native KubernetesDatabricks
 

Semelhante a Ottimizzare le performance dell'API Server K8s come utilizzare cache e eventi per implementare il Change Data Capture (20)

01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
A quick introduction to AKS
A quick introduction to AKSA quick introduction to AKS
A quick introduction to AKS
 
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech TalkOperatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
 
Introducing windows server_app_fabric
Introducing windows server_app_fabricIntroducing windows server_app_fabric
Introducing windows server_app_fabric
 
Elastic Morocco Meetup Nov 2020
Elastic Morocco Meetup Nov 2020Elastic Morocco Meetup Nov 2020
Elastic Morocco Meetup Nov 2020
 
Event Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDBEvent Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDB
 
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
 
Cisco project ideas
Cisco   project ideasCisco   project ideas
Cisco project ideas
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
Service Discovery in MicroServices
Service Discovery in MicroServicesService Discovery in MicroServices
Service Discovery in MicroServices
 
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
 
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
 
Amazon EKS Deep Dive
Amazon EKS Deep DiveAmazon EKS Deep Dive
Amazon EKS Deep Dive
 
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 PreviewCloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
 
Cinema booking system | Movie Booking System
Cinema booking system | Movie Booking SystemCinema booking system | Movie Booking System
Cinema booking system | Movie Booking System
 
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Simplify and Boost Spark 3 Deployments with Hypervisor-Native Kubernetes
Simplify and Boost Spark 3 Deployments with Hypervisor-Native KubernetesSimplify and Boost Spark 3 Deployments with Hypervisor-Native Kubernetes
Simplify and Boost Spark 3 Deployments with Hypervisor-Native Kubernetes
 

Mais de Luigi Fugaro

Sharp Coding 2023 - Luigi Fugaro - ACRE.pdf
Sharp Coding 2023 - Luigi Fugaro - ACRE.pdfSharp Coding 2023 - Luigi Fugaro - ACRE.pdf
Sharp Coding 2023 - Luigi Fugaro - ACRE.pdfLuigi Fugaro
 
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AIRed Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AILuigi Fugaro
 
Unleashing the Power of Vector Search in .NET - DotNETConf2024.pdf
Unleashing the Power of Vector Search in .NET - DotNETConf2024.pdfUnleashing the Power of Vector Search in .NET - DotNETConf2024.pdf
Unleashing the Power of Vector Search in .NET - DotNETConf2024.pdfLuigi Fugaro
 
Unleashing the Power of Vector Search in .NET - SharpCoding2024.pdf
Unleashing the Power of Vector Search in .NET - SharpCoding2024.pdfUnleashing the Power of Vector Search in .NET - SharpCoding2024.pdf
Unleashing the Power of Vector Search in .NET - SharpCoding2024.pdfLuigi Fugaro
 
Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23
Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23
Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23Luigi Fugaro
 
Codemotion Milan '22 - Real Time Data - No CRDTs, no party!
Codemotion Milan '22 - Real Time Data - No CRDTs, no party!Codemotion Milan '22 - Real Time Data - No CRDTs, no party!
Codemotion Milan '22 - Real Time Data - No CRDTs, no party!Luigi Fugaro
 
OpenSlava 2018 - Cloud Native Applications with OpenShift
OpenSlava 2018 - Cloud Native Applications with OpenShiftOpenSlava 2018 - Cloud Native Applications with OpenShift
OpenSlava 2018 - Cloud Native Applications with OpenShiftLuigi Fugaro
 
Redis - Non solo cache
Redis - Non solo cacheRedis - Non solo cache
Redis - Non solo cacheLuigi Fugaro
 
JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017Luigi Fugaro
 
2.5tier Javaday (italian)
2.5tier Javaday (italian)2.5tier Javaday (italian)
2.5tier Javaday (italian)Luigi Fugaro
 

Mais de Luigi Fugaro (10)

Sharp Coding 2023 - Luigi Fugaro - ACRE.pdf
Sharp Coding 2023 - Luigi Fugaro - ACRE.pdfSharp Coding 2023 - Luigi Fugaro - ACRE.pdf
Sharp Coding 2023 - Luigi Fugaro - ACRE.pdf
 
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AIRed Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
 
Unleashing the Power of Vector Search in .NET - DotNETConf2024.pdf
Unleashing the Power of Vector Search in .NET - DotNETConf2024.pdfUnleashing the Power of Vector Search in .NET - DotNETConf2024.pdf
Unleashing the Power of Vector Search in .NET - DotNETConf2024.pdf
 
Unleashing the Power of Vector Search in .NET - SharpCoding2024.pdf
Unleashing the Power of Vector Search in .NET - SharpCoding2024.pdfUnleashing the Power of Vector Search in .NET - SharpCoding2024.pdf
Unleashing the Power of Vector Search in .NET - SharpCoding2024.pdf
 
Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23
Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23
Caching Patterns for lazy devs for lazy loading - Luigi Fugaro VDTJAN23
 
Codemotion Milan '22 - Real Time Data - No CRDTs, no party!
Codemotion Milan '22 - Real Time Data - No CRDTs, no party!Codemotion Milan '22 - Real Time Data - No CRDTs, no party!
Codemotion Milan '22 - Real Time Data - No CRDTs, no party!
 
OpenSlava 2018 - Cloud Native Applications with OpenShift
OpenSlava 2018 - Cloud Native Applications with OpenShiftOpenSlava 2018 - Cloud Native Applications with OpenShift
OpenSlava 2018 - Cloud Native Applications with OpenShift
 
Redis - Non solo cache
Redis - Non solo cacheRedis - Non solo cache
Redis - Non solo cache
 
JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017
 
2.5tier Javaday (italian)
2.5tier Javaday (italian)2.5tier Javaday (italian)
2.5tier Javaday (italian)
 

Último

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Último (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Ottimizzare le performance dell'API Server K8s come utilizzare cache e eventi per implementare il Change Data Capture

  • 1. OTTIMIZZARE LE PERFORMANCE DELL'API SERVER K8S: COME UTILIZZARE CACHE ED EVENTI PER IMPLEMENTARE IL CHANGE DATA CAPTURE By Diego Braga, Product Manager @ Krateo PlatformOps & Luigi Fugaro, Sr. Solution Architect @ Redis
  • 3.
  • 4. WHY ARE WE PRESENTING THIS TALK? Kubernetes is becoming the de facto industrial standard for orchestrating cloud-native applications. What if we want to treat Kubernetes as a platform that is interrogated by different clients via API? This could generate a lot of requests to the API server. Kubernetes doesn't offer caching out of the box, so what could be the best pattern to implement it?
  • 5. WHAT IS A CACHE Prompt: "Briefly describe what is a cache." Response: "A cache is a hardware or software component that stores data so future requests for that data can be served faster. The data stored in a cache might be the results of an earlier computation, or duplicates of data stored elsewhere. A cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when it cannot." Caches are utilized because the data stored in a cache can often be delivered faster than re-fetching or recomputing the original data. This is due to the principles of the locality of reference, where programs access data and instructions in localized areas. Common types of caches include CPU caches, web caches, and database caches. By storing frequently accessed information, caches reduce data access latency, decrease bandwidth consumption, and improve overall system performance.
  • 6. CACHE-ASIDE READ-THROUGH WRITE-THROUGH Cache-miss managed at application level. Cache-miss managed at cache provider level. Write data in the cache and automatically update the db. SYNC CACHING PATTERNS WRITE-BEHIND Write data in the cache and automatically update the db. ASYNC
  • 7. CHANGE DATA CAPTURE Prompt: "Briefly describe what is change data capture." Response: "Change Data Capture (CDC) is a design pattern that enables tracking and capturing changes in data so that other software (like ETL tools, data replication tools, or data auditing tools) can respond to those changes. The changes might include insertions, updates, and deletions that are performed on a database table." AUTOMATION OFFLOADING CQRS DESIGN PATTERN
  • 8. KUBERNETES API SERVER The API server is a component of the Kubernetes control plane that exposes the Kubernetes API. The API server is the front end for the Kubernetes control plane
  • 9. KUBERNETES INFORMERS As the center of Kubernetes communication components, API Server receives requests, contacts etcd, and manages all the resource objects. So it would be under pressure easily. To ease API Server’s pressure, Kubernetes employed a message system called Informer, which guarantees message delivery and provides high- performance real-time delivery, like any other famous message system. Informers query the resource data and store it in a local cache. Once stored, an event is only generated when it detects a change in the object (or resource) state.
  • 10. KUBERNETES CLIENT The following client libraries are officially maintained by Kubernetes SIG API Machinery. C DOTNET GO HASKELL JAVA JAVASCRIPT PERL PYTHON RUBY
  • 11. USE CASE Leveraging client-javascript, we wrote a backend that exposes an API to query Kubernetes resources: via query parameter is it possible to use Redis as cache or interact directly with the API server
  • 12. USE CASE ARCHITECTURE CACHE WARM UP When the Informer is instantiated, all the existing resources are pushed into the cache AVOID CACHE MISS The client will always find an entry in the cache if the resource exists in Kubernetes CACHE UPDATE The Change Data Capture is implemented via the Informer that is notified for every resource change from the API server - and the microservice will set, update or delete the key 2 3 1 Client Webserver (express.js) Cache Kubernetes API server Informer (client-javascript) /cache=true /cache=false
  • 13. CODE SNIPPET A new Informer is instantiated for any kind of Resource available in the cluster (namespaces or cluster-scoped) and it interacts directly with the cache
  • 14. CODE SNIPPET If the 'cache' query parameter is set to 'true' (or not specified), the webservice will inquiry the cache, otherwise it will call directly the API server
  • 15. LOG SNIPPET When a new Kubernetes Resource is created / updated / deleted (i.e. via 'kubectl'), the Change Data Capture pattern is implemented with the Informer that creates / updates / deletes the key in the cache
  • 16. MAX No Cache MAX Cache 0 1000 2000 3000 4000 5000 10 requests 50 requests 100 requests 150 requests 200 requests USE CASE RESULTS Max 10 concurrent requests to inquiry a single resource Duration of 30 seconds
  • 17. AVG No Cache AVG Cache 0.00 500.00 1000.00 1500.00 2000.00 10 requests 50 requests 100 requests 150 requests 200 requests USE CASE RESULTS Max 10 concurrent requests to inquiry a single resource Duration of 30 seconds
  • 18. CONCLUSIONS Kubernetes is not only an orchestrator for containerized applications but a platform that can be elevated by leveraging all the existing features. One feature that is missing is caching for clients that interact with Kubernetes as a backend that exposes resources via API. Change Data Capture is a pattern that is already implemented in Kubernetes client libraries with the Informer object. There are different caching patterns that can be implemented at the application level or cache provider level. Placing a cache between the client and the API server can enhance latencies by one order of magnitude.