The fullstack database.
A complete solution to data persistence, state management, and realtime synchronization for web applications that want to go fast.
npx @triplit/cli init
Live updating queries
Triplit's queries are reactive by default, so you can build apps that update in real-time without any extra work.
Automatic caching and syncing on the client
Full relational support for querying connected data
Typescript support for all data returned from queries
React Hooks to subscribe to queries in your UI
use-messages.ts
import { useQuery } from "@triplit/react"
import { client } from "@/lib/triplit"
export function useMessages(convoId: string) {
const deliveredMessagesQuery = client
.query("messages")
.where("conversationId", "=", convoId)
.order("created_at", "DESC")
.syncStatus("confirmed")
const {
results: messages,
fetchingRemote,
fetching,
error,
} = useQuery(client, deliveredMessagesQuery)
}
Zero downtime
Let your users keep working even when their network connection isn't.
Durable storage to ensure no edits are lost
Retry and reconnect seamlessly restarts syncing
Conflict resolution algorithms automatically handle concurrent edits
Code first schemas
Write your schemas in Typescript instead of config files or split across a dozen SQL files.
Automatic migrations generated from your edits
Type hinting in your editor
Data validation at runtime on client and server
schema.ts
import { Schema as S } from "@triplit/db";
export const schema = {
todos: {
schema: S.Schema({
completed: S.Boolean(),
created_at: S.String({
default: S.Default.now()
}),
id: S.String({
nullable: false,
default: S.Default.uuid()
}),
listId: S.String({ nullable: true }),
text: S.String(),
}),
},
};
Complete data management
A full-featured database console for inspecting your data and schemas means you have all the control you'd expect from a production-ready database.
Triplit directly integrates with your UI framework
With first party support for React, and many more coming soon