读取端延迟和响应度

时间:2019-06-20 04:52:45

标签: mysql scala lagom

我正在将Lagom与MySQL配合使用,并且遇到延迟问题。我正在使用ES和CQRS。我已经整合了后端服务和前端服务,现在遇到了一些问题。每次都要刷新页面以获得响应,因为它花了一些时间存储在MySQL数据库中。存储存在滞后性,因此从数据库中获取数据会产生较晚的响应。 有办法解决这个问题吗? 预先感谢

我尝试在配置文件中提供一些设置,但没有得到想要的结果。

lagom.persistence.jdbc {

 # Configuration for creating tables
 create-tables {

   # Whether tables should be created automatically as needed
   auto = true

   # How long to wait for tables to be created, before failing
   timeout = 20s

   # The cluster role to create tables from
   run-on-role = ""

   # Exponential backoff for failures configuration for creating tables
   failure-exponential-backoff {

     # minimum (initial) duration until processor is started again
     # after failure
     min = 3s

     # the exponential back-off is capped to this duration
     max = 30s

     # additional random delay is based on this factor
     random-factor = 0.2
   }
 }
}

1 个答案:

答案 0 :(得分:0)

我认为您无法在ES和CQRS中解决此问题,因为它的目标之一是将书写和阅读部分分开。因此,正常情况下,读取侧面投影和书写部分的值可能会有所不同。

您不能尝试直接从持久性实体中读取内容;