Hacker News new | past | comments | ask | show | jobs | submit | EvertBouw's comments login

monad means a datastructure that implements flatmap.

I don't think that's a super helpful description, because probably most people wouldn't call IO a datastructure.

Monad means a function composition where you can program what happens when inner function gives its result as argument to the outer function.

you can generate them anywhere, and not guess others


Postgres can return the id to you that it generates.


...which means you need a round-trip to the database before doing anything else. That's latency you can avoid with client-side predictable (or determined) UUID's.

Whether you should do anything else before the data has been persisted is a totally different discussion.


Unless you’re doing some wild async YOLO, you’re already waiting for the DB to send back success; adding a max of 8 bytes into that is highly likely to fit into the same TCP packet and thus add little to no overhead.

If you are doing async writes, as you alluded to, why bother with RDBMS in the first place? ACID is out the window.


Not so in all cases.

- insert/then retrieve ID can easily result in duplicate records in some edge cases, and won’t necessarily be able to be easily fixed either. the inserted record doesn’t have a global ID until it’s inserted.

Can this generally be fixed using good transactions semantics? Yes usually. But it’s expensive. And in many cases you’ll have to default to failing writes instead of eventually consistent behavior.

- CRDT type behavior works better when things have a known valid unique ID from the get go. insert/update/ignore can happen quickly and easily without two way communication and in bulk, and edge cases have more easily modelable ‘eventual consistency’.

- generating unique IDs in the database forces serialization of certain processes in the database, which can cause scaling issues and high latency.

For instance, using the DB to create unique request IDs for web or API requests? Asking for problems.

Generating UUIDs for them at request time, and then putting those IDs where needed when later correlation/tracking is desirable? Much better.

Same can apply for other object ID creation, when there aren’t other natural keys that need to be checked first.


If you mean client like client, and not application server, don't do that (assuming you want to use uuidv7). Client generated IDs mean they can lie in the timestamp bits. Only use client generated ids as an idempotency key.


uuid you can generate the id in the client and send that knowing (hoping) it won't conflict


you can improve it a bit with the library ts-reset

https://github.com/total-typescript/ts-reset


And also can declare your own wrappers to at least achieve it for your own codebase.


Buses are useless if they get stuck in car traffic. They'd need dedicated lanes


How is the press free? Even the ANP nieuws is owned by some hedgefund that calls itself 'fuck off'. Do you think they will ever print something against the status quo?


A free press means: you can go buy a press, issue a newspaper as of tomorrow (or a website, for that matter) and write there whatever you want, and until a judge is involved nothing can or will be done about barring some emergency order.

Who owns ANP nieuws has nothing to do with whether or not the press is free.


CSGO skins and lootboxes are tradeable digital items, but they are tied to the steam marketplace. If it used a blockchain they'd be NFTs


Yeah and if I lit a match and dropped it in my house it'd be a housefire. Calling skins NFTs is patently false, because they are both not tokens and not non-fungible (nametags notwithstanding).


It's not the blockchain aspect of NFTs that is particularly offensive and relevant here, it's the creation of a speculation market for the selling of textures/jpgs with artificially imposed scarcity. The only difference between what Valve does and NFTs is an irrelevant implementation detail; Valve uses a centralized database instead of a distributed ledger, which is a much smarter engineering decision but it doesn't change the fundamental nature of what they've created.


Almost like people just kneejerk react to a bad word but don't understand why they kneejerk.

Sure there are some subteties to a centralized server vs. a distributed ledger, but the core goal is the same: companies want to be a platform owner, allow for generation of some speculative assets for users to trade, and take their cut as a middleman. To my knowledge, it's the middle factor that many have issue with.


It's cool and fun


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: