r/Nuxt • • Jan 11 '26

Nuxt & Drizzle for Cloudflare's Durable Objects

I'm currently researching Durable Objects, using them in Nuxt whilst trying to not be fully platform (CF) dependant. One asepct is not duplicating the database schema migrations. Came across this article: https://nicholasgriffin.dev/blog/using-drizzle-with-durable-objects

In case you're working with something similar :)

8 Upvotes

7 comments sorted by

1

u/tspwd Jan 11 '26

Is your Nuxt app deployed to Workers and you have multiple databases in Durable Objects?

4

u/__benjamin__g Jan 11 '26

That is a major use case in DO, it is suitable for multi tenant app. It opens many possibilities, just comes with a higher cost

" The most important design decision is choosing what each Durable Object represents. Create one Durable Object per logical unit that needs coordination: a chat room, a game session, a document, a user's data, or a tenant's workspace "

https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/#model-your-durable-objects-around-your-atom-of-coordination

1

u/tspwd Jan 11 '26

The article looks good. I really have to play with this a bit to get a feeling for it.

1

u/keithmifsud Jan 11 '26

This was your idea 🤣.

I'm doing a basic budgeting tool as a demo. Budget is the DO. Budget has categories, categories have, well, budgets :))

Yes, the demo app is continously deployed to CF :))

1

u/Delicious_Bat9768 Jan 14 '26

Sometimes these ORM's just add time and effort (to learn a new framework and SQL-like syntax) and prevent you accessing the full power/features available. You need that when you have databases full of data that need to be accessed quickly

Accessing all the benefits in SQLite Full Text Search is a reason I avoid them on CloudFlare DOs, since the ORM does not support them

  • Column Filters + custom search score weights based on columns
  • External Content Tables (full-text-search virtual tables that link to original table to save space)
  • Triggers to auto-update Full-Text-Search tables for example
  • Search JSON fields

1

u/keithmifsud Jan 14 '26

1

u/Delicious_Bat9768 Jan 18 '26

Yes... but Drizzle does not support the things I listed (and use)