HN user

matlin

563 karma

Making Triplit - the fullstack database (https://triplit.dev)

Posts34
Comments175
View on HN
www.triplit.dev 1y ago

A more practical definition of Local First

matlin
3pts0
www.triplit.dev 1y ago

Triplit 1.0: The database that's in sync with your front end

matlin
2pts0
github.com 1y ago

PrimJS JavaScript Engine

matlin
1pts0
www.oaktreecapital.com 1y ago

Bubble Watch

matlin
3pts0
demo.triplit.dev 1y ago

Demo of a todos app syncing over a slow network with CRDTs and Triplit

matlin
4pts0
tolin.ski 2y ago

The Spectrum of Local First Libraries

matlin
3pts0
github.com 2y ago

Show HN: Triplit – Open-source syncing database that runs on server and client

matlin
279pts100
mattweidner.com 2y ago

Architectures for Central Server Collaboration

matlin
1pts0
www.youtube.com 2y ago

Triplit in 100 Seconds [video]

matlin
1pts0
github.com 2y ago

List-positions: efficient, collaborative list positions TypeScript

matlin
3pts0
github.com 2y ago

Hattip – An Express-compatible runtime for Cloudflare, Netlify, Vercel, etc.

matlin
2pts1
github.com 2y ago

Wireit – Google's Alternative to TurboRepo, NX

matlin
3pts0
github.com 2y ago

Show HN: Triplit – The Full-Stack Database

matlin
8pts3
blog.cloudflare.com 2y ago

Cloudflare updates pricing to not charge for I/O idle time in Workers

matlin
13pts2
developers.cloudflare.com 2y ago

Hibernatable WebSockets API for Cloudflare Durable Objects

matlin
2pts0
github.com 3y ago

WebAssembly Polyfill (run WASM in vanilla JavaScript)

matlin
4pts0
en.wikipedia.org 3y ago

Generalized Search Tree

matlin
1pts0
www.matthewlinkous.com 3y ago

Is it worth encrypting?

matlin
47pts70
github.com 4y ago

Tuple Database – A reactive, local-first db inspired by FoundationDB

matlin
3pts6
www.infoq.com 4y ago

Facebook CSS-in-JS Solution Stylex Introduced at React Finland 2021

matlin
1pts0
hn.algolia.com 4y ago

HN Search Is Down

matlin
3pts2
github.com 5y ago

A functional convergent bi-directional streamable distributed database

matlin
3pts0
www.infoq.com 5y ago

RSLint, a New, Fast JavaScript Linter Written in Rust

matlin
1pts0
news.ycombinator.com 5y ago

Ask HN: How does your company onboard new employees?

matlin
3pts2
www.aspen.cloud 5y ago

Show HN: Aspen – A web browser built for work

matlin
7pts5
www.youtube.com 6y ago

Android Action Blocks

matlin
1pts0
www.coregames.com 6y ago

Core: a Social 3D Game Studio

matlin
1pts0
aws.amazon.com 6y ago

Amazon AppFlow

matlin
1pts0
github.com 6y ago

Show HN: A user-centric Firebase alternative

matlin
3pts1
medium.com 6y ago

Why your users should store their own data

matlin
1pts0

PouchDB and CouchDB were what inspired me to build Triplit[1]. The idea of having an identical (or merely similar in the case of Pouch/Couch) query engine accessible on client and server is insanely powerful.

The author links to a much longer post on handling conflicts which is worthy of its length because it's not a pleasant experience with this setup.

I highly recommend trying a modern setup from one of the many new local first solutions [2]

1. https://triplit.dev

2. https://www.localfirst.fm/landscape

My ideal version of this is simple: just define the queries you want (no matter how complex) and the you'll get exactly the data you need to fulfill those queries, no more, no less. And the cherry on top would be to have your queries update automatically with changes both locally and remote in close to real-time.

That's basically what we're doing with Triplit (https://triplit.dev), be it, not with SQL--which is a plus for most developers.

We apply incremental, streamable "joins" (relational queries) for real-time syncing between application client and server. I think much of the initial research in this space was around data pipelines but the killer app (no pun intended) is actually in app development

I've used React Native quite a bit in the past and I gotta say I wish it didn't have to exist at all.

It's often times fine on iOS and then incredibly slow on Android. Hermes is very exciting but still requires many polyfills to make simple NPM packages work. I hope one day, the web (and embedding web apps on mobile) makes React Native fully obsolete.

A lot of the newer local first systems, like Triplit (biased because I work on it), support partial replication so only the requested/queried data is sent and subscribed to on the client.

The other issue of relying on a just the server to build these highly collaborative apps is you can't wait for a roundtrip to the server for each interaction if you want it to feel fast. Sure you can for those rare cases where your user is on a stable Wifi network, on a fast connection, and near their data; however, a lot computing is now on mobile where pings are much much higher than 10ms and on top of that when you have two people collaborating from different regions, someone will be too far away to rely on round trips.

Ultimately, you're going to need a client caching component (at least optimistic mutations) so you can either lean into that or try to create a complicated mess where all of your logic needs to be duplicated in the frontend and backend (potentially in different programming languages!).

The best approach IMO (again biased to what Triplit does) is to have the same query engine on both client and server so the exact query you use to get data from your central server can also be used to resolve from the clients cache.

Seph (author) also has a reference implementation in Typescript: https://github.com/josephg/eg-walker-reference

I've stated before that I think the main thing holding back collaborative text / sequence CRDTs is integration with a production database.

Eg-walker looks interesting because it might lend itself to be integrated into a database because the operations are immutable and only appended. However, to demonstrate the effectiveness of these algorithms library authors (see Yjs, DiamondTypes, etc) build stand-alone data structures (usually specialized search trees) that most databases already provide.

Personally, I've been trying to adapt a Piece Table[1] to be collaborative and stored in Triplit[2] which runs on both client and server and already implements logical clocks but I might see how well I can adapt this algorithm instead!

1. https://en.wikipedia.org/wiki/Piece_table 2. https://github.com/aspen-cloud/triplit

Do you see Ladybird beating the incumbent browsers in any dimension .e.g. performance, usability?, security, etc?

Personally, I much prefer developing for the web than native so if there were APIs exclusive to Ladybird it might create a nice virtuous cycle of developers targeting Ladybird to do new things and users using Ladybird to try those new experiences.

Glad you've enjoyed using Triplit!

on self-hosting: We're cleaning up the docs on self-hosting to make the configuration clearer, thanks for point that out.

on querying: Yeah we don't have aggregations yet but it's on our roadmap. Don't want to over promise but I think we can make something awesome here by leverage our incremental querying engine. Like consider a data dashboard that needs to be updated every hour; in a traditional system (postgres, mongo, etc) you would need to rerun the query from scratch each time. Our plan is to create something closer to what Materialize does and just process the new data so it's much more efficient and can just update continuously rather than every hour.

re Evolu: I haven't actually gotten a change to try it out but there might be in someone in our Discord[1] that has that could compare/contrast

1. https://triplit.dev/discord

This is a great question! The short answer is by maintaining backwards compatibility in your schema--it's basically the easiest way to guarantee compatibility. We have warnings in place to let you know when you've made a change that isn't backwards compatible, you can read about it in our docs: https://www.triplit.dev/docs/schemas/updating#pushing-the-sc...

However, overtime this can naturally lead to a mess of a schema definition that has a lot of confusing names. We haven't released a solution to fix this yet but we're working on a few things that should make this less painful. For background on the various approaches, the Cambria doc is an amazing resource: https://www.inkandswitch.com/cambria/

React Query (and other query caching libraries) are great until you have overlapping data between your queries. E.g. you edit a message in one place but other queries that show that same message (like a preview in your chat list) don't update.

Having a complete query engine on the client makes this a lot easier to deal with. It's why most popular messaging apps will use SQLite on the client to render the UI and build their own sync engine to keep it up to date with the backend.

That's cool that you saw my presentation!

Re: Flutter (and other native support) it's something we've thought a lot about (Flutter specifically comes up often) but we decided to focus on pure-Typescript to start because it's a big enough market (I'm personally a big believer in the future of PWA's) and we know we can make the best experience by focusing on it. I do think that we'll eventually make something more platform agnostic but not sure when that will happen.

Re: ElectricSQL & Supabase: both teams are obviously very talented and thoughtful and, I believe, will continue growing in the SQL space which is the most fundamental difference between our approaches. I think Triplit can make the best experience for developers by avoiding SQL and think there's undoubtedly room for both philosophies.