Live data from Hacker News

Show HN: PocketBase – Open Source realtime backend in one file

github.com

61–70 of 113 posts

Re: Show HN: PocketBase – Open Source realtime backend in one file

#61
post #30

I would love it. But: postgres, +backups, +replica managment. Basically a managed database for postgres in a container.

Check out https://thin.dev/ :) It's similar, supports self-hosting and uses postgres. Quick demo video here: https://www.youtube.com/watch?v=-jj19fpkd2c&t=3s

(I'm founder of Thin)

Re: Show HN: PocketBase – Open Source realtime backend in one file

#62
post #60

Earlier quoted context omitted.

There is a bunch of software in this space like supabase, flat backend, and appwrite that attempts to be a generic self hosted backend for apps in a manner similar to firebase by providing data storage and authentication with a rest API in an integrated fashion, usually with a built in admin interface for schema design, user management, etc. You can also think of them as software like postgrest but with the addition…

Ok, so it's a self-hosted CRUD boilerplate with auth written in Go? Or a self-hosted Notion but with less view/UI customization out of the box?

> Ok, so it's a self-hosted CRUD boilerplate with auth written in Go? Or a self-hosted Notion but with less view/UI customization out of the box?

I guess you could describe it as "CRUD boilerplate" although that could also make it sound like the main purpose is to provide database table/form views like Microsoft Access which isn't really accurate.

It provides a database rest API like PostgREST with authentication so that you can write whatever frontend you want for it.

Since you say that you're familiar with firebase, imagine you're writing an android app using react native or something that uses firebase as the backend to store users' posts (or whatever they are).

The idea is that if you want to self host it instead of using firebase, you just run this type of software on your server and it will provide the basic functions that any client side app would need on the backend: storage for users' data as well as handling accounts.

I don't think it's really that complicated; it's basically just an interlace to a database, but if you look at something like PostgREST that automatically creates a rest api for a database, you would probably think "wow, I could almost create an app just using this as the backend without having to create my own backend, but I would have to handle authentication/registration myself," so these types of platforms just go a little further and handle that as well.

Re: Show HN: PocketBase – Open Source realtime backend in one file

#63
post #60

Earlier quoted context omitted.

Ok, so it's a self-hosted CRUD boilerplate with auth written in Go? Or a self-hosted Notion but with less view/UI customization out of the box?

> Ok, so it's a self-hosted CRUD boilerplate with auth written in Go? Or a self-hosted Notion but with less view/UI customization out of the box? I guess you could describe it as "CRUD boilerplate" although that could also make it sound like the main purpose is to provide database table/form views like Microsoft Access which isn't really accurate. It provides a database rest API like PostgREST with authentication so…

Gotcha. Thank you for the explanation.

Re: Show HN: PocketBase – Open Source realtime backend in one file

#64
This looks awesome! I will definitely give it a try. Right now I use postgres in a docker compose but its definitely a bit heavier for single machine prototyping.

One thing that I like about my setup though is that there's a clear migration path to horizontally scale. Do you have a recommended way to move past pocketbase should an app get to that point?

Re: Show HN: PocketBase – Open Source realtime backend in one file

#66
This looks really great. Have you thought about adding Operational Transform or CRDT primitives to your offering? Realtime subscriptions are nice - but they're even better with realtime collaboration. Because you're using SQLite directly, it's easy(er) for you to build in efficient CRDT mutations to your database rows because SQLite's BLOB column supports incremental IO: https://www.sqlite.org/c3ref/blob_open.html

This could allow you to save a CRDT update operation without needing to read the entire CRDT blob into memory, parse it, and then save it all back to disk.

Re: Show HN: PocketBase – Open Source realtime backend in one file

#67
post #46

Earlier quoted context omitted.

You haven’t tried really hard: > PocketBase could be used as a standalone app or as a Go framework/toolkit that enables you to build your own custom app specific business logic and still have a single portable executable at the end.

if it's used a standalone app then what functionality is it providing beyond "user admin". Like, what problem does it solve in that use case? > a Go framework/toolkit that enables you to build your own custom app specific business logic that definition applies to literally every framework and toolkit. It tells me nothing.

> and still have a single portable executable at the end.

You're quoting selectively in a way that elides meaningful parts of the sentence, and then stating that the description lacks meaning.

Re: Show HN: PocketBase – Open Source realtime backend in one file

#68
post #34

Earlier quoted context omitted.

If a selling point is run from "one file", that's quite difficult to do in python. There are things like pyinstaller but you end up shipping the entire interpreter in the bundle.

The pex tool lets you build single file python executables which are well suited for server deployments.

oh wow thanks i didn't know about this. in that case it would be super simple for me to wrap up a FastAPI server with SQLite or even some in-memory database that runs elsewhere, deliver as a single file!

Re: Show HN: PocketBase – Open Source realtime backend in one file

#69
post #12

How are the real time subscriptions with SQLite achieved? Is this a feature of SQLite itself or something that PocketBase itself implements on top of it?

It's implemented in the application, it's not a feature of SQLite, but its very simple and robust - when a record is created/updated/deleted I'm broadcasting the change to all subscribers that are allowed to receive it (the access control is based on the colleciton's list and view rules). The realtime api implementation could be found at https://github.com/pocketbase/pocketbase/blob/master/apis/re...

Reading through the code/docs it looks like you can subscribe to individual records (database rows) or collections (tables), is this correct? In your Records.getList method, you have filter functionality that would be nice to subscribe to (ie. subscribe to changes in "demo" collection where totalComments > 10). Subscribing to a specific result set seems like it could scale better than notifying subscribers of all table changes, which then get filtered in the subscribe() callback func in the SDK. Very cool work!

Re: Show HN: PocketBase – Open Source realtime backend in one file

#70
Nice but my super anal quip is please don't call this thing "realtime". It doesn't make sense in this context. What is realtime about it? Are there timing guarantees or are timing constraints provided in API requests? Because that's what realtime systems are. Realtime does not mean "real fast". For example, a train track switching system might be getting run by a 1MHz CPU and still be real time. It's not about speed, it's about deadline guarantees.
Post reply on HN