i’m searching for an Akka pattern for database operations. I have an actorsystem with lots of databases and my actors are interacting with them (read, write). For managing the reads and writes, i have two ideas:
- Each database has one main actor that is connected to the database and receives the read and write requests from other actors.
- Every actor that needs data from this database is connecting on it’s own. So i have several connections to the database (read and write).
The first approach maybe causes data inconsistency and the second idea can create data bottleneck. In addition to that i know, that it’s important which API is behind the database (blocking or non-blocking).
Does somebody know a design pattern or general Rules for this situation?
Thanks for your help!