# S10 Bonus: On-Device Vector Search in SQLite with Pekka Enberg of Turso

Published: 2024-09-12
Duration: 1104s
Audio: https://pdst.fm/e/pscrb.fm/rss/p/audio4.redcircle.com/episodes/739355fd-f839-40a7-9f2c-c9cd7cabff21/stream.mp3

## Key Takeaways
- SQLite for Production: Turso adds features such as replication to SQLite for modern workloads. It also offers remote access, turning the in-process library into something similar to Postgres.
- Database Per Tenant: Turso is lightweight enough to run lots of databases, such as one per user. Pekka says this helps with scaling, privacy and data isolation, though multi-tenancy was still being readied for production.
- Waiting on Vector Search: Turso first sat out the vector database wave to watch the market. About six months later, seeing the Postgres community step up, the team decided this important workload was almost existential.
- On-Device RAG: Vector search in SQLite lets retrieval happen on the device, cutting latency and keeping private data local. Pekka expects strong retrieval can take smaller, on-device models pretty far.
- React Native First: Turso began its mobile SDK work with React Native, building on its popular JavaScript SDK. Pekka expects native iOS and Android support will both be needed, with Flutter and others depending on demand.

**Bringing on-device vector search in SQLite to apps: Pekka Enberg of Turso on putting embeddings and AI retrieval at the edge with a modern SQLite fork.**

———

Hello listeners.

Today, I have an incredible follow episode from our friends at Turso. You may remember our [episode with Glauber Costa in Season 8](https://codestory.co/podcast/bonus-glauber-costa-turso/), where he told us the creation story of the platform. Today, I'm speaking with his co-founder, Pekka, to hear the update on Turso and what the team has been building over the past year.

Now with Turso, you can not only have embedded replicas on your device or browser, with multi-tenancy and syncing to Turbo's edge network - but now the tool powers vector search from on the device itself, leading to natively server less, low latency sql lite production loads. Turso continues to push the envelope with their product, and expanding use cases for developers.

If you would like to learn more about Turso, go to turso.tech. If you'd like to learn more specifically about vector search, go to turso.tech/vector.

Sponsors

- [Speakeasy](https://speakeasy.com/codestory)

Links

- [https://turso.tech/](https://turso.tech/)
- [https://turso.tech/vector](https://turso.tech/vector)
- [https://codestory.co/podcast/bonus-glauber-costa-turso/](https://codestory.co/podcast/bonus-glauber-costa-turso/)
- [https://codestory.co/podcast/bonus-dor-laor-scylladb/](https://codestory.co/podcast/bonus-dor-laor-scylladb/)

  

Timestamps

00:00 – Intro

01:36 – What Is Turso

03:02 – Turso Customer Success Stories

04:22 – What's New at Turso

06:18 – Why Multi-Tenancy Matters

07:48 – Vector Search Use Cases

10:34 – On-Device Vector Search

12:34 – Where Turso Goes Next

14:24 – Choosing Which SDKs

15:57 – Getting Started with Turso

Times are from the episode recording; ad breaks in your player may shift them a bit later.

  

Read the key answers from this episode, with quotes and timestamps from Pekka Enberg from Turso: [https://www.codestory.co/episodes/s10-bonus-whats-new-with-turso-with-pekka-enberg/](https://www.codestory.co/episodes/s10-bonus-whats-new-with-turso-with-pekka-enberg/)

  
  

Current Sponsors:

- [Tiger Data](https://tigerdata.com/)

- [Protected Harbor](http://protectedharbor.com/codestory)

- [Render](https://render.com/)

- [Fitnexa](https://www.fitnexa.com/)

- [Perplexity](https://pplx.ai/codestory)

- [Entelligence](https://entelligence.ai/)

Checkout our [Substack](https://news.codestory.co/subscribe)

Checkout our [Stacklist!](https://stacks.codestory.co/)

Checkout our [Patreon!](https://www.patreon.com/cw/codestory)

Hosted by  [Noah Labhart.](https://noahlabhart.com/)

  
  
Our Sponsors:  
* Check out Granola and use my code granola.ai/CODESTORY for a great deal: https://granola.ai  
* Check out Perplexity: https://pplx.ai/codestory  
  
  
Advertising Inquiries: [https://redcircle.com/brands](https://redcircle.com/brands)  
  
Privacy & Opt-Out: [https://redcircle.com/privacy](https://redcircle.com/privacy)

## Chapters
- 0:00 — Intro
- 1:36 — What Is Turso
- 3:02 — Turso Customer Success Stories
- 4:22 — What's New at Turso
- 6:18 — Why Multi-Tenancy Matters
- 7:48 — Vector Search Use Cases
- 10:34 — On-Device Vector Search
- 12:34 — Where Turso Goes Next
- 14:24 — Choosing Which SDKs
- 15:57 — Getting Started with Turso

## Frequently Asked Questions
- **Q:** What is Turso and how does it relate to SQLite? — **A:** Turso's tagline is "SQLite for production," and it builds features onto SQLite for modern workloads such as serverless and mobile. Pekka Enberg explained that SQLite worked well for the team, "but it was just missing some features like replication, which we needed at the time" [02:49].
- **Q:** Why use a database-per-tenant architecture? — **A:** Pekka says separate databases help with scaling, and also with privacy and keeping data isolated, from the backend all the way to mobile devices. In his words, it resonates "because now you can have these databases which are isolated from each other" [07:17].
- **Q:** Why did Turso add vector search to SQLite? — **A:** Vector search supports retrieval augmented generation, which retrieves relevant data for large language models. Pekka said the team initially waited, but after seeing the Postgres community move, "we started thinking this kind of becomes like an existential thing" [11:24].
- **Q:** What are the benefits of on-device vector search? — **A:** Pekka Enberg points to lower latency and better privacy, since searching and model-related processing can happen within the device itself. Speaking about private information, he said, "It doesn't necessarily have to leave the device" [10:25].
- **Q:** How does Turso decide which mobile SDKs to support? — **A:** Turso started with React Native because its JavaScript SDK is by far its most popular, and Pekka expects to need both native Android and iOS as well. For Flutter and other frameworks, he said, "I think for us, it's just going to be demand based" [15:49].
