原书出处
Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…
11 Distributed Caching
In read-through caching, the cache acts as an intelligent intermediary between your application and the database. When the application requests data, it only needs to talk to the cache, as follows: # Without read-through caching def get_product(product_id): product = cache.get(product_id) if not product: product = database.get(product_id) cache.set(product_id, product) return product # With read-through caching def get_product(product_id): return cache_client.get(product_id) # Cache handles DB interaction if needed Write through caching Write-through cache is a caching strategy that simultaneously writes data to the cache and the main memory.
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch11.xhtml
EPUB SHA-256:357a47122841cb03cd2ff1d58b4eb7ee46e4e6e2e56a004d65a18587568e05ff