Hi,
I'm writing a program to process some commands from an external party. Those commands act against some phone numbers. One actor is used to read the commands from files line-by-line. Then it issues the commands one by one (in Akka messages) to another actor. That actor will perform a series of operations according to the command it receives. The operations involves calling some external SOAP APIs and checking/updating some states in the program. I'm using separate actors to handle different SOAP APIs. Up to now, everything seems clear to me.
Then the problem is, I need to maintain a large state in the program in the format of HashMap<String, MyData>, where MyData is a POJO containing a few fields, and the size of the map could be as large as 1 million. So I'm wondering how I should keep such a large state in Akka while allowing simultaneous insert/delete of records by other actors. It mostly won't perform well if I copy the whole object. What is the recommended way of doing such kind of thing? I'm thinking, if I use an embedded in-memory key-value store, and allow my actor to access it, I can let the IMDB handle the concurrency stuff and let multiple instances of the actor to access the data. However, does Akka have some easier ways to do it? Any suggestion is highly appreciated. Thanks!
Kane