Home / Companies / Clerk / Blog / August 2021

August 2021 Summaries

2 posts from Clerk

Filter
Month: Year:
Post Summaries Back to Blog
Prisma is a server-side library that acts as a next-generation ORM, enhancing productivity and code simplicity by reducing the amount of code needed for CRUD operations and ensuring type safety. It supports connectors for various relational databases and recently introduced a MongoDB connector, which combines type-safe TypeScript generation with the flexibility of document stores. An example application developed by Clerk demonstrates integrating a full authentication workflow with Prisma, allowing users to create accounts, publish posts, and browse others' posts while ensuring authenticated access to data. The setup involves configuring a Clerk application, using MongoDB Atlas for the database, and employing Prisma for type-safe access to a MongoDB collection. The application showcases how Clerk's pre-built components facilitate user authentication, enabling users to perform actions like deleting their posts securely. Additionally, a middleware layer using Clerk ensures only authenticated users can modify data through the Prisma model API. The application highlights Prisma's efficiency and Clerk's ease of integrating authentication, allowing developers to focus on unique product features rather than foundational tasks like authentication and data management.
Aug 17, 2021 1,575 words in the original blog post.
In the early days of Stripe, a new style of resource IDs was introduced, characterized by a prefix indicating the type of object they represent, such as "ch_" for Charge and "cus_" for Customer, which greatly influenced others, including Clerk, to adopt similar practices. The generation of IDs is a complex subject, with traditional sequential IDs becoming less favored due to their predictability, potential security vulnerabilities, and the challenges they present in distributed systems where coordination is impractical. To address these concerns, randomness has been incorporated into ID generation to prevent guessing and collisions, while still maintaining some of the desirable traits of sequential IDs, like sortability. This balance is achieved in newer ID generators such as Twitter's Snowflake and Segment's KSUID, both of which implement timestamp and sequence number strategies, with KSUID being preferred by Clerk due to its lack of a worker number component, aligning with their needs and allowing the incorporation of Stripe-like prefixes for enhanced usability.
Aug 06, 2021 473 words in the original blog post.