Search code examples
cassandraakkaakka-persistencelagom

How to copy an Akka Persistence Cassandra database


We have a Lagom-based project with several microservices, each one (of course) with its own Cassandra keyspace. We need to copy the production data to our qa and dev environments. In a traditional database we would simply export all of the production data and import it into the other environments. How is this done with Akka Persistence? Can I do the same thing (i.e. blow away all dev/qa data and import from a production backup? Or will this not work?


Solution

  • Yes, you can!

    The most interesting part, assuming that everything is eventsourced, is that you only need to copy your events table. Everything else will be build from projections on startup.

    We do it very often when we want to check event migrations, debug something or even before big releases.