How was data distributed across Redis instances (sharding or full replication)?
AI answer
It depends on the configuration. In Redis Cluster, data is sharded across slots: each master stores its portion of the keys, while replicas usually duplicate the corresponding master’s data for fault tolerance. In a Sentinel configuration, data is generally fully replicated across nodes—this is not sharding. When discussing a specific project, it’s worth clarifying which mode was configured.
Also asked at Коммит (Аутстафф на проект "Ростелекома")
- How to protect the system from creating multiple payments if the user presses the pay button many times?
- How is the N+1 query problem solved in ORM?
- What types of indexes are available in PostgreSQL?
- There are several services (2-3), and there is an end-to-end business scenario passing through all services. If an operation on one of the services in the middle or at the end fails, the system ends up in an inconsistent state. What methods can be used to achieve inter-service transactionality (either the entire scenario is applied, or none of it is), if each service has its own database?
- What databases have you worked with the most?
Similar questions
- How was Redis set up in your project (one instance or several)?
- What happened if a particular Redis cache instance went down?
- Can we ensure data durability in Redis if the service crashes, so that we don't lose shopping carts?
- How did you use Redis at CVM—as a cache, a key-value store, or a message broker?
- What is a Cache Stampede (the problem of simultaneous TTL expiration), and how can you protect a system from degradation when hot keys are invalidated?