Cloudstate
The Cloudstate-Dapr integration is unique in the sense that it enables developers to achieve high-throughput, low latency scenarios by leveraging Cloudstate running as a sidecar next to Dapr, keeping the state near the compute unit for optimal performance while providing replication between multiple instances that can be safely scaled up and down. This is due to Cloudstate forming an Akka cluster between its sidecars with replicated in-memory entities.
Dapr leverages Cloudstate’s CRDT capabilities with last-write-wins semantics.
To install Cloudstate on your Kubernetes cluster, run the following commands:
The next step is to create a Dapr component for Cloudstate.
Create the following YAML file named cloudstate.yaml
:
The field specifies the address for the Cloudstate API. Since Cloudstate will be running as an additional sidecar in the pod, you can reach it via localhost
with the default port of 8013
.
To apply the Cloudstate state store to Kubernetes, use the kubectl
CLI:
The next examples shows you how to manually inject a Cloudstate sidecar into a Dapr enabled deployment:
Notice the HTTP_PORT
for the container is the port to be used in the Cloudstate component yaml in host
.