SlideShare ist ein Scribd-Unternehmen logo
1 von 38
@mesutcelik
Distributed Caching Patterns
in Kubernetes
Mesut Celik,Hazelcast
@mesutcelik
Mesut Celik
● Tech Lead @Hazelcast
● Java Developer
● lived in Turkey,Belgium,US
● Twitter: @mesutcelik
@mesutcelik
Agenda
● Hazelcast Introduction
● Caching Patterns
● Kubernetes Deployments
● Day 2 Operations
@mesutcelik
Hazelcast Products
● Hazelcast IMDG
● Hazelcast Jet
● Hazelcast Cloud
● Management Center
Hazelcast is an Open Source
Company
● Apache 2 License
● Remote friendly
● raised $21M series C
● Always hiring!!!!
@mesutcelik
Why Distributed Cache?
● Cache, Memory is faster than storage
● Distributed,Natural fit for Cloud-Native Deployments
@mesutcelik
Cache Layers
@mesutcelik
Caching Patterns
@mesutcelik
Cache-aside
Application
DB
Cache
Application
DB
Cache
Read-through, Write-through, Write-behind
Caching Patterns
Cache-as-SoR
@mesutcelik
Read-Through Cache
@mesutcelik
Read-Through Cache 1,MinskPartition_34
1,MinskBackup_34
@mesutcelik
Hazelcast and Kubernetes
Caching Patterns
@mesutcelik
Distributed Caching Patterns in Kubernetes
● Embedded
● Sidecar
● Proxy Cache
● Client-Server
@mesutcelik
POD
Spring Boot Microservice
Hazelcast
Member
POD
Hazelcast ClusterKubernetesService
Http Request
Embedded
Spring Boot Microservice
Hazelcast
Member
Kubernetes Cluster
@mesutcelik
Embedded
● Simple
● Java only
● Data co-located with Microservice JVM
@mesutcelik
Python
Microservice
POD
Hazelcast
Member
Python
Microservice
POD
Hazelcast
Member
Hazelcast ClusterKubernetesService
Http Request
SideCar Kubernetes Cluster
hazelcast-client
hazelcast-client
@mesutcelik
Sidecar
● Simple
● Multiple Programming Languages
○ Java, Node.js, .NET, Python, Golang
● Data co-located with Microservice POD
hazelcast-proxy
sidecar
POD
Spring Boot
Application
POD
Spring Boot
Application
Hazelcast ClusterKubernetesService
Http Request
Http reverse
proxy caching
Hazelcast
Member
hazelcast-proxy
sidecar
Hazelcast
Member
Kubernetes Cluster
Http reverse proxy caching
● Injecting Cache into every microservice
● No coupling with any Cache API
● Enabled w/o code change
@mesutcelik
POD
Spring Boot Microservice
hazelcast-java-client
Hazelcast ClusterKubernetesService
Http Request
Client Server
POD
Hazelcast
Member
POD
Hazelcast
Member
Kubernetes Cluster
POD
Spring Boot Microservice
hazelcast-java-client
POD
ASP.NET Core
Microservice
hazelcast-dotnet-client
KubernetesService
Http Request
@mesutcelik
POD
KubernetesService
Http Request
Hazelcast Cloud
POD
cloud.hazelcast.com
Hazelcast Cluster
Kubernetes Cluster
Spring Boot
Application
hazelcast-client
Spring Boot
Application
hazelcast-client
@mesutcelik
Client Server
● CaaS - Cache as a Service
● Multiple Programming Languages
○ Java, nodejs, .NET, Python, Golang
● Separate Microservice and Hazelcast Layers
@mesutcelik
Spring Boot - Hazelcast Embedded Config
@Bean
public Config hazelcastConfig() {
Config config = new Config();
JoinConfig joinConfig = config.getNetworkConfig().getJoin();
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getKubernetesConfig().setEnabled(true);
return config;
}
@mesutcelik
Spring Boot - Hazelcast Client Config
@Bean
public ClientConfig hazelcastConfig() {
ClientConfig config = new ClientConfig();
config.getNetworkConfig().getKubernetesConfig().setEnabled(true);
return config;
}
@mesutcelik
Hazelcast Cache Put and Get Operations
@Autowired
HazelcastInstance hazelcast;
Map<String, String> cities = hazelcast.getMap("cities");
cities.put("1","Minsk");
System.out.println("Best City in the world is " + cities.get("1"));
@mesutcelik
Kubernetes Deployment Options
For Hazelcast
@mesutcelik
Hazelcast Helm Chart
$ helm install stable/hazelcast
@mesutcelik
Hazelcast Kubernetes Operator
● OperatorHub.io
● Openshift 4 Operator Catalog
● IBM Cloud Private
@mesutcelik
Hazelcast Cloud
● Managed Service
● Pay as you go model
● https://cloud.hazelcast.com
@mesutcelik
Deployment Best Practices
@mesutcelik
Predictable Resource Allocation
● Calculate CPU/Memory Requirements
● Set Resource Request and Limits as the same value
@mesutcelik
Pod Anti-Affinity
● Hazelcast per K8S Node
● Large Kubernetes Clusters
● Safer in Node crushes
@mesutcelik
Multi-zone Deployment with ZONE_AWARE
hazelcast-member -1
hazelcast-member -2
hazelcast-member -3
Availability-Zone-A
hazelcast-member -4
hazelcast-member -5
hazelcast-member -6
Availability-Zone-B
Multi-zone Hazelcast Cluster
* Multi-zone if your architecture prefers availability over performance
@mesutcelik
Day 2 Operations
@mesutcelik
Scaling Hazelcast Cluster
● Manual Scaling (kubectl scale or helm upgrade)
● Horizontal Pod Autoscaler (HPA)
● Vertical Pod Autoscaler
● Cluster Autoscaler
@mesutcelik
Rolling Upgrade - Why?
● Hazelcast Version Update
● Config Change
● Adding Jar to the classpath
@mesutcelik
Rolling Upgrade - How?
● helm upgrade (--set image.tag)
● kubectl set image
● StatefulSet
● Deployment with RollingUpdateStrategy
● Enable Graceful Shutdown
● Optimized Grace Period
@mesutcelik
Monitoring
● Hazelcast Management Center
● Metrics via Prometheus
● Alerting
@mesutcelik
Thank you!
● https://twitter.com/mesutcelik
● https://github.com/mesutcelik
● https://www.linkedin.com/in/mesutcelik/

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
Chandler Huang
 

Was ist angesagt? (20)

Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy FarkasVirtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
 
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
 
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GCHadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
Hadoop Meetup Jan 2019 - Dynamometer and a Case Study in NameNode GC
 
What is new in Apache Hive 3.0?
What is new in Apache Hive 3.0?What is new in Apache Hive 3.0?
What is new in Apache Hive 3.0?
 
HazelCast
HazelCastHazelCast
HazelCast
 
[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
知っておくべきCephのIOアクセラレーション技術とその活用方法 - OpenStack最新情報セミナー 2015年9月
知っておくべきCephのIOアクセラレーション技術とその活用方法 - OpenStack最新情報セミナー 2015年9月知っておくべきCephのIOアクセラレーション技術とその活用方法 - OpenStack最新情報セミナー 2015年9月
知っておくべきCephのIOアクセラレーション技術とその活用方法 - OpenStack最新情報セミナー 2015年9月
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
NGINX Back to Basics Part 3: Security (Japanese Version)
NGINX Back to Basics Part 3: Security (Japanese Version)NGINX Back to Basics Part 3: Security (Japanese Version)
NGINX Back to Basics Part 3: Security (Japanese Version)
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 
データインターフェースとしてのHadoop ~HDFSとクラウドストレージと私~ (NTTデータ テクノロジーカンファレンス 2019 講演資料、2019...
データインターフェースとしてのHadoop ~HDFSとクラウドストレージと私~ (NTTデータ テクノロジーカンファレンス 2019 講演資料、2019...データインターフェースとしてのHadoop ~HDFSとクラウドストレージと私~ (NTTデータ テクノロジーカンファレンス 2019 講演資料、2019...
データインターフェースとしてのHadoop ~HDFSとクラウドストレージと私~ (NTTデータ テクノロジーカンファレンス 2019 講演資料、2019...
 
Building Microservices with Apache Kafka
Building Microservices with Apache KafkaBuilding Microservices with Apache Kafka
Building Microservices with Apache Kafka
 
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Apache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudApache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the Cloud
 
Apache Sparkにおけるメモリ - アプリケーションを落とさないメモリ設計手法 -
Apache Sparkにおけるメモリ - アプリケーションを落とさないメモリ設計手法 -Apache Sparkにおけるメモリ - アプリケーションを落とさないメモリ設計手法 -
Apache Sparkにおけるメモリ - アプリケーションを落とさないメモリ設計手法 -
 
Big Data: Architecture and Performance Considerations in Logical Data Lakes
Big Data: Architecture and Performance Considerations in Logical Data LakesBig Data: Architecture and Performance Considerations in Logical Data Lakes
Big Data: Architecture and Performance Considerations in Logical Data Lakes
 
Hazelcast
HazelcastHazelcast
Hazelcast
 

Ähnlich wie Distributed Caching in Kubernetes with Hazelcast

Spark on Dataproc - Israel Spark Meetup at taboola
Spark on Dataproc - Israel Spark Meetup at taboolaSpark on Dataproc - Israel Spark Meetup at taboola
Spark on Dataproc - Israel Spark Meetup at taboola
tsliwowicz
 

Ähnlich wie Distributed Caching in Kubernetes with Hazelcast (20)

High Performance Cloud-Native Microservices With Distributed Caching
High Performance Cloud-Native Microservices With Distributed CachingHigh Performance Cloud-Native Microservices With Distributed Caching
High Performance Cloud-Native Microservices With Distributed Caching
 
Cache first cloud native microservices
Cache first cloud native microservicesCache first cloud native microservices
Cache first cloud native microservices
 
High Performance Cloud-Native Microservices IndyCloudConf 2020
High Performance Cloud-Native Microservices IndyCloudConf 2020High Performance Cloud-Native Microservices IndyCloudConf 2020
High Performance Cloud-Native Microservices IndyCloudConf 2020
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Hazelcast Essentials
Hazelcast EssentialsHazelcast Essentials
Hazelcast Essentials
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Gimme Caching - The JCache Way
Gimme Caching - The JCache WayGimme Caching - The JCache Way
Gimme Caching - The JCache Way
 
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
 
What’s new in cas 4.2
What’s new in cas 4.2 What’s new in cas 4.2
What’s new in cas 4.2
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Think Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayThink Distributed: The Hazelcast Way
Think Distributed: The Hazelcast Way
 
Cloud native java script apps
Cloud native java script appsCloud native java script apps
Cloud native java script apps
 
Spark on Dataproc - Israel Spark Meetup at taboola
Spark on Dataproc - Israel Spark Meetup at taboolaSpark on Dataproc - Israel Spark Meetup at taboola
Spark on Dataproc - Israel Spark Meetup at taboola
 
Bkbiet day2 & 3
Bkbiet day2 & 3Bkbiet day2 & 3
Bkbiet day2 & 3
 
High available BizTalk infrastructure on Azure IaaS
High available BizTalk infrastructure on Azure IaaSHigh available BizTalk infrastructure on Azure IaaS
High available BizTalk infrastructure on Azure IaaS
 
Distributed caching and computing v3.7
Distributed caching and computing v3.7Distributed caching and computing v3.7
Distributed caching and computing v3.7
 
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-Persistence
 
GWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouGWT 2 Is Smarter Than You
GWT 2 Is Smarter Than You
 
Bootstrapping Clusters with EKS Blueprints.pptx
Bootstrapping Clusters with EKS Blueprints.pptxBootstrapping Clusters with EKS Blueprints.pptx
Bootstrapping Clusters with EKS Blueprints.pptx
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
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
vu2urc
 

Kürzlich hochgeladen (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Distributed Caching in Kubernetes with Hazelcast