每个数据库实体一个 Akka 演员?

One Akka actor per database entity?

每个数据库实体有一个 Akka actor 是常见的做法吗?也就是说,它应该像这样使用吗?

假设我们有数以万计的用户,对于我们 Play 网站上的每个登录用户,我们创建一个 actor,其中子 actor 代表关系数据库中的相关数据。 actors vs. entities

有没有更好的方法?有什么优缺点?

请查看akka actor系统文档http://doc.akka.io/docs/akka/2.4.7/general/actor-systems.html

A common pattern is to create a router for N actors, each of which wraps a single DB connection and handles queries as sent to the router. The number N must then be tuned for maximum throughput, which will vary depending on which DBMS is deployed on what hardware.