Turso's AI moment

Issue #333.October 21, 2024.2 Minute read.
Bytes

Today’s issue: Running from the Rust mafia, launching Svelte 5, and drinking in all the SQLite goodness at Turso Launch Week.

Welcome to #333.


Eyeballs logo

The Main Thing

The robot from I, Robot looking upset

When my AI app finds out I used a Google Sheet for its database

Turso’s AI moment

My Great Aunt Eleanor grew up in Cupertino, and she used to tell me stories about how she would cut Steve Wozniak’s hair back in the ’70s in exchange for Apple stock.

Turns out she was making it all up because she’s a pathological liar, but I still learned a valuable lesson: it pays to be in the right place at the right time.

That’s definitely true for Turso, which has spent the last few years building a distributed database on top of libSQL, their open-contribution fork of SQLite. It’s always been a cool project – but all of a sudden, it’s become the go-to DB for this growing tidal wave of new AI applications.

Why is this happening? Because it turns out that libSQL is uniquely excellent at three things that AI apps really care about: vector search, multi-tenancy, and local first.

Let’s break down what those buzzwords actually mean and look at what Turso is launching to bring us all one step closer to the singularity:

1. Vector similarity search is a fundamental part of building any AI app, because it lets you retrieve data based on hundreds of data attributes (aka vectors) to get more relevant and personalized results.

You used to have to piece together a bunch of extensions and specialized DBs to build this. But since Turso’s native vector search integrates deeply with the SQLite query language, it works without any extensions and is able to be much more efficient in production.

Turso’s Vector Search feature just hit GA, and their new Vector SDK makes it pretty easy to set this up yourself.

2. Multi-tenancy has always been Turso’s bread and butter, because each libSQL database is just a file that’s cheap and easy to spin up.

Now, developers are using it to build apps with AI agents that can spin up “ephemeral databases” as workspaces to build a website or adjust code for the user. One AI app has already created over 40,000 Turso DBs – but since Turso’s Pro plan comes with unlimited DBs, I guess that’s not quite as insane as it sounds?

3. Local first AI apps are still pretty much nonexistent because of how resource-intensive LLMs are. But Turso’s brand new 1-bit quantization for vector embeddings makes it possible to do way more stuff with LLMs on-device, while keeping a small footprint.

Bottom Line: Auntie Eleanor might not have 15 million dollars worth of Apple stock, but at least I have 15 million SQLite databases in my AI-powered to-do list app. So you tell me who’s winning.

        

idx-logo.png

Our Friends
(With Benefits)

A wizard staring into a crystal ball

Tfw you spin up a full-stack project with one click

Google’s Project IDX launched its open beta

And the web-based dev platform keeps getting better.

It now lets you bring your entire full-stack workflow into the cloud, with support for all major languages and frameworks – plus AI-powered code suggestions from Gemini.

IDX’s goal is to provide a one-stop shop for building, testing, and deploying any project straight the browser. Here’s how you can do that:

  • Instantly spin up a new project (or import an existing one) with the online IDX editor. Their framework-specific templates let you skip all the setup and boilerplate.

  • Get live previews of your app with IDX’s built-in web previews and emulators.

  • Share the project with your team like you’d share a Google Doc, and collaborate without replicating your local env 🙏.

  • Deploy your app to Firebase with one click, or spin up your own DB with Postgres, MySQL, and others.

Try spinning up an IDX project for yourself, and feel the magic for yourself.


Spot the Bug logo

Spot the Bug

Presented by Sentry

They’re hosting a free workshop on Implementing Clean Architecture in Next.js that explains what clean architecture actually is, and how to use it to solve common problems in a Next.js app.

function logPropertyUpdates(target) {
  return new Proxy(target, {
    set(target, property, value, receiver) {
      console.log(`Property "${property}" changed to "${value}"`);
      return Reflect.set(target, property, value, receiver);
    },
  });
}

const user = logPropertyUpdates({
  name: "Lew",
  details: {
    age: 24,
    country: "USA",
  },
});

user.name = "Kareem";
user.details.age = 25;

Cool Bits logo

Cool Bits

  1. Glauber Costa wrote a full breakdown of everything Turso launched today. It goes into a lot more technical detail than what I wrote, but it also contains fewer anecdotes about my family members. So, tradeoffs.

  2. Svelte 5 is officially live. There’s no official blog post yet or any real record of it, beyond some excited tweets – but when has blindly believing things you read on Twitter ever steered you wrong?

  3. Unlayer provides embeddable content creation tools for SaaS, so you can give your users a drag-n-drop builder for creating emails, web pages, or popups. Teams at Netflix, Fidelity, and 1,000+ other companies use Unlayer to build content features faster and save an average of 52% on dev and maintenance costs. [sponsored]

  4. Nolan Lawson wrote about why he’s skeptical of rewriting JavaScript tools in “faster” languages, and now he’s on the run from the Rust mafia.

  5. Glauber Costa is hosting a Twitter Space at 9am PT today (which if you’re a die hard Bytes sub opening this right when you get it, is like right now) on all things Turso, libSQL, and AI. Just in case you’ve got a fever, and the only prescription is more cowbell distributed databases built on top of a fork of SQLite.

  6. shadcn just released 25 sidebar components 👑.

  7. Greensock’s animation library, GSAP just got acquired by Webflow. Think of all the socks they can buy now.

  8. CarbonQA provides high-quality QA services that scale. Their US-based testers will break your app repeatedly and do all the manual testing you hate doing, so you can let your devs be devs. [sponsored]

  9. Gabriel Petersson created the world’s most performant DOM-based table. That’s his claim, and since the DOM-based Olympics don’t take place for another 3 years, we have no way of knowing for sure until then.

  10. Check out tur.so/scarygood to follow all the other stuff Turso is announcing this week.


Spot the Bug logo

Spot the Bug: Solution

Sponsored by Sentry

ES6 Proxies are not recursive by default. In the above example, the user object is wrapped in a Proxy, but the details property is not. Therefore, when the user.details.age property is updated, the Proxy is not triggered.

To fix this, we can make the Proxy recursive:

function logPropertyUpdates(target) {
  if (typeof target === "object" && target !== null) {
    return new Proxy(target, {
      get(target, property, receiver) {
        const value = Reflect.get(target, property, receiver);
        return logPropertyUpdates(value);
      },
      set(target, property, value, receiver) {
        console.log(`Property "${property}" changed to "${value}"`);
        return Reflect.set(target, property, value, receiver);
      },
    });
  }
  return target;
}

const user = logPropertyUpdates({
  name: "Lew",
  details: {
    age: 24,
    country: "USA",
  },
});

user.name = "Kareem";
user.details.age = 25;

one question interview logo

One Question Interview

WTF is multitenancy and why should you care?

Because in certain scenarios, it’s a 10x improvement on the current way of doing things and it lets you work with your data in a different way than before. Much like when Git came into the scene!

It’s not for everybody, and it’s not for every problem, But often times, it’s a way to be in control of how to logically split your data. For AI, for example, it means you can create replicas easily of just the data that you want an LLM to access. Because it is a replica, and it’s just a piece of the data, you can do whatever you want with it and not have it affect your main database.

Or you can use databases that come and go. One per user, one per session, one per page, everything isolated.

Glauber, Turso CEO