High Performance Cloud-Native Microservices With ... · High Performance Cloud-Native Microservices...
Transcript of High Performance Cloud-Native Microservices With ... · High Performance Cloud-Native Microservices...
@mesutcelik
High Performance Cloud-Native Microservices With Distributed Caching
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
Read-Through Cache
@mesutcelik
Read-Through Cache 1,Austin Partition_34
1,Austin Backup_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 Cluster K
ubern
ete
s S
erv
ice
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 Cluster K
ubern
ete
s S
erv
ice
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 Cluster K
ubern
ete
s S
erv
ice
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 Cluster K
ubern
ete
s S
erv
ice
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
Kubern
ete
s S
erv
ice
Http Request
@mesutcelik
POD
Kubern
ete
s S
erv
ice
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 Hazelcast Cluster Maintenance
@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
Day 2 Operations
● Manual Scaling vs. AutoScaling
● Rolling Update
● Monitoring
@mesutcelik
Thank you!
● https://twitter.com/mesutcelik
● https://github.com/mesutcelik
● https://www.linkedin.com/in/mesutcelik/