Why Nostr? What is Njump?
2024-07-11 11:27:04
in reply to

Fabio Manganiello on Nostr: 1. Concurrency: if you have two services which concurrently consume two records that ...

1. Concurrency: if you have two services which concurrently consume two records that are logically the same (e.g. the records of a person having the same SSN), but such "natural" constraint isn't enforced (neither on the primary key nor as a unique column), then you get duplication.

2. Performance: if you have an API that creates a record and then returns it to the user (with the generated ID), then you'll probably have to do an insert-and-select for each inserted record. Unless you generate the ID itself in the application - which comes with another set of issues.

3. Upsert: if the primary key doesn't depend on any natural identifier, then it's hard to tell when you should insert a new record or update an existing one, and mechanisms such as INSERT...ON CONFLICT UPDATE can't be leveraged.

4. Sharding: especially if the primary key is auto-increment or random, sharding on it becomes challenging.
Author Public Key
npub1s9uc08n58mxqk5umvapqulwzng0sja635q86r36d8n4rr9r9ygaskjdnmu