What is the folder of ddata-{akka-system-name}-replicator-2551 used for?

I’m using akka cluster, akka sharding and akka persistence for my system. When the system is running, I notice there is always a folder called ddata-{akka-system-name}-replicator-2551 created in the current working directory. I guess it’s used for storing akka persistence information, because if I experimentally delete the folder, my persistent actor cannot restore its state when the cluster restarts.
So my question here is if I deploy my akka cluster into Kubernetes, should I use k8s StatefulSet to use stable persistent volume to keep the ddata folder there between Pod restarts? I’ve referred to all akka kubernetes examples online, but all are using regular k8s stateless ReplicaSet/Deployment. I don’t find an akka persistence / k8s example so far.

You might have remember-entities enabled?

When rememberEntities is enabled, whenever a Shard is rebalanced onto another node or recovers after a crash, it will recreate all the entities which were previously running in that Shard .
Cluster Sharding • Akka Documentation

Or if you use distributed-data, this file will also be created.

Sorry, just read your question again+ now in detail.
If its important for your pod to be able to restart its state, you’ll need to either attach some persistence to it (like you described) or switch to an eventsourced-store, e.g.

akka.cluster.sharding.remember-entities-store = eventsourced

else if the pod looses its directory between redeploys, the state (which actors are running) is also gone.

So my question here is if I deploy my akka cluster into Kubernetes, should I use k8s StatefulSet to use stable persistent volume to keep the ddata folder there between Pod restarts

I’d say: yes

Hi Dominik,
Many thanks. You pointed me in the right direction. I’ll use K8s StatefulSet with Persistent Volume to store the ddata that “akka.cluster.sharding.remember-entities = on” needs.
I also found the setting of akka.cluster.sharding.distributed-data.durable.lmdb.dir to set a location for the ddata, instead of relying on default directory. So I can put ddata into any mount point of Persistent Volume in container, that’s very convenient.

If you already use Akka Persistence for other reasons (EventSourcedBehavior or PersistentActor) I would recommend that you use the eventsourced option for the remember-entities also. More reliable and you don’t have to deal with the persistent volumes and unique directory names.