Live data from Hacker News

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

github.com

11–20 of 113 posts

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

#11
post #8

Sweet. How tightly is this coupled to SQLite? I’d like to embed Dolt [0] instead, specifically for the Dolthub-backed collaboration model. [0] https://github.com/dolthub/dolt

Other than some json functions, PocketBase doesn't use too much SQLite specific features, but I don't plan adding support for other databases at the moment.

Please also note that PocketBase is designed to be deployed only on a single server, so it cannot scale horizontally out of the box. Supabase/Nhost are better suited for that.

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

#13

Earlier quoted context omitted.

Yes, I'm aware of this limitation, but PocketBase uses HTTP2 when combined with the --https flag (this is by go's default net/http implementation) so it shouldn't be too much of a concern.

First time I’ve heard about the 6 connection limit. I’m not fully understanding the response - are you saying that the limit is not imposed if you use https? Or am I reading wrong?

Go's default `net/http` package will serve HTTP2 when a https configuration is provided (also most web browsers don't support h2c, aka. HTTP2 without tls).

The default limit of ~100 connections should be more than enough for most applications (additionally, the JS SDK client maintains a single SSE connection for a page no matter to how many things the user has subscribed, so that also helps).

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

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

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

#16
Very nice, I thought it was a basic wrapper around SQLite but then realized it actually had more features then that, such as it's own admin dashboard. Then I realized you built multiple auth designs into the system, then I realized there was a javascript SDK to interact with it, then I found your beautiful documentation site, then I realized there is an actual product inspiring it's development (https://presentator.io/)

Each of these is another encouragement to use pocketbase. I went from "eh, I'll just keep my own wrapper" to "pocketbase has a lot of promise, I should try it"

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

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

That makes a lot of sense. Thanks for the link. I've not worked with Go before so I couldn't find exactly where the implementation was.

This looks like a very interesting project and great for some of the small client projects which I currently use Firebase. I'll be sure to take a proper look in the future!

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

#18
Wow, super impressed. I have always wanted to build something like this where everything is embedded in 1 single file and I knew Go could be a great way to do it but always wondered how to handle the database part. Along comes SQLlite.

One feedback which will probably deviate from everything in 1 file concept but adding an option to upload files to an S3 URL will be awesome. Perhaps a pull request ? I am thinking of use cases like document management using this and if I can have the actual files in S3 (or S3 compatible), that would be a huge plus.

EDIT: I spoke too soon. You already have an option for S3 as I tested the demo. Very cool.

How much work went into this btw ? The github, documentation everything is well done. I envy work like this :)

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

#19

Earlier quoted context omitted.

Yes, I'm aware of this limitation, but PocketBase uses HTTP2 when combined with the --https flag (this is by go's default net/http implementation) so it shouldn't be too much of a concern.

First time I’ve heard about the 6 connection limit. I’m not fully understanding the response - are you saying that the limit is not imposed if you use https? Or am I reading wrong?

HTTP/1.1 has a limit, set by each individual browser vendor, for the maximum number of connections between a client and a unique server domain. So, if you exceed 6 simultaneous connections to that server (across multiple tabs and windows), it will move the request to a stalled state (like a queue) until one request is completed.

Best solution today is to move to http2 on your server -- which has an SSL (TLS 1.2) requirement.

Looks like pocketbase implements this. If you use another server, like nginx, you have to enable this for each site.

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

#20

Wow, super impressed. I have always wanted to build something like this where everything is embedded in 1 single file and I knew Go could be a great way to do it but always wondered how to handle the database part. Along comes SQLlite. One feedback which will probably deviate from everything in 1 file concept but adding an option to upload files to an S3 URL will be awesome. Perhaps a pull request ? I am thinking of…

By default PocketBase uses the local filesystem, but you could also configure a S3 compatible storage (AWS, DigitalOcean, Vultr, etc.) from "Settings > Files Storage > Use S3 storage".

I've started working on the project ~ 3-4 months ago. The last 4 weeks I've taken a longer break from my day-to-day job so that I could finalize the first release.

Post reply on HN