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 is an Open Source Company Hazelcast Products
● Hazelcast IMDG ● Apache 2 License ● Remote friendly ● Hazelcast Jet ● raised $21M series C ● Always hiring!!!! ● Hazelcast Cloud ● Management Center
@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 Partition_34 1,Austin
Backup_34 1,Austin
@mesutcelik Hazelcast and Kubernetes Caching Patterns
@mesutcelik Distributed Caching Patterns in Kubernetes ● Embedded ● Sidecar ● Proxy Cache ● Client-Server
@mesutcelik Embedded Kubernetes Cluster
POD Spring Boot Microservice
Hazelcast Member
Http Request Hazelcast Cluster
POD
Kubernetes Service Kubernetes Spring Boot Microservice
Hazelcast Member
@mesutcelik Embedded ● Simple ● Java only ● Data co-located with Microservice JVM
@mesutcelik SideCar Kubernetes Cluster
POD Python Hazelcast Microservice Member
hazelcast-client
Http Request Hazelcast Cluster
POD
Kubernetes Service Kubernetes Python Hazelcast Microservice Member
hazelcast-client
@mesutcelik Sidecar ● Simple ● Multiple Programming Languages ○ Java, Node.js, .NET, Python, Golang ● Data co-located with Microservice POD
@mesutcelik Http reverse Kubernetes Cluster proxy caching POD hazelcast-proxy Spring Boot sidecar Application Hazelcast Member
Http Request Hazelcast Cluster
POD
Hazelcast Kubernetes Service Kubernetes Member Spring Boot Application hazelcast-proxy sidecar Http reverse proxy caching
● Injecting Cache into every microservice ● No coupling with any Cache API ● Enabled w/o code change Client Server POD Kubernetes Cluster
Spring Boot Microservice
hazelcast-java-client POD Http Request Hazelcast Member POD Spring Boot Microservice
Kubernetes Service Kubernetes hazelcast-java-client
Hazelcast Cluster
POD POD Hazelcast Http Request ASP.NET Core Member Microservice
hazelcast-dotnet-client
@mesutcelik Service Kubernetes Hazelcast Cloud Kubernetes Cluster
POD Spring Boot cloud.hazelcast.com Application
hazelcast-client Hazelcast Cluster Http Request
POD
Kubernetes Service Kubernetes 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
Multi-zone Hazelcast Cluster
Availability-Zone-A Availability-Zone-B hazelcast-member -1 hazelcast-member -4
hazelcast-member -2 hazelcast-member -5
hazelcast-member -3 hazelcast-member -6
* 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/
@mesutcelik