Cache mode

Read cache

  • First read the data in the cache, not only read the data in the database
  • Reads the pressure to solve the database
  • the way
    • cache aside specific application to complete the reading and writing operations
    • read through specific read and write operations to the cache layer is completed, even if the latter modify storage solutions, business need to modify the code, in favor of reconstruction and infrastructure upgrade project

  • Write cache
    • First write cache, and then written to the database
    • Writes pressure to resolve the database
    • the way
      • Specific to write through write caching layer is complete, the database is updated immediately
      • DETAILED write behind caching buffer layer to complete the read operation, the timing of asynchronous update the database
    • Realization of ideas
      • The operation of saving data to the message queue (redis / rabbitMQ etc.), celery executed as asynchronous consumers

Guess you like

Origin www.cnblogs.com/oklizz/p/11420247.html