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"
PocketBase is a small open source project that I've been working for the last couple of months.
You could think of PocketBase as a lightweight Firebase/Supabase alternative. In short, it is an open source Go backend (framework and app) consisting of: - embedded database (SQLite) with realtime subscriptions\ - backed-in files and users management - convenient Admin dashboard UI - simple REST-ish API And all of this compiles to a single portable binary. It's still a little rough around the edges, but you could give it a try and share your feedback.
You could read more at https://github.com/presentator/presentator/issues/183, but to summarize - I wanted something that could be self hosted with almost no additional setup and no dependency on 3rd party services.
Does it render pages automatically based on Schema? I see your really simple example under examples, and its so minimal I want to think you just get all the tables and render views from that. Am I crazy? If so this is really neat. Did you ever consider using something like GORM? Because I could see this working with other databases and being extremely useful. I use Django to build really quick CRUD interfaces, but sometimes I need to be able to customize it more, and the admin UI is not as extensible as I would normally want, they even suggest you just build custom pages if its not doing what you need, which is a bummer because Django Admin covers the majority of my use cases.
The admin UI just shows the collections through the web api (https://pocketbase.io/docs/api-collections/). I actually started with GORM, but its too complex and I ended up replacing it with a simpler query builder package (ozzo-dbx). While the query builder has abstraction for other databases, I'm not planning supporting them at the moment.
No worries, I've seen another project called UAdmin that kind of reminds me of this, my problem with UAdmin was that there were bugs and I didn't quite get why it worked how it worked, but having used Django since I realized what I was missing out on.
Thank you for following up, I did see you had a package for extending the built-in Go package for SQL.
i have no idea what you mean by a "backend". If it's got a "admin dashboard" it's got a UI which means it's got a front-end which means it's not a backend. I'm assuming "go backend" isn't specific to go but just indicating that it's written in go. it's got a example code block but doesn't explain the point of it. Why would an existing framework with a UI and everything need me to write a `main` method? Why doesn't it have one already? If it doesn't have one why doesn't it. If it does have one why am i not using it? My thinking here is that there are many existing patterns for registering plugins / extended functionality that don't require altering the main method of the thing you're hooking into. Why aren't you using that? Is this maybe intended to be like... a starter template for a Sinatra like thing with a pre-defined set of functionalty? Kind-of like how Django sets up model administration UIs for you? re your summary here and the site: i have no idea what "backed-in files" means and I've been doing web-dev for decades. "convenient Admin dashboard UI" ... to admin / do what? "simple REST-ish API" a) why "ish" and not actually REST b) ... that let's me do what? ---
in summary.... this looks useful but i don't get what you're actually offering or what it's intended usage scenario is. This is compounded by the fact that you're using a very atypical definition of one word "backend" and a very uncommon term "backed-in files"
It's a lightweight replacement for Firebase. I
That's why it is described as a backend, because it's primary feature is to act as a data store. If don't understand what a project does, and you're unfamiliar with the comparisons given (Firebase, Supabase), the right thing to do would bw to look up the comparisons.
I know you have user management, a database, and do something with files. As noted before the "backed-in files" isn't a commonly used phrase so i'm left with 2 pieces of meaningful info, neither of which is particularly notable because every multi-user app has both of those.
Firebase gives me a list of use cases https://firebase.google.com/use-cases and documentation whose left nav gives me a good insight into the high-level functionality it provides "authentication, storage, hosting, security rules, extensions, machine learning, etc" I think it's safe to assume you don't provide all of those, but i don't know what subset you DO provide. As a result, if i give you the benefit of the doubt, telling me it's a "replacement for firebase" is not meaningful because i don't know what parts it can replace unless it's just the few listed in which case it's absolutely _not_ a replacement.
> 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.
Did you intend to say baked-in? Like it's built-in? If so, I feel it's better to just use "built-in" because it's more familiar. The same typo's in the site too and confused me a bit.
I'm doing something along these lines in Go with Postgres, but I'm definitely not as productive as you. What do you think about Echo? Was it your first choice as a web framework? How in your opinion is better than Gin for example? Out of curiosity, how much time did you spend building the admin dashboard? Did you have previous experience with Svelte?
One thing I noticed is you are using server sent events for subscriptions. SSE have a lot of nice properties but do have one nasty limitation (from https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...): "Warning: When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). The issue has been marked as "Won't fix" in Chrome and Firefox. This limit is per browser + domain, which means that you can open 6 SSE connections across all of the tabs to www.example1.com and another 6 SSE connections to www.example2.com (per Stackoverflow). When using HTTP/2, the maximum number of simultaneous HTTP streams is negotiated between the server and the client (defaults to 100)." This can lead to some weird bug reports from users.
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.
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).
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.
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 :)
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.
My intent was not to point out a „silly question“. I was legitimately interested if there is a reasoning and what a use case for that would be.
Thank you for responding nicely!
Comments (111) 36 threads
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"
You could think of PocketBase as a lightweight Firebase/Supabase alternative.
In short, it is an open source Go backend (framework and app) consisting of:
- embedded database (SQLite) with realtime subscriptions\
- backed-in files and users management
- convenient Admin dashboard UI
- simple REST-ish API
And all of this compiles to a single portable binary.
It's still a little rough around the edges, but you could give it a try and share your feedback.
It looks like you put a lot of work into this, what was the motivation behind this project? Did you not like the existing solutions available?
You could read more at https://github.com/presentator/presentator/issues/183, but to summarize - I wanted something that could be self hosted with almost no additional setup and no dependency on 3rd party services.
Does it render pages automatically based on Schema? I see your really simple example under examples, and its so minimal I want to think you just get all the tables and render views from that. Am I crazy? If so this is really neat.
Did you ever consider using something like GORM? Because I could see this working with other databases and being extremely useful. I use Django to build really quick CRUD interfaces, but sometimes I need to be able to customize it more, and the admin UI is not as extensible as I would normally want, they even suggest you just build custom pages if its not doing what you need, which is a bummer because Django Admin covers the majority of my use cases.
The admin UI just shows the collections through the web api (https://pocketbase.io/docs/api-collections/).
I actually started with GORM, but its too complex and I ended up replacing it with a simpler query builder package (ozzo-dbx). While the query builder has abstraction for other databases, I'm not planning supporting them at the moment.
Thank you for following up, I did see you had a package for extending the built-in Go package for SQL.
i have no idea what you mean by a "backend". If it's got a "admin dashboard" it's got a UI which means it's got a front-end which means it's not a backend. I'm assuming "go backend" isn't specific to go but just indicating that it's written in go.
it's got a example code block but doesn't explain the point of it. Why would an existing framework with a UI and everything need me to write a `main` method? Why doesn't it have one already? If it doesn't have one why doesn't it. If it does have one why am i not using it? My thinking here is that there are many existing patterns for registering plugins / extended functionality that don't require altering the main method of the thing you're hooking into. Why aren't you using that? Is this maybe intended to be like... a starter template for a Sinatra like thing with a pre-defined set of functionalty? Kind-of like how Django sets up model administration UIs for you?
re your summary here and the site:
i have no idea what "backed-in files" means and I've been doing web-dev for decades.
"convenient Admin dashboard UI" ... to admin / do what?
"simple REST-ish API" a) why "ish" and not actually REST b) ... that let's me do what?
--- in summary.... this looks useful but i don't get what you're actually offering or what it's intended usage scenario is. This is compounded by the fact that you're using a very atypical definition of one word "backend" and a very uncommon term "backed-in files"
Firebase gives me a list of use cases https://firebase.google.com/use-cases and documentation whose left nav gives me a good insight into the high-level functionality it provides "authentication, storage, hosting, security rules, extensions, machine learning, etc"
I think it's safe to assume you don't provide all of those, but i don't know what subset you DO provide. As a result, if i give you the benefit of the doubt, telling me it's a "replacement for firebase" is not meaningful because i don't know what parts it can replace unless it's just the few listed in which case it's absolutely _not_ a replacement.
Continue this thread — 7 replies
> 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.
> 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.
Continue this thread — 2 replies
Did you intend to say baked-in? Like it's built-in? If so, I feel it's better to just use "built-in" because it's more familiar. The same typo's in the site too and confused me a bit.
I'm doing something along these lines in Go with Postgres, but I'm definitely not as productive as you.
What do you think about Echo? Was it your first choice as a web framework? How in your opinion is better than Gin for example?
Out of curiosity, how much time did you spend building the admin dashboard? Did you have previous experience with Svelte?
One thing I noticed is you are using server sent events for subscriptions. SSE have a lot of nice properties but do have one nasty limitation (from https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...):
"Warning: When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). The issue has been marked as "Won't fix" in Chrome and Firefox. This limit is per browser + domain, which means that you can open 6 SSE connections across all of the tabs to www.example1.com and another 6 SSE connections to www.example2.com (per Stackoverflow). When using HTTP/2, the maximum number of simultaneous HTTP streams is negotiated between the server and the client (defaults to 100)."
This can lead to some weird bug reports from users.
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?
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).
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.
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 :)
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.
All comments shown.
Couldn't load more comments. Check your connection and try again.