Ronald and Konrad. Firstly thanks for your responses.

So, as it so happens I do want my actor to be persistent in the sense that 
I do want to be able to shutdown my actor, restart it and have it back to 
the state it was in before it was shutdown. akka-persistence is a great fit 
for that. Now I want the state of this actor to also be replicated for HA 
purposes so that when my actor cannot start up or I cannot connect to it I 
should be able to connect to a replica and keep going. This is where raft 
comes in.

The only thing frankly which was stopping me from using akka-persistence 
was the fact that I could not read entries in the log directly. I have a 
workaround for that and I think it may work for me. Basically here is how 
it works - besides persisting the log onto disk with akka-persistence I 
also maintain the log in-memory. The in-memory log is trimmed when I create 
a snapshot. Since akka-persistence creates a snapshot of the whole journal 
and not upto a specific journal entry my snapshot consists both of the 
state of the actor and all the "unapplied entries" from the log. The 
in-memory log after a snapshot is created is therefore only the entries 
which were not applied to the state. 

This workaround of mine will use more memory certainly but overall I think 
it may not be bad as it does make reading log entries faster.

Let me know if you have concerns about my approach.

Thanks,
-Moiz

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to