Amazon ElastiCache Serverless now supports same-slot WATCH command

Amazon ElastiCache Serverless Updates
Amazon ElastiCache Serverless now supports the WATCH command for same-slot transactions, enhancing data consistency in high-concurrency scenarios. This feature allows developers to build more reliable applications by making transactions conditional, ensuring they execute only when monitored keys remain unchanged.
The WATCH command works with transactions that operate on keys within the same hash slot as the watched keys. If applications attempt to watch keys that are not in the same hash slot, they'll receive a CROSSSLOT error. Developers can control key placement by using hash tags in their key names to ensure keys hash to the same slot. The transaction will also be aborted when ElastiCache Serverless cannot guarantee the state of watched keys.
What to do
- Create transactions using the WATCH command through your preferred client library.
- Ensure keys hash to the same slot by using hash tags in key names.
- Review the ElastiCache Serverless documentation and the Valkey transactions documentation for more details.
Source: AWS release notes
If you need further guidance on AWS, our experts are available at AWS@westloop.io. You may also reach us by submitting the Contact Us form.



