Sobes.tech
Senior

If data is dynamic and changes every 10 minutes, but is read by millions per minute — what approach should be taken?

sobes.tech AI

Answer from AI

If the data is dynamic and updates every 10 minutes, but is read by millions per minute, then the key challenge is ensuring high read performance with relatively infrequent updates.

Approaches:

  • Caching: Use a distributed cache (e.g., Redis, Memcached) to store current data. Update the cache every 10 minutes.
  • Read-optimized storage: Store data in a database optimized for reading (e.g., key-value store, columnar DB).
  • Data updating: When updating data, update the cache atomically or use a "write-through" or "write-behind" strategy.
  • Versioning: Use data versioning so readers always get a consistent version.
  • Load balancing: Distribute requests across multiple replicas or shard data.

Example:

  1. The data source updates data in the database every 10 minutes.
  2. After updating, the database resets or updates the cache.
  3. Clients read data from the cache, ensuring millions of requests per minute with low latency.

Thus, the main read load is offloaded from the database via the cache, and updates happen rarely and in a controlled manner.

If data is dynamic and changes every 10 minutes, but… - sobes.tech