|
|
|
|
|
by toast0
819 days ago
|
|
My experience with databases in Erlang was using the pattern where one process recieves a high level message and does the database work was best. If you can split the queue in a sensible way, that gives you concurrency; for example if all the requests address a single user, you can hash users into as many buckets as you need for concurrency; if the individual requests take a long time, it might make more sense to keep a scoreboard of if a user has a process working for it, and send further requests there, otherwise to an idle process (or spawn). You do need to manage this somehow, but the building blocks are there. Of course, the building blocks for transactionless database access are there too. |
|