FrigadeHQ / remote-storage

remoteStorage is a simple library that combines the localStorage API with a remote server to persist data across sessions, devices, and browsers. It works as a simple key value database store and backend with support for React, Next.js, Vue, Node, or any Javascript stack
https://remote.storage
MIT License
1.2k stars 27 forks source link

Conflict Resolution Strategy #23

Open abakermi opened 6 months ago

abakermi commented 6 months ago

The RedisService currently lacks a mechanism to handle conflicts that arise when concurrent operations attempt to update the same key with different values. We can resolve that based on timestamp ,the approach involves modifying the set method to include a timestamp and compare it with the timestamp of the current data in Redis. If a conflict is detected (the existing data is newer), the update will be rejected. This enhancement is crucial for maintaining data integrity in scenarios with concurrent data operations.

christianmat commented 6 months ago

Hey @abakermi, this is a good point. Feel free to open a PR that addresses this. Make sure to also include any proposed fixes in the sqlite data connector.