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.
Published at
2023-08-18 16:16:32Event JSON
{
"id": "334e5d9bc54a011c9e67a4ef4fe64aacf5da112855721a4e3de825733ab4f925",
"pubkey": "678fbdf04a787406ea6ccc5fd35c1cf57ac74ea9d0aa81df88f7a941f57e75e3",
"created_at": 1692375392,
"kind": 1,
"tags": [
[
"p",
"5bad4856eea35cae2e22f51441f6c78f6bdc375e9f0eece051f69cc008e22810",
"wss://relay.mostr.pub"
],
[
"p",
"6d994b5e4875fa6b675b50e708f431be1020aaf197b01d92068834d5bbc40673",
"wss://relay.mostr.pub"
],
[
"e",
"5892c1cd7c23577dcd433bff0f68668dd64fe8960543164baa38d24e24a96331",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://social.platypush.tech/users/blacklight/statuses/110911513701993348",
"activitypub"
]
],
"content": "nostr:npub1twk5s4hw5dw2ut3z752yrak83a4acd67nu8wecz376wvqz8z9qgqmju70y The thing is that often (at least in my current case) you also want to support idempotency in your application.\n\nYou 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.\n\nThe 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.",
"sig": "5475a108b53ed07283b60587db3c3d6201fe9aebcc981f7b43dfc9b019cbd278ecd75137200b39fdfb694eba49dcf5850cbdf400bb2a0807bac1ab2b0c940c56"
}