Matt Wonlaw Profile Banner
Matt Wonlaw Profile
Matt Wonlaw

@tantaman

Followers
1,596
Following
645
Media
213
Statuses
2,505
Explore trending content on Musk Viewer
Pinned Tweet
@tantaman
Matt Wonlaw
5 months
My 4th appearance on a podcast! I'm becoming a better guest (interviewee?) each time, which means this one is the best one :) This time we cover colocated queries, materialized views, sqlite & crdts.
@localfirstfm
localfirst.fm Podcast
5 months
Episode #10 is out. Matt Wonlaw ( @tantaman ) on building his own local-first tools (cr-sqlite, Materialite) and comparing syncing mechanisms.
1
7
43
4
3
43
@tantaman
Matt Wonlaw
7 months
tfw appeasing the type checker is more work than writing the actual code.
Tweet media one
62
17
388
@tantaman
Matt Wonlaw
2 years
I never thought cross-device sync and multiplayer could be sooooo easy. With CRDTs on SQLite I just declare which tables are synced and voila, my app is multiplayer.
7
20
336
@tantaman
Matt Wonlaw
2 years
One of the things I'm most excited for is partnering with the LibSQL folks to create a custom syntax for defining tables which are backed by CRDTs! LibSQL is truly getting SQLite ready for the coming decades --
Tweet media one
5
25
163
@tantaman
Matt Wonlaw
7 months
Found a hornets nest on tech twitter. Here's some TypeScript types from Prisma:
Tweet media one
23
10
157
@tantaman
Matt Wonlaw
2 years
Interested (or know someone interested) in databases? Conflict-free data types? p2p? Looking for help on - ~130 companies signed up for the beta release - $16,000 in paid sponsorships over the last 6 months - 1.2k github stars - Front page HN 3x
3
22
137
@tantaman
Matt Wonlaw
1 year
"Most databases were built when data was static and queries were dynamic. For applications, most queries are static and the data is dynamic" - @matthew_linkous I never thought about it this way before but this is spot on.
2
6
138
@tantaman
Matt Wonlaw
2 years
CRDT extension successfully compiled and running in the new official SQLite WASM. Adios absurd-sql and sql.js
Tweet media one
11
11
108
@tantaman
Matt Wonlaw
1 year
Working on a post but I present a React table of 2 million rows, dynamically filtered in real time. tldr: the data structure backing the table is maintained via differential dataflow so we only need to process the single row that changed rather than the entire set when filtering
5
8
83
@tantaman
Matt Wonlaw
7 months
quite worth it for the perfect auto-complete. Even prevents you from selecting ambiguous fields.
Tweet media one
12
0
66
@tantaman
Matt Wonlaw
1 year
I was blown away by @aboodman 's talk and the Replicache model so I spent the last day experimenting with a variation on the idea: "Creating CRDTs without specialized knowledge"
5
16
68
@tantaman
Matt Wonlaw
2 years
A Gentle? Introduction to CRDTs
1
11
62
@tantaman
Matt Wonlaw
1 year
This confluence of things: - Event sourcing - CRDTs & Causal Graphs - Incremental View Maintenance is going to unlock some stellar new infrastructure. 1. Event source your entire app. 2. Incrementally maintain app state as a view of events. 3. Rebase events for multiplayer.
3
8
57
@tantaman
Matt Wonlaw
10 months
Would anyone believe me if I said I can get IndexedDB to read and write faster than a fully in-memory SQLite DB in the browser?
9
1
54
@tantaman
Matt Wonlaw
2 years
I've never been so excited to publish new documentation. Just another day or two of writing!
Tweet media one
1
2
51
@tantaman
Matt Wonlaw
9 months
Round tripping the server each time. Imagine if this was local first 😃
@rauchg
Guillermo Rauch
9 months
Next.js and React have never been easier, and they've also never been harder 🧵 Here's the universal 'minimum viable app', a TODO list, implemented with the latest features in 45LOC
Tweet media one
112
119
2K
5
2
50
@tantaman
Matt Wonlaw
7 months
What a clever way to automatically run a destructor when a variable goes out of scope in JavaScript. A generator that yields and has a `finally` block. 🤯
Tweet media one
7
4
46
@tantaman
Matt Wonlaw
1 year
I realize I never really talk about the developer experience of having SQLite in the browser + sync. Working on a series of 10 minute videos to cover this. Part 1 Setting up SQLite in the browser: solving persistence, shared state & cross-tab sync:
1
6
46
@tantaman
Matt Wonlaw
5 months
In case anyone needs it - convert your PG database to a SQLite database: Also emits the PG WAL LSN so you can logically replicate to SQLite after initial import.
3
6
44
@tantaman
Matt Wonlaw
1 year
is an amazing piece of work in terms of improving the reactivity story for SQLite.
1
6
42
@tantaman
Matt Wonlaw
10 months
I'll be a bit tied up for a while. New addition to the household.
Tweet media one
9
0
41
@tantaman
Matt Wonlaw
1 year
oh sqlite...
Tweet media one
6
3
40
@tantaman
Matt Wonlaw
1 year
So many people in the crdt & data sync space now. Feels like it is time for me to move on to the next frontier of problems.
7
2
36
@tantaman
Matt Wonlaw
1 year
Listened to a number of talks and podcasts recently where the guests say that they don't need CRDTs b/c they're "too complex" but then go on to explain their custom solution which is... a CRDT 😅 Maybe this means I shouldn't mention CRDTs to some audiences?
8
3
32
@tantaman
Matt Wonlaw
1 year
Almost have the entire SQLite dialect covered for type generation. Preview of joins & sub-selects. Builtin functions, conditionals, with clauses, etc. supported as well! Next up: syntax highlighting and intellisense Pairing with TreeSQL is going be 🔥
@schickling
Johannes Schickling
2 years
In collaboration with SkipLabs, Riffle and @tantaman , we sketched out a simple SQL query extension for GraphQL-like nested query results. 👀 It's already really nice to use and will allow me to simplify my application (e.g. by removing GraphQL on top of SQLite).
Tweet media one
Tweet media two
5
5
55
5
1
33
@tantaman
Matt Wonlaw
5 months
Can't think of a more ideal place to work and exciting set of problems to work on. Happy to be a part of the team.
@aboodman
Aaron Boodman
5 months
Beyond excited to share that Matt Wonlaw (aka @tantaman ) has joined @rocicorp as our seventh partner. Matt is well-known in the local-first community for his work on and related projects, and I'm delighted he has chosen to join forces with us. We've
8
6
108
3
0
32
@tantaman
Matt Wonlaw
1 year
TS <-> SQL Integration becoming real. Next up: generating types for `SELECT`.
3
3
32
@tantaman
Matt Wonlaw
3 years
0
4
30
@tantaman
Matt Wonlaw
2 years
Not having to ever think about cross-tab sync again is enough to make me pay for this if it wasn't open source.
3
0
31
@tantaman
Matt Wonlaw
1 year
I've got differential dataflow implemented in JS. What should I do with it?
Tweet media one
Tweet media two
8
3
31
@tantaman
Matt Wonlaw
10 months
Been pretty silent for a while. That's because useQuery(...), while a great dev experience, has scaling problems. So I'm scaling `useQuery` style hooks to 60fps response time when working with millions of items and keeping those queries up to date as data changes.
3
3
29
@tantaman
Matt Wonlaw
1 year
Dependency tracking for TypedSQL! Modifying a schema will go update the return types of queries using that schema.
0
2
30
@tantaman
Matt Wonlaw
8 months
@kentcdodds @joeflateau Rust has a ? operator which will automatically return an error if one is encountered. Eg: ‘()?’. This is pretty close to exception ergonomics but typed and thus checked at compile time.
1
0
28
@tantaman
Matt Wonlaw
11 months
Seeing my libraries show up in other local-first & dist sys infra 🤩
Tweet media one
Tweet media two
Tweet media three
Tweet media four
1
1
27
@tantaman
Matt Wonlaw
1 year
I used to think forking sqlite (e.g., @libsqlhq ) was crazy but I'm on board now. While SQLite is great, I just don't think it is ready for the demands of the coming years. Just one tiny tiny slice of the mounting problems --
2
3
28
@tantaman
Matt Wonlaw
9 months
It's been 1 year + 2 days since got started. My #LocalFirst journey started way back in 2012 with A presentation editor that ran entirely locally in the browser. Its remote storage solution at the time was
2
3
28
@tantaman
Matt Wonlaw
2 years
The obligatory TodoMVC app. This time collaborative and replicated p2p via CRDTs in SQLite. Still a bunch of bugs, docs & packaging to clean up but sooo close to a stable release. The client code/interface is clean 🧽
2
1
28
@tantaman
Matt Wonlaw
5 months
Instant and jank free ui is hard to pull off. It’s why we’re building
@AdamRackis
Adam Rackis
5 months
Oh my fucking god they’re not optimistically leaving the dropped appointment in place? Just reverting and waiting for the server to send new content down?
22
3
345
0
0
28
@tantaman
Matt Wonlaw
10 months
@yishan Or are those just the intellects that we remember? Bertrand Russel, Feynman, Milton Friedman were pretty well adjusted?
4
0
25
@tantaman
Matt Wonlaw
7 months
Nice to be working with a team again. I forgot how much you learn just by watching other people operate.
2
0
23
@tantaman
Matt Wonlaw
1 year
> we're approaching 600 nodes and ~40K changes per second Exciting to see my work deployed into production but always makes me nervous 😅
3
1
24
@tantaman
Matt Wonlaw
4 months
@kyleshevlin This is the SQL you're looking for. No need for all that code.
Tweet media one
2
0
23
@tantaman
Matt Wonlaw
1 year
Interesting realization that if you're syncing CRDTs through a central server you can apply whatever sort of validation logic you want on the server to preserve constraints. The validation logic just needs to write fixes as a new database version to sync back to clients.
6
4
24
@tantaman
Matt Wonlaw
1 year
React has graduated to PHP status. Everyone shits on it but it runs the web.
3
0
23
@tantaman
Matt Wonlaw
1 year
In the refinement phase of cr-sqlite - - decreasing crdt metadata size by 5x - improving crr creation syntax - adding support for resurrecting deleted items - adding list CRDTs to the DB so you can have collaborative text w/o yjs or automerge - improving schema migrations
3
3
22
@tantaman
Matt Wonlaw
1 year
@VicVijayakumar I guess Netflix includes RSUs in their calculation, the others are just base pay?
4
0
22
@tantaman
Matt Wonlaw
2 years
Spent a week optimizing `useQuery` to get hundreds of concurrent SQLite queries to return in a single frame in the browser. And now realizing that implementing a fully reactive SQL layer actually isn't that far out of reach. ty &
4
1
21
@tantaman
Matt Wonlaw
2 years
@jmhodges Facebook handles most of these problems by converting all queries to persisted queries at compile time. That allows you to know exactly what queries can be executed and to what depth and so on. Authz is handled at the individual node level via fwrks like
3
0
21
@tantaman
Matt Wonlaw
1 year
Big release today. Little did I know the cr-sqlite sync layer previously didn't work in `Chrome for Android` 🫠It does now! Thanks to everyone who provided feedback and reported bugs!
0
1
21
@tantaman
Matt Wonlaw
1 year
@swlkr @wollantine You trolling or serious?
1
0
21
@tantaman
Matt Wonlaw
7 months
And Drizzle --
Tweet media one
8
0
18
@tantaman
Matt Wonlaw
1 year
@maccaw > However I still believe that for many production use-cases you want the server as a ultimate source of truth. 💯 - Allowing servers to overrule clients - Multi-tenancy Are the two next big things for us to get done in cr-sqlite.
2
0
16
@tantaman
Matt Wonlaw
7 months
@ssalbdivad Yes, that is true. I'm explicitly opting into this so I can provide a rich API for users. `appease` was a poor choice of phrase.
3
0
16
@tantaman
Matt Wonlaw
1 year
Putting together some benchmarks and examples for Materialite (that's what I'm calling this incremental view maintenance in JS library) -- I always underestimate how long it takes to get something ready for public consumption 🤪 Just a few more weeks?
Tweet media one
Tweet media two
1
1
16
@tantaman
Matt Wonlaw
2 years
Spent the am building reactive code cells that can depend on one another for the new documentation site. Like ObservableHQ but I didn't want to include their notebook interface.
5
3
15
@tantaman
Matt Wonlaw
1 year
So who is going to write about how local-first can be a progressive enhancement? I know this sounds like a contradiction in terms.
@ryanflorence
Ryan Florence
1 year
There are two ways that I love to build web apps: Server First and Local First. 1. Server First (Remix today). HTTP+HTML are the base API, assume a connection, or talk to service workers as if you're talking to a server. This has the potential for very fast page loads, "land
27
29
267
5
1
16
@tantaman
Matt Wonlaw
1 year
Looking forward to doing some TinyBase explorations backed by SQLite this week.
@jamespearce
James Pearce
1 year
Could be a big week for TinyBase. I'm pretty excited about SQLite & CRDT synchronization in v4.0 - nearly there! I just put up a fun TinyBase version of @tantaman 's awesome cr-sqlite demo to give you an idea. Let's go!
Tweet media one
2
3
36
0
1
16
@tantaman
Matt Wonlaw
7 months
And Effect-TS
Tweet media one
Tweet media two
3
0
15
@tantaman
Matt Wonlaw
5 months
Choose three plus Zero! Fully query driven sync. Any db on the backend. 🔥
@localfirstconf
Local-First Conf
5 months
Great talk by @aboodman of @rocicorp where he introduced Zero, their new hybrid query sync engine that searches the local cache first before falling back to the server for non-local data.
Tweet media one
6
15
192
1
1
15
@tantaman
Matt Wonlaw
2 years
Landed on a nice API for CRDTs & Sync in SQLite --
Tweet media one
2
0
15
@tantaman
Matt Wonlaw
8 months
Notion and Slack have so many rough edges in terms of UX. - Code blocks that become inescapable - Inconsistent shift+enter behavior - Lists responding to delete incorrectly when things like mentions are in them vs Obsidian & Discord where everything works as expected.
2
0
15
@tantaman
Matt Wonlaw
2 years
Haven't used Synergy since high school but coming back to it, it is pretty amazing. Can move my mouse and copy-paste between all my machines as if they were a single machine.
Tweet media one
2
1
15
@tantaman
Matt Wonlaw
1 year
The bright side of landing a perf regression is taking time to add more perf tests in the post-mortem and finding a 50x perf improvement. Pulling change sets from cr-sqlite will be 50x faster in the next release 🚀
1
0
15
@tantaman
Matt Wonlaw
2 years
Not sure how valuable it is but getting React and all the things running the browser with no build steps was fun.
3
2
14
@tantaman
Matt Wonlaw
1 year
@rauchg ◆ Cassandra ◆ Hive ◆ RocksDB ◆ Lexical ◆ Watchman ◆ Sapling ◆ Hermes ◆ Thrift 🤪
1
1
13
@tantaman
Matt Wonlaw
2 years
@pvh All my intuition points to the opposite of this quote being true. - Devices have tons of compute and storage waiting to be used - Cloud costs are crazy - Privacy matters to people - Given how many devices people have, data actually lives longer when local and replicated to peers
1
1
13
@tantaman
Matt Wonlaw
9 months
@brian_lovin Just let my apps interoperate. I don’t want ten calendar, email, doc, sheet apps.
2
0
14
@tantaman
Matt Wonlaw
1 year
Do any databases have direct bindings into a host language that, rather than creating SQL, creates the query program directly? E.g., `({...}).where(...)` would not have to go to the SQL step and would go directly to a compiled statement.
12
1
14
@tantaman
Matt Wonlaw
1 year
On the debate between raw SQL & ORMs, I find myself flip-flopping over the years. Is there a final answer at the end of the curve? Or just an unsatisfying "it depends"?
Tweet media one
17
1
14
@tantaman
Matt Wonlaw
5 months
If you've been wondering what I've been working instead of cr-sqlite the last several months, tune in to the talk!
@aboodman
Aaron Boodman
5 months
On my way to @localfirstconf . Really excited to talk about taking sync mainstream: Thank you very much to @schickling for organizing and the endless energy to bootstrap this community. @rocicorp is proud to sponsor, and looking forward to many more
3
0
65
1
0
14
@tantaman
Matt Wonlaw
9 months
If we made houses like software: we'd have proprietary electrical sockets, our homes would only work with appliances made by the manufacturer of the home, we'd be charged a fee for exchanging money in the house.
Tweet media one
@tantaman
Matt Wonlaw
9 months
@brian_lovin Just let my apps interoperate. I don’t want ten calendar, email, doc, sheet apps.
2
0
14
3
1
13
@tantaman
Matt Wonlaw
2 years
@_Qwein_ It's a respect thing. If they respect you they take your criticism as being as valid as their own.
0
1
10
@tantaman
Matt Wonlaw
2 years
There are so many backend as a service companies because it’s the easiest problem to solve that doesn’t actually have a solution.
2
1
13
@tantaman
Matt Wonlaw
7 months
Type-level programming melted tech twitter's brains. Not because the programs were difficult but because they look different. Type-level programming 101 by analogy to JS constructs.
1
0
13
@tantaman
Matt Wonlaw
2 years
Noodling on replicating a subset of the CRDTs stored in a database --
1
2
13
@tantaman
Matt Wonlaw
9 months
Next is going to sink react. That and react worrying more about concurrent mode than improving perf with static analysis and a compiler.
@thdxr
dax
9 months
you’re all bitching about react when your beef is with next
45
28
759
1
2
13
@tantaman
Matt Wonlaw
6 months
A nice property of a query language where every query is a subscription is that you can globally optimize across all queries. Multiple queries doing the same join? Share it between all queries. One query is a more constrained version of another? Re-use the first query's output.
4
1
13
@tantaman
Matt Wonlaw
1 year
I find, now that my projects have traction, I'm moving at a glacial pace :( - Messages to follow up on - Integrations to consider - Design input to provide - Meetings with interested contributors - Job offers to consider Is muting everything and grinding a valid option?
4
0
13
@tantaman
Matt Wonlaw
2 years
@enlightenedcoop lots of repliers are misunderstanding how intention is used here. They’re reading it as “good intentions” rather than being intentional and crafting one’s life like a work of art. Fascinating.
0
0
11
@tantaman
Matt Wonlaw
1 year
The biggest benefit of migrating a project from C to Rust is people actually starting to contribute. The second is not spending an inordinate amount of time reviewing code for memory issues. And lastly, being able to make large changes with confidence.
2
2
13
@tantaman
Matt Wonlaw
6 months
Print books have a serendipity that I often don't experience in the digital world. Stuck on a problem, opening a massive book and somehow landing on the exact page I need.
Tweet media one
0
0
12
@tantaman
Matt Wonlaw
1 year
Getting tired of seeing so many query builders trying to solve the TS integration problem while introducing their own problems. Did you know SQLite lets you encode your own type hints into create table definitions? We can even make TypeScript aware of these w/o a query builder.
Tweet media one
2
1
12
@tantaman
Matt Wonlaw
7 months
And Kysely
Tweet media one
1
0
12
@tantaman
Matt Wonlaw
2 years
So the official WASM build for SQLite is still rather rough. Mainly due to OPFS's coarse grained file locks. Back to wa-sqlite and indexeddb-vfs for the time being.
1
1
11
@tantaman
Matt Wonlaw
2 years
@kriswuollett @jmhodges more or less. The upside is you can ship quickly and then optimize when there's actual problems. Of course there should still be _some_ up-front thinking in terms of expected query patterns and modeling the data in a way to serve those kinds of queries.
1
0
12
@tantaman
Matt Wonlaw
5 months
💯. Transactions, mvcc, rollback, persistence, queries over objects should all exist in your language.
@localfirstconf
Local-First Conf
5 months
"Database features should be language features" Alexander Stigsen from @realm shares his insights into how with local-first you want to bland the gap between the database and the language.
Tweet media one
0
6
48
0
0
12
@tantaman
Matt Wonlaw
1 year
💯. Just make a modular monolith and let automation figure out deployment details. E.g., automatically splitting pieces that don’t talk (or barely talk) into separate deployments.
0
0
11
@tantaman
Matt Wonlaw
1 year
The last 5 years of React “improvements” were spent solving problems created by React in the first place. 🌶️🌶️
@theo
Theo - t3.gg
1 year
Quote tweet this with your spiciest web dev take
189
32
477
2
0
12
@tantaman
Matt Wonlaw
1 year
I'm excited about pulling in the more complicated operations () and using differential dataflow to maintain the views for an application that is entirely event sourced. Having a fully event-source app unlocks new things --
@tantaman
Matt Wonlaw
1 year
I've got differential dataflow implemented in JS. What should I do with it?
Tweet media one
Tweet media two
8
3
31
1
1
11
@tantaman
Matt Wonlaw
2 years
@DoomChild2 @Grady_Booch mono vs many is an incidental detail. You want, regardless of repo structure: - atomic commits across _all_ your code - atomic deployments based on a single sha - ability to bisect the entire codebase to automatically find bugs Monorepos are the only tool for this currently.
1
0
11
@tantaman
Matt Wonlaw
2 years
This is just full of gems. I've found my kindred spirit? @CoderHi Using SQLite as your reactive data store and single source of truth ~36 min in Also eschewing ORMs and doing everything via store procedures ❤️
1
1
11