Fabio Manganiello on Nostr: npub1twk5s…ju70y The thing is that often (at least in my current case) you also ...
npub1twk5s4hw5dw2ut3z752yrak83a4acd67nu8wecz376wvqz8z9qgqmju70y (npub1twk…u70y) The thing is that often (at least in my current case) you also want to support idempotency in your application.
You often have some form of external, "logical" key (think of it as the URL of your resource), and if you do a `PUT` twice you want to insert the thing the first time, and do nothing (or update it) the second time.
The client-generated UUID approach won't solve this case. If you get two `PUT` requests with the same "logical" key but different primary key, you'll get two different records - and you'll have to deduplicate them later in the application layer.
You often have some form of external, "logical" key (think of it as the URL of your resource), and if you do a `PUT` twice you want to insert the thing the first time, and do nothing (or update it) the second time.
The client-generated UUID approach won't solve this case. If you get two `PUT` requests with the same "logical" key but different primary key, you'll get two different records - and you'll have to deduplicate them later in the application layer.