s3-db icon indicating copy to clipboard operation
s3-db copied to clipboard

S3 Key duplication limitation

Open flatlanderer opened this issue 5 years ago • 1 comments

Hello, how does s3-db deal with S3 key duplication limitation? For example you want to save a User document, meaning the username needs to be unique, S3 from what I know, does not have such facility to prevent duplication and it's eventual consistency nature will make it hard for any application to prevent such.

For example, two client creates a document with the same username (but different passwords) at about the same time which client will be able to actually make it?

flatlanderer avatar Jun 13 '20 19:06 flatlanderer

This is a great question, and the ultimate answer is, best attempts are made but this is not an ACID solution that would guarantee collision or for operations to be atomic.

That being said, with situations where individual records are highly unlikely to be concurrently accessed by multiple users you can use an exists check to determine if an object has been created.

Ultimately, I would like to make better use of versioning and a follow up read operation within the save of a document. Use the MD5, eTag or possibly "IfMatch" to determine if the object persisted at the current state of the object. If any override was found, rollback to a previously determined version. Maybe make use of tags to 'lock' records so that only a specific operation can modify the document, until the lock is released, with further enforcement of that behavior using a policy.

Not sure when any of that will happen though.

On Sat, Jun 13, 2020 at 12:44 PM questionaut [email protected] wrote:

Hello, how does s3-db deal with S3 key duplication limitation? For example you want to save a User document, meaning the username needs to be unique, S3 from what I know, does not have such facility to prevent duplication and it's eventual consistency nature will make it hard for any application to prevent such.

For example, two client creates a document with the same username (but different passwords) at about the same time which client will be able to actually make it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matt-filion/s3-db/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSTFG4CB2VVNRIC66O4PDRWPJIRANCNFSM4N5DX2PQ .

-- http://mattfilion.com?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb Matt Filion mattfilion.com http://mattfilion.com?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb

matt-filion avatar Jun 14 '20 02:06 matt-filion