An astronaut holds a lecture on the theory of evolution on the moon.

    Triplit 1.0 is here! 🎉

    TLDR

    Triplit 1.0 brings a host of performance and reliability updates, simpler APIs, and new utilities that make using Triplit easier than ever.

    Triplit 1.0

    We're now two years into developing Triplit and we're excited to announce the release of our first major version. We spent 2024 iterating on the Triplit API to make it the easiest database to build complex applications. The feedback we received from our community of developers was clear: the API was second-to-none in terms of expressiveness and ease-of-use, but performance made it difficult to use in production. For the last 3 months we've been hard at work rewriting the core storage engine to be faster and more reliable. It was no small task:

    A screenshot from the triplit GitHub repository showing the number of lines of code changed in the 1.0 pull request.

    We were able to achieve 10-15x faster read and write performance and significantly less memory and storage consumption without sacrificing any of the ease-of-use that makes Triplit unique. The graph belows shows an internal benchmark for a query with a large join before and after merging the key changes for 1.0 into our main branch:

    An internal query benchmark showing the performance improvements of Triplit 1.0.

    Last week we quietly rolled out 1.0 to our hosted customers and active community members. The feedback on performance and API improvements (more on those later) has been very positive. There are still a few rough edges, but we've been hard at work addressing bug reports and we're ready to make 1.0 generally available to everyone.

    Developing with 1.0

    Triplit 1.0 involves breaking changes on the frontend and backend APIs. Most frontend clients will require a few minor changes to queries and schemas. Backend servers require a data migration. For Triplit Cloud customers, we'll handle the migration for you and ensure that your data is safely transferred to the new storage engine. For self-hosted users, we recommend using the new CLI utilities triplit snapshot create and triplit snapshot push to manage the migrate yourself. More on those below. As always, you can run the triplit dev command to start a local server with the new storage engine and test your application before deploying.

    Some of the API improvements include:

    • queries no longer need to be finished with calls to .build()
    • more type hinting and type safety for permissions and relationships in a schema
    • servers will be able to evolve their schema with backwards compatible and still be able to connect to older clients

    For full details on the breaking changes and how to migrate, please refer to our migration guide.

    triplit snapshot create and triplit snapshot push

    Taking snapshots of your Triplit database and restoring them is now easier than ever. We've introduced two new CLI commands to help with this:

    • triplit snapshot create: This command creates a snapshot of a Triplit database and saves the schema and data to a series of files. You can use this to create backups, to migrate your database to a new server, or to easily turn production data into a seed for local development.
    • triplit snapshot push --snapshot=<name>: This command takes the name of the directory created by triplit snapshot create and pushes the data to a Triplit database. It will not push the schema, so you must ensure that the schema of the database you're pushing to is compatible with the schema of the snapshot.

    Some use cases for these commands include:

    • Creating a copy of your production database and using it to seed a local development environment.
    • Migrating your database to a new server or hosting provider.
    • Periodically backing up your production database to S3 or another cloud storage provider.

    Usage for migrating to 1.0

    If you're migrating your database from pre-1.0 to 1.0, we recommend using triplit snapshot create to create a snapshot of your pre-1.0 database and using the snapshot in local development to make the necessary changes to your application and schema. Afterwards, you can upgrade your server version and use triplit snapshot push and triplit schema push to restore the snapshot to your new 1.0 server.

    These commands will be available as of @triplit/cli:1.0.16. For more information on how to use these commands, please refer to our CLI documentation.

    Looking ahead

    In the coming weeks we will continue to release improvements, bug fixes, and new features to Triplit. We'll also release a longer-form blog reiterating our philosophy in designing Triplit and going into detail on some of the technical decisions we made in redesigning the internals of Triplit for 1.0.