Live data from Hacker News

Pocketbase: Open-source back end in one file

pocketbase.io

121–130 of 151 posts

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

#121

So it's the "Supabase of SQLite"? Aren't there entire classes of problems that shouldn't exist for SQLite because it's intended to be an embedded database, as opposed to a client/server architecture like Postgres/Supabase? And as such, I'm confused why this exists.

PocketBase is trying to be a simple webserver, code-running backend, and database. I believe the author chose SQLite because it is simple. PocketBase isn't trying to have every feature nor be high performance.

Like Althttpd?

That’s the web server created by the SQLite team and also serves sqlite.org

https://sqlite.org/althttpd/doc/trunk/althttpd.md

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

#122

So it's the "Supabase of SQLite"? Aren't there entire classes of problems that shouldn't exist for SQLite because it's intended to be an embedded database, as opposed to a client/server architecture like Postgres/Supabase? And as such, I'm confused why this exists.

It's very common to use SQLite within backends, whenever concurrency is not a big issue.

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

#123

I'm not sure I understand what exactly is. I like the tips, but I don't understand: is it an app that I can run on my local machine?

If you have ever built a web app backend that consists of a database, a REST API for that database, and a web admin interface to the database - well, this gives you all of that for free, just by running an executable.

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

#124

I'm not sure I understand what exactly is. I like the tips, but I don't understand: is it an app that I can run on my local machine?

If you have ever built a web app backend that consists of a database, a REST API for that database, and a web admin interface to the database - well, this gives you all of that for free, just by running an executable.

Ok so essentially an easy to host activeadmin (rails library). I think the single executable that runs on every os makes it very interesting for usecases where data is generated into a static site

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

#127
post #82
post #51

Earlier quoted context omitted.

Your initial comment presents Redbean as a comparable solution, which it's not; they serve very different use cases. Redbean requires you to write server code; Pocketbase does not. Redbean does not offer a realtime database, authentication, an admin dashboard, integrated file storage, or an inbuilt API. I like Redbean, but it's in a completely different "market sector". It's like comparing a kit car to a luxury car:…

They are comparable solutions to the problem "Open-source backend in one file". I don't care at all about "realtime database, authentication" and whatever, I care about what the title of the post says. For that purpose, Redbean is a nice alternative. > It's like comparing a kit car to a luxury car If all I need is a bicycle, a kit car is already over the top but will do. A luxury car makes no sense. You're thinking l…

Ah, I see - my apologies, I think there's an unfortunate misalignment over the word "backend."

When Pocketbase is talking about a backend, they're talking about something like Firebase, which is a complete backend-as-a-service that implements everything you need for a service where the majority of the logic is in the frontend; it's meant to involve as little backend engineering as possible.

You're referring to the more general, standard sense of the word "backend". I agree with the sibling comment that you're not necessarily wrong in offering Redbean as a point of comparison, but the target user of Pocketbase has limited overlap with the targeted user of Redbean; the people looking for a Firebase-like solution would not be served by Redbean, and your initial post could be read as suggesting that they could be.

I do think the use of the word "backend" here is unfortunate, because it's really referring to something much more specific than the conventional use of the term.

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

#128

It is the first time I see that "hook" pattern in a Go API backend: `hook.Hook` and `hook.TaggedHook`. Where does it come from? Why is it useful here? What are the alternatives? Advantages/Drawbacks? Is there an article somewhere, outside of the Pocketbase docs, presenting that pattern? - https://github.com/pocketbase/pocketbase/blob/master/core/ap... - https://github.com/pocketbase/pocketbase/tree/master/tools/h...

This just looks like the "Event Bus" [1] [2] [3] pattern, this is not the one from the React world if you were thinking about that. Hooks here are just the following, the "Hook" is just a collection of event handlers.

    type Handler[T any] func(e T) error

    type handlerPair[T any] struct {
        id      string
        handler Handler[T]
    }

    type Hook[T any] struct {
        mux      sync.RWMutex
        handlers []*handlerPair[T]
    }
It's very useful when you want to make an easily extensible library/framework/application, as you can see in pocketbase/core/app.go you can register handlers for various things that can happen.

[1]: https://en.wikipedia.org/wiki/Event-driven_programming

[2]: https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_patt...

[3]: https://en.wikipedia.org/wiki/Observer_pattern

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

#129
post #119

Earlier quoted context omitted.

But people build apps on top of it and deploy it to the cloud, too, right? Does it then compete with stuff like AWS RDS?

I think it's more like a self-hosted Firebase - you run it on a server (with a disk drive that can persist the data) to get a hosted API for your apps to talk to.

Hmm... kind of. It's pretty substantially different from Firebase which is defacto NoSQL versus Pocketbase which uses SQL.

Given that it's based on SQLite I'd be very interested to know how well this would work as a true backend for a multiuser site that allows users to interact/post/etc.

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

#130
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.

Wanted to say thanks for the comment because TIL redbean, which in turn led me to learn about Justine Tunney, who appears to be a super-human programmer based on what I've read so far. Lots of inspirational discoveries on HN this weekend for me—Thanks ya'll!
Post reply on HN