4 ms·
After reading this article, my impression of Planetscale as a brand actually got worse. It seem to miss most of the essential bits of information: * The basic
by mihaic 4y ago
After reading this article, my impression of Planetscale as a brand actually got worse. It seem to miss most of the essential bits of information:
* The basic concept is that they just want to use a bigger alphabet to encode more information in fewer characters. The efficiency ratio of NanoID is log 36/log 16, or ~30% better since it has a bigger alphabet. You could get more if you went for instance with base 58 (includes uppercase, except I and O to remove ambiguity with the digits 1 and 0).
* UUID can remove those dashes, that's just cosmetic. There are multiple UUID specs though, and some include a timestamp that actually might be useful for certain purposes.
Overall the article seem to get lost in overly specific code snippets and explaining details without explaining essentials.
- tiseno 4y agoAfter reading this comment, my impression is that you didn't actually read the article as you have apparently missed all the arguments for not using uuids that it presents
- mihaic 4y agoI did, it just was poorly written with second order ideas and non sequitors, instead of trying to identify the primary concepts. > Try double clicking on that ID to select and copy it. You can’t. The browser interprets it as 5 different words. After reading that, shouldn't my first thought be: "Have you though about simply removing the dashes from your string?" To me these are the questions that you should ask about a uid function: 1. How much randomness do you want to add to prevent collisions? 2. What characters are allowed? If you want to dictate it, maybe avoid 0,1,o,l and keep lowercase. If you can paste it, allow uppercase characters. 3. Can you precisely describe the algorithm in case you want it in another programming language? 4. Do you want any non-random information encoded? Maybe a sharding id or a timestamp? Only the first question was actually addressed, and even that without doing the math, by simply referencing another website. Doing estimation calculation is something that an engineer should have a good intuitive understanding of, so I think it's slightly damaging for industry mentality when even these articles don't do this themselves.