- Newest
- Most votes
- Most comments
You've raised some important points about Amazon ElastiCache Serverless and its replication behavior. Let's clarify a few things:
-
ElastiCache Serverless does indeed use asynchronous replication across multiple Availability Zones (AZs) for higher availability and improved read latency. This means that there is a possibility of data loss in the event of a primary node failure, as the most recent writes may not have been replicated to all AZs yet.
-
The claim that node failures are transparent to your application refers to the high availability and automatic failover capabilities of ElastiCache Serverless. While it aims to minimize disruption, it doesn't guarantee zero data loss in all scenarios.
-
Regarding synchronous vs. asynchronous replication within and across AZs, ElastiCache Serverless documentation doesn't explicitly state that it uses synchronous replication within the same AZ. The service is designed to abstract these details from users, focusing on providing high availability and scalability.
-
For your use case with Redisson for distributed locks, the lack of support for the
wait
command in ElastiCache Serverless could indeed impact the durability of locks. Without the ability to ensure synchronous replication, there's a risk that a lock might not be fully propagated across all nodes before a failover occurs. -
Your concern about Redisson
RLock
not being a durable lock in this context is valid. The combination of asynchronous replication and the absence of thewait
command means that there's no guarantee of immediate consistency across all nodes, which could lead to potential issues with distributed locking. -
Regarding data persistence, ElastiCache Serverless is primarily an in-memory cache and doesn't persist data to disk as part of its normal operation. The service does support backups, but this is different from continuous disk persistence. The claim about ElastiCache Serverless persisting data to disk at rest (outside of backups) appears to be incorrect.
Given these considerations, if your application requires strong consistency guarantees for distributed locking, you might need to explore alternative solutions or consider using a self-managed ElastiCache cluster where you have more control over replication settings and can use the wait
command.
Remember that ElastiCache Serverless is designed for ease of use and automatic scaling, which comes with some trade-offs in terms of fine-grained control over replication and consistency. For use cases requiring strict consistency guarantees, especially for distributed locking, you may need to carefully evaluate whether the service meets your specific requirements.
Sources
Choosing between deployment options - Amazon ElastiCache
Valkey-, Memcached-, and Redis OSS-Compatible Cache – Amazon ElastiCache FAQs - AWS
Relevant content
- asked 2 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
Decent answer from the bot, but would be nice to have an AWS Export give a bit more context on what happens inside an EC Serverless cluster.