monitoring mysql for changes

后端 未结 5 531
陌清茗
陌清茗 2021-01-18 20:16

I have a Java app using a MySQL database through hibernate. The database is really used as persistence layer: The database is read at the initial load of the program, and

5条回答
  •  温柔的废话
    2021-01-18 20:34

    Instead of caching the database contents within the memory space of the Java app, you could use an external cache like memcached or Ehcache. When either process updates (or reads) from the database, have it update memcached as well.

    This way whenever either process updates the DB, its updates will be in the cache that the other process reads from.

提交回复
热议问题