Home / Companies / Convex / Blog / May 2023

May 2023 Summaries

6 posts from Convex

Filter
Month: Year:
Post Summaries Back to Blog
Kate Rudolph provides a guide for migrating data from Airtable to Convex, offering scripts and steps to facilitate the transition. The process involves mapping the Airtable schema to Convex, moving data using Airtable’s API, re-linking document references to use Convex IDs instead of Airtable IDs, and transferring Airtable attachments to Convex File Storage before their links expire. While the migration scripts are provided in a shared repository, the author cautions that future Airtable data won't automatically sync with Convex unless additional integration, such as with Fivetran, is set up. Furthermore, re-importing data from Airtable to Convex may result in different Convex IDs, potentially breaking existing references. Convex is described as a versatile backend platform suitable for full-stack AI projects, offering features like cloud functions, databases, file storage, and more.
May 23, 2023 321 words in the original blog post.
Convex has integrated Rust into its backend platform, allowing developers to write Rust programs that interact with Convex deployments, similar to their existing JavaScript/TypeScript library. The inclusion of Rust is part of Convex's broader architectural principles influenced by Haskell, particularly the concept of side-effect-free transactions inspired by Haskell's Software Transactional Memory (STM). The article discusses a creative implementation of the "Santa Claus problem," originally introduced in Haskell, to illustrate Convex's capabilities in managing distributed workflows. This problem involves coordinating the activities of reindeer and elves with Santa using a Rust client and Convex's backend to manage state transitions. The Convex platform provides a seamless integration of cloud functions, databases, and real-time updates, making it a versatile choice for building distributed systems and AI projects. The integration of Rust, alongside other languages like Python, broadens the scope for developers to create data-intensive and background programs that complement UI-centric applications. The example highlights Convex's potential to offer robust, ACID-compliant workflows that can be easily scaled and managed across various applications.
May 17, 2023 2,982 words in the original blog post.
Convex provides a flexible approach to implementing row-level security (RLS) in applications by allowing developers to define authorization rules directly in code, which are then automatically applied to database operations. While RLS is not essential for most Convex apps, it is beneficial for platforms exposing databases directly to end-users. The platform offers tools such as `convex-helpers` to wrap database interfaces, ensuring that read and write operations comply with specified access control rules. This setup can prevent unauthorized actions, such as data modification by non-owners, and minimize vulnerabilities like IDOR. Developers can customize the authorization context with additional data and mix RLS with bespoke authorization methods for more complex needs. Convex emphasizes security by running authorization checks server-side, unlike some platforms limited to client-side checks. The integration of RLS into Convex apps empowers developers to manage access control effectively while maintaining the flexibility to implement more advanced logic as needed.
May 15, 2023 1,700 words in the original blog post.
Ian Macartney's discussion on relationship structures in the Convex database provides insights into different patterns for structuring relationships within a relational database. The post delves into various types of relationships, including one-to-one, many-to-one, and many-to-many, each with unique methods for implementation and management. For one-to-one relationships, the options include direct references, back-references, and maintaining IDs in both related documents, emphasizing the importance of keeping records in sync to avoid inconsistencies. One-to-many relationships can be managed using direct references, which are simple but come with limitations, or through back-references, which are more scalable and use indexing for efficient lookups. Many-to-many relationships often require a relationship table, also known as a join or association table, allowing for efficient queries in both directions. The post highlights the importance of design considerations, such as the limitations of storing arrays and the need for maintaining consistency across related records. Macartney also touches on the benefits of using relationship helpers for simplifying query composition and encourages further discussion within the community, offering practical examples and guidance for developers working with Convex.
May 09, 2023 2,820 words in the original blog post.
Convex offers a comprehensive platform that ensures end-to-end type safety for TypeScript applications, seamlessly connecting database schemas with React apps. By leveraging wild TypeScript patterns, Convex allows developers to define schemas, query, and mutation functions using pure TypeScript, eliminating the need for separate query languages or configuration formats. This approach ensures that all layers of an application are type-safe, with each layer automatically reflecting changes from the preceding one. Convex's use of "types as data structures" enables the automatic generation of type-safe utilities without the need for code regeneration when schemas are updated. By constructing a DataModel type directly from schema definitions, Convex maintains up-to-date TypeScript types that enhance the development experience. This innovative system empowers developers to build scalable, full-stack AI projects with real-time updates and a robust backend infrastructure, all while ensuring a seamless and type-safe integration across the application stack.
May 08, 2023 2,693 words in the original blog post.
Data migrations are processes that involve changing the shape of data in databases, typically through schema and data changes, and can be performed in two primary ways: offline and online migrations. Offline migrations require stopping the application from serving traffic to implement schema changes, which can lead to downtime and potential rollback challenges if errors occur. In contrast, online migrations allow the application to continue serving requests while data is updated asynchronously, although this method introduces complexities such as handling both old and new data formats simultaneously. Best practices for managing migrations include creating new fields instead of altering existing ones, avoiding data deletion unless necessary, and using strategies like dual writing or reading to safely transition between old and new data formats. The use of a tool like Convex can facilitate schema validation and guide developers through the process, ensuring that changes can be rolled back or adapted without disrupting the application.
May 05, 2023 1,565 words in the original blog post.