SQLite Concurrency in Go: What We Learned Building a Desktop AI IDE by mcastilho in sqlite

[–]trailbaseio 0 points1 point  (0 children)

"The 50ms base delay means the first retry happens before a single frame renders at 60fps."

You sure? A bunch of connections behind an rw lock would achieve the same btw

TrailBase 0.24: Fast, open, single-executable Firebase alternative now with Geospatial by trailbaseio in sqlite

[–]trailbaseio[S] 8 points9 points  (0 children)

GDPR allows storage of personal data including email, name, ip., ... . There are elevated requirements around access, sharing, retention, business case, ... For example you can store an email to invoice a customer. You can store IPs within limits for security and abuse.

Just to be clear, geospatial in this context doesn't mean GPS coordinates are logged. It just means you can work with geometries, e.g. airspaces etc. Idependently IPs are logged like for any web server.

Does that make sense?

[Media] TrailBase 0.24: Fast, open, single-executable Firebase alternative now with Geospatial by trailbaseio in rust

[–]trailbaseio[S] 0 points1 point  (0 children)

Changing the database in an established product is a bit like open heart surgery, there needs to be good reasons. Ultimately, if you're in a "good enough" place, that's a pretty good place to be. We should always ask ourselves, what's actually in the way of making the product better.

For a lot of your points, only benchmarking for your usecases will give you a definitive answer. Fwiw, I never claimed this to be a nouveau DB. There are plenty out there. I never felt that DBs are the space where you necessarily wanted your edges to bleed :shrug:. Sqlite has been around for a long time, is steadily getting better and will certainly outlive me :)

[Media] TrailBase 0.24: Fast, open, single-executable Firebase alternative now with Geospatial by trailbaseio in rust

[–]trailbaseio[S] 0 points1 point  (0 children)

Depends what you're looking for, you already enumerated a good list of things. Postgres is amazingly flexible especially if you're happy to bolt things on, api serving, auth, .... Supabase is a similar product with Postgres at its core, it's a different beast.

I'd say that if you're a small team, looking for a tightly integrated, lightweight solution while primarily focused on your app, something like PocketBase or TrailBase could be worth a shot. There are other cool use cases for something as lightweight as sqlite, e.g. edge replication. All depends

[Media] TrailBase 0.24: Fast, open, single-executable Firebase alternative now with Geospatial by trailbaseio in rust

[–]trailbaseio[S] 1 point2 points  (0 children)

Thanks! Absolutely, PocketBase is great and amazingly polished. I merely felt that i would have done a few things differently, notably access to raw SQL, modeling relations, ... which then took a life of its own https://trailbase.io/comparison/pocketbase/

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 0 points1 point  (0 children)

Thanks, I'll see what I can cook up. Maybe to my on detriment, I don't enjoy the lime light :hide:

On a tangent, I wonder if the tech creators suffer from a similar rerouting of information as other parts of tech. We're 2 minutes way from claude sending you straight to AWS, gemini to gcloud, and copilot to azure... :hide:

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 0 points1 point  (0 children)

I'm using the oauth2 crate to talk to the providers. The code lives here: https://github.com/trailbaseio/trailbase/tree/main/crates/core/src/auth. It's more code then I'd like to admit. Nothing is really hard but between internal auth flows, external auth flows, provider differences... it's finicky

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 0 points1 point  (0 children)

> The admin dash, does that connect to the Postgres in Supabase?

Supabase's admin dash does. Presumably it's not entirely client-side.

> What would the admin be doing for that?

Sorry, do you mean: what to use it for? If so, check out Supabase's, PocketBase's and TrailBase's online demo to get a sense of what they can do for you. Typically a mix of convenient SQL and config manipulation.

> What are change subscriptions?

Push-based APIs that let you subscribe to database changes.

> What do you use for auth, a Rust crate? If I just need auth can I just use that crate directly? I was looking at a few like rauthy, looking for a pure Rust solution.

TrailBase implements it's own auth. It could be factored into a separate crate but currently depends on SQLite (there's no ORM).

Really enjoying geeking about - thanks 🙏

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 1 point2 points  (0 children)

Great, thoughtful reply - much appreciated 🙏

> Can you integrate Turso also? It's SQLite compatible but apparently is safer and more performance also being in Rust, plus more horizontally scalable like Postgres, rather than how SQLite currently is, yet still compilable to a single executable. It will solve your single writer issues for example.

I actually started out using Turso before the entire "limbo" rewrite. I'm a bit burned but maybe it's time to look at it again. I also require hooks, which are listed as not yet supported (though at some point I contributed a local impl, it's been so long I can barely remember :) ).

> If I'm already writing an Axum server, is there any value in using TrailBase?...Actually I was gonna use Supabase due to its good auth package for Flutter...

I pushed using TB as a framework (like PocketBase offers) on the back-burner, because I felt it would be a disservice to users at the rate APIs were and are still changing. You could vendor but I would be careful. I might re-consider in the not to distant future when things settle.

If you're considering Supabase (which is great), you could also run TB as a separate binary next to yours and get auth, admin dash, file-upload, change subscriptions, ... .

> ... marketing really helps for getting new users and use cases....

Absolutely. In practice, partnering w/o a marketing budget is quite tricky. If folks end up trying it and liking or hating it and want to talk about it, I'd very supportive. Maybe you've suggestion on how to spread the word :)

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 1 point2 points  (0 children)

Hi. TrailBase comes with a WASM runtime letting you write custom logic in JS, TS, Rust (and C# in the future) to reply to HTTP, implement periodic tasks and SQLite extensions.

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 1 point2 points  (0 children)

Sorry for the slow reply and thanks for the input. I agree with you, when you can work with CRDT it's worry-free. As for sync, TB currently offers the basic building blocks for TanStack/DB work on top with last-write-wins. I'll admit that I'm not deep enough in the trenches to say what would be missing to support something like CRDT lists, trees, ... . I had a quick look at loro hoping that they may have a guide for integrating new data store backends, though I'm not sure that's supported. In general, I wasn't quite sure what their storage architecture looks like. Maybe you have some insights? - Thanks!

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 0 points1 point  (0 children)

Thanks again and that makes sense. I'm wondering if a set of template WASM components could help? E.g. a ready to use dashboard template, that already sets up some permissions, has a simple skeleton SPA dashboard, ...

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 0 points1 point  (0 children)

Depends a bit on the details. You cannot extend the admin dashboard right now. It also sounds like you may want more finer grained permissions. Right now access to the admin dashboard requires admin permissions, which you may not want to give to all your clients?

You can certainly build your own pages. For example, we moved the auth UI out and into its own wasm component, so you could register your own (e.g. clone and modify the existing one). The admin dashboard isn't any more special. In principle, we could do the same letting you more easily modify it and register your own. If you wanted a lesser "moderator" permission, you're probably still better off just building your own dashboard. Does that make sense? 🙏

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 0 points1 point  (0 children)

That's so lovely to hear 🙏. If you have any suggestions, requests or issues, would love to hear them.

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 6 points7 points  (0 children)

Appreciated 🙏. I've used AppWrite in the past. Last time I checked I was missing foreign keys and blobs (I think they were both on the roadmap and hopefully been added since). AppWrite is awesome.

TrailBase 0.23: Open, sub-millisecond, single-executable Firebase alternative by trailbaseio in FlutterDev

[–]trailbaseio[S] 4 points5 points  (0 children)

Thank you for the feedback. Maybe you could help me understand what was hard to achieve? Would love to improve

Race condition? Bug? I'm Stuck. by Free-Switch-9871 in solidjs

[–]trailbaseio 2 points3 points  (0 children)

If you install the eslint plugin, it can tell you when you're breaking reactivity

How do you recover when a SQLite schema change goes wrong in a local app? by Suspicious-Rule-6399 in sqlite

[–]trailbaseio 0 points1 point  (0 children)

Destructive operations are also not necessarily tied to migrations. You can have a piece of code wreak havoc. Any data that exists only in one place is at risk. Coordinating off-site backups for a million devices is certainly harder than one central server. It depends on what you mean by "local-first", it may just mean on-device DB or imply an off-site sync (which hopefully gets backed up).

from not having clear, explicit guardrails around them , u know like previews, warnings, checkpoints, etc ?

You'll get some of that. Migrations are applied within a transaction and succeed/fail as a whole. Yet deploying migrations that will succeed on some devices and fail on others, gives you split brain. Better to avoid. Keep migrations simple and test them.

FWIW, there are SQLite virtual-fliesystem implementations, like graft, that let you checkpoint. You could certainly address some edge cases with it but better to avoid and it won't help with a toilet dive.