![]() Since the talk I gave about was related to Prisma ORM, the Prisma schema (in relational databases) can generate both either a CUID or UUID, depending on the needs of your application.Īs a bonus, we'll being going over NanoID. It found no collisions on 100 million iterations! They're shorter, but what about collisions? I found this online benchmark ran on a GitHub gist, showing that the chances for collisions are still extremely slim. The GitHub repository offers a more specific breakdown of the problems that this aims to solve. Our modern unique identifiers have a stricter list of requirements that cannot all be satisfied by any existing version of the GUID/UUID specificationsĬUID aims to focus on horizontal scalability (as today's applications don't run on a single machine), performance, size, security, and portability. Modern web applications have different requirements than applications from just a few years ago. If we have a website such as, say, HasteBin, which depends upon generating these short, three letter IDs to easily share with people, this causes a problem.ĬUID aims to solve the exact problem we discussed above with UUIDs. ![]() Which is true! If we look into the history of UUID, we realise that it wasn't ever really made to be used in web applications. It may seem minor, but to build a product that developers love to use, we need to care about details like these. The browser interprets it as 5 different words. ![]() Try double clicking on that ID to select and copy it. The title of the post was "Why we chose NanoIDs for PlanetScale's API", and the post goes onto talk about how UUIDs are great and all as it's near impossible to generate a duplicate identifier, however they have a huge problem: they're too big, and take up too much space in the URL.ĭon't we all love clean and short URLs? Nobody likes seeing a bunch of digits and weird symbols in your URL. While researching, I came across this blog by PlanetScale, which is a MySQL-compatible serverless data platform. The probability that an ID will be replicated isn't zero, it's close enough that when we generate a UUID, the chances of the identifier being used ANYWHERE else is near zero.Īn example would be something like that fits the format of xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, so something like 123e4567-e89b-12d3-a456-426614174000. UUID, or universally unique identifier, is a 128 bit label used for information in operating systems. We'll be looking at UUID and CUID, along with NanoID as it has started to gain traction lately. After doing some research, I'd like to share my findings. Now, at the time of the stream I was unsure of the difference between the two, and I just kind of used whatever.Īfter the stream, I too was curious what the difference is between the two. In the stream, we talked a lot about different topics I had going on in the code, and one of them was about the difference between a CUID and a UUID. If you're interested in that, please do check out the video. ![]() So recently, I was on a live steam with on Twitch where I demonstrated how to migrate a live serverless application ( Next.js and Vercel) from a PostgreSQL database onto CockroachDB serverless with zero application downtime.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |