Log inSign up
Sam Willis
3,480 posts
Image
user avatar
Sam Willis
@samwillis
Building Agents & composable sync primitives @ElectricSQL. Sync Engines, Durable Streams & AI. Started PGlite.dev, co-creator of @tan_stack DB.
Stamford UK
samwillis.uk
Joined May 2007
775
Following
3,545
Followers
  • Pinned
    user avatar
    Sam Willis
    @samwillis
    Dec 27, 2025
    My overriding thought going into 2026: Problems you thought were out of reach no longer are. Pick a problem 100x harder than you thought possible to tackle alone, and run with it. Start now. AI will catch up and make it possible.
    5.1K
  • user avatar
    Sam Willis
    @samwillis
    Feb 25, 2024
    I'm absolutely blown away by the response to PGlite, 1k GitHub stars in under three days!
    Image
    116K
  • user avatar
    Sam Willis
    @samwillis
    Jul 14, 2025
    PGlite (WASM Postgres) now gets over 1 million downloads a week! šŸ¤ÆšŸš€ Absolutely incredible to see how people have embraced what we have built. Awesome work by the team!
    Image
    41K
  • user avatar
    Sam Willis
    @samwillis
    Mar 24, 2024
    While you're all busy putting SQLite on the server, here I am putting Postgres in the client. Big update coming this week šŸš€
    Image
    GitHub - electric-sql/pglite: Embeddable Postgres with real-time, reactive bindings.
    From github.com
    47K
  • user avatar
    Sam Willis
    @samwillis
    Oct 16, 2024
    With PGlite + @ElectricSQL sync you can build an issue tracker handling 100k issues + 500k comments, synced from Postgres to PGlite in the browser! Super fast UI updates with all writes going though the local database, and Postgres FTS in PGlite for search šŸ”„
    Image
    00:00
    55K
  • user avatar
    Sam Willis
    @samwillis
    Aug 12, 2024
    Perfect timing! We hit 5k stars on GitHub just as we launch the massing PGlite update šŸš€šŸŽ‰
    Image
    25K
  • user avatar
    Sam Willis
    @samwillis
    Jul 30, 2025
    Next time someone says Postgres doesn't scale... ChatGPT runs on Postgres with just a single master 🤯 There was a great talk at PGconf how they have scaled one of the larges apps in the word - link in 🧵.
    34K
  • user avatar
    Sam Willis
    @samwillis
    Feb 22, 2024
    Introducing PGlite - WASM Postgres running in the browser, Bun and Node! Working on this has been a lot of fun over the last few weeks. Unlike previous WASM Postgres projects this one isn't using a WASM Linux VM, it's pure Postgres 🄳
    user avatar
    Electric
    @ElectricSQL
    Feb 22, 2024
    Hey @jarredsumner & @nikitabase, got it working! PGlite, WASM Postgres running in the browser, Bun and Node. Only 3.7mb gzipped. 🤯 In-memory or persisted to the filesystem with Bun/Node and IndexedDB in the browser. šŸš€ github.com/electric-sql/p… x.com/jarredsumner/s…
    Image
    51K
  • user avatar
    Sam Willis
    @samwillis
    Oct 7, 2025
    Just download them all... 2.6k cites in the US, ~78kb json (23kb gzip) in your CDN. Even all 19k "places" in the US is only ~150kb gziped. With proper cache headers this is in the browser cache next time.
    user avatar
    Ryan Florence
    @ryanflorence
    Oct 7, 2025
    Simple interaction: one select changes the options of a second with a remote data source How would you build it? How do you deal with race conditions?
    Image
    45K
  • user avatar
    Sam Willis
    @samwillis
    Feb 10, 2025
    PGlite, our Postgres in WASM project, has hit 1/2 million downloads a week! 🤯 We (@ElectricSQL) have a lot planned for (native... šŸ˜‰) PGlite this year, exciting times ahead!
    Image
    13K
  • user avatar
    Sam Willis
    @samwillis
    Dec 10, 2024
    Exciting day, @ElectricSQL is now in Beta šŸš€ Electric makes realtime replication between Postgres & *any* client side store possible! (And we've scaled it to 1 million connections 🤯) Here it is syncing 100k rows to a PGlite app:
    Image
    00:00
    18K
  • user avatar
    Sam Willis
    @samwillis
    Jul 21, 2025
    New docs for the @tan_stack DB live query api šŸš€ We completed a major refactor/rewrite of both the query builder and query engine a couple of weeks ago, and the docs are now live - link in 🧵 Live queries use IVM* to do the minimal work on each change.
    Image
    26K
  • user avatar
    Sam Willis
    @samwillis
    Nov 12, 2025
    We've just shipped query driven sync for @tan_stack DB! Huge lift to get here - this is the DX I dreamed of when I started working on sync. Define where data comes from (anywhere!) as collections, and then query over those collections in your components. šŸŖ„šŸŽ‰
    user avatar
    TANSTACK
    @tan_stack
    Nov 12, 2025
    šŸš€ TanStack DB 0.5 is here with Query-Driven Sync Your component's query IS the API call. No custom endpoints. No GraphQL resolvers. Just write your query and DB figures out exactly what to fetch. Details šŸ§µšŸ‘‡
    Image
    32K
  • user avatar
    Sam Willis
    @samwillis
    Sep 22, 2025
    How fast are live queries in @tan_stack DB? This query with two joins and over 100k rows executes in under 1ms for the initial run. Updating a row in the source collection is reflected in the results in just *10 microseconds*! šŸš€
    useLiveQuery((q) =>
  q
    .from({ comment: commentsCollection })
    .leftJoin(
      { issue: issuesCollection },
      ({ issue, c }) => eq(comment.issue_id, issue.id)
    )
    .leftJoin(
      { project: projectsCollection },
      ({ project, issue }) => eq(issue?.project_id, project.id)
    )
    .orderBy(({ comment }) => comment.created_at, 'asc')
    .limit(100)
)

/*
Dataset Size | Projects | Issues | Comments | Initial Load (ms) | Changes | Incremental (ms)
-------------|----------|--------|----------|-------------------|---------|-----------------
Small        |       10 |     50 |      200 |              0.25 |       1 |            0.012
Medium       |       50 |    250 |     1000 |              0.28 |       1 |            0.009
Large        |      250 |   1250 |     5000 |              0.21 |       1 |            0.011
Very Large   |     1250 |   6250 |    25000 |              0.37 |       3 |            0.052
    user avatar
    Sam Willis
    @samwillis
    Sep 22, 2025
    Live queries in @tan_stack DB are incremental - they are maintained, rather than re-run, when data changes. It does this with differential dataflow / DBSP. Usually this tech trades fast updates for a slower start. 🧵 on how we made *both* initial and update runs lightning fast!
    35K

New to X?

Sign up now to get your own personalized timeline!

Create account

By signing up, you agree to the Terms of Service and Privacy Policy, including Cookie Use.

Terms of Service|Privacy Policy|Cookie Policy|Accessibility|Ads info|Ā© 2026 X Corp.
Don't miss what's happening
People on X are the first to know.
Log inSign up