Live data from Hacker News

Pocketbase: Open-source back end in one file

pocketbase.io

31–40 of 151 posts

Re: Pocketbase: Open-source back end in one file

#31
I've been using Pocketbase in production for a few months now, with alpinejs on the front end.

The development philosophy is on point. It's genuinely pleasant, pragmatic software which serves a real purpose and it improves weekly without feature creep.

I watch the discussions and issues slowly getting more tiresome as it becomes more mainstream and worry that he'll burn out trying to keep up with the level of support he's offered until now.

I would very strongly encourage anyone using this to generate income to support the project on open collective.

Re: Pocketbase: Open-source back end in one file

#33
post #29
post #9

It seems to me that redbean is a much simpler, vastly lighter one-file web server + sqlite DB: https://redbean.dev/ As a bonus, the same file runs on basically any OS without any dependencies on the local system, not even libc.

It's like saying nginx is better than superbase/firebase. Apples to oranges. You could replicate PocketBase in Readbean, but you would have to implement from scratch: - resources with CRUD API and real time subscriptions - admin UI - authz & authn system

I think you meant supabase.com instead of superbase.com.

Re: Pocketbase: Open-source back end in one file

#35
post #27

Earlier quoted context omitted.

More than one server. Sqlite should be thread safe and simple services can scale to thousands of parallal users. If you are OK with some downtime every 6 months when server goes down it will scale well. Deploy/ rollback will be an effort.

Downside with separate SQLite databases will be when you want to have statistics over many users.

I'm in this situation right now. How would one go about solving this?

To keep this simple, I'm thinking exporting just the necessary data from each db and inserting that to a stats db (having a source column to each table, referring to the original db). Then load the stats db with Metabase or something.

Migrations on the stats db may be a bit of a pain, as well as making sure that all data is exported and imported correctly every time.

I'm sure there are better ideas.

Re: Pocketbase: Open-source back end in one file

#36
Pocketbase is amazing! So far I had a great experience using it as a backend/database for the app I'm building where I'm using React with Vite for the frontend. I'm using it mainly for auth and for keeping track of paid and free accounts. Some things that I found rather useful:

- It's super easy to host. I was initially thinking of using Appwrite or Supabase but found it a tricky to self-host them, especially Supabase. I could spin up Appwrite quickly via CapRover, but found it an overkill for what I needed.

- View collections [1] make it easy to return just a subset of the data that you need. In my case I'm using a view collection as a join for users and paid_users collections, where I just return their paid through date.

- The fact that you can extend it with Go or JS [2] should make it possible to completely skip having a backend, at least if your needs aren't very complex.

I definitely plan to continue using it for some smaller/side projects. Currently I'm thinking of trying to use it as CMS for an Astro blog and in the future as backend for some browser extensions.

[1] - https://pocketbase.io/docs/collections/#view-collection

[2] - https://pocketbase.io/docs/use-as-framework/

Re: Pocketbase: Open-source back end in one file

#37
post #35
post #27

Earlier quoted context omitted.

Downside with separate SQLite databases will be when you want to have statistics over many users.

I'm in this situation right now. How would one go about solving this? To keep this simple, I'm thinking exporting just the necessary data from each db and inserting that to a stats db (having a source column to each table, referring to the original db). Then load the stats db with Metabase or something. Migrations on the stats db may be a bit of a pain, as well as making sure that all data is exported and imported co…

Litestream is a library that allows you to easily create backups. You can probably just do analytics queries on the backup data.

https://litestream.io/

Re: Pocketbase: Open-source back end in one file

#38
post #15

What are realistic bottlenecks to expect from a backend like this? Eg. a web app serving users that write posts simultaneously

More than one server. Sqlite should be thread safe and simple services can scale to thousands of parallal users. If you are OK with some downtime every 6 months when server goes down it will scale well. Deploy/ rollback will be an effort.

Gotcha. And that makes sense for the purpose of the project. Should one have multiple instances of sqlite dbs, what strategies exist to keep them synced?

Re: Pocketbase: Open-source back end in one file

#39

Scouring the documentation there's mention of a way to use PocketBase without JavaScript or Dart. Are they the only methods?

TypeScript is support on the frontend for oldtimers like me who have used plain JS for far too long and refuse to accept the torture of unnecessarily untyped languages any longer.

Also as already mentioned by others there exist web APIs.

Re: Pocketbase: Open-source back end in one file

#40

What minimal front-ends are there that one could combine with this minimal back-end to provide a minimal end-to-end?

I would say - htmx ( https://htmx.org/ ) - Alpine.js ( https://alpinejs.dev/ ) both are minimal and very easy to get started.

Been enjoying using PocketBase with Astro + htmx + Alpine
Post reply on HN