Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Akka Persistence

Akka persistence enables stateful actors to persist in their internal state so that it can be recovered when an actor is started, restarted after a JVM crash or by a supervisor, or migrated in a cluster. The key concept behind Akka persistence is that only changes to an actor’s internal state are persisted but never its current state directly (except for optional snapshots). These changes are only ever appended to storage, nothing is ever mutated, which allows for very high transaction rates and efficient replication. Stateful actors are recovered by replaying stored changes to these actors from which they can rebuild internal state. This can be either the full history of changes or starting from a snapshot which can dramatically reduce recovery times. Akka persistence also provides point-to-point communication with at-least-once message delivery semantics.

  • Login to see the comments

  • Be the first to like this

Akka Persistence

  1. 1. An overview: Akka Persistence Prabhat Kashyap Sr. Software Consultant Knoldus Inc.
  2. 2. Agenda ● Introduction ● Architecture ● Creating Akka Persistence ● Persistence FSM ● Persistence Query
  3. 3. Introduction Actor Names: Empty Message
  4. 4. Introduction Actor Names: [Test]
  5. 5. Introduction Actor Names: [Test] Crashed
  6. 6. Introduction Actor Names: Empty Crashed
  7. 7. Introduction Actor Names: Empty Crashed Database
  8. 8. Introduction Actor Names: [Test] Database
  9. 9. Introduction Actor
  10. 10. Introduction Message Actor
  11. 11. Introduction Message Actor Command
  12. 12. Introduction Message Actor Command Database Event
  13. 13. Architecture ● PersistentActor ● AsyncWriteJournal ● Snapshot store
  14. 14. Persistence Query ● CQRS Pattern ● Introduction ● System to view Account Logs
  15. 15. CQRS Pattern
  16. 16. Queries ● persistenceIds ● currentPersistenceIds ● eventsByPersistenceId ● currentEventsByPersistenceId ● eventsByTag ● currentEventsByTag
  17. 17. References ● Salma Khater’s course on learning Akka. ● Akka Documentation.