Intro to Pocketbase, What and Why

Intro to Pocketbase, What and Why

Pocketbase and it's place on the baas hierarchy

·

3 min read

pocketbase exists in the Backend-as-a-service world that's mostly dominated by two camps

- Proprietary (firebase, amplify...)

ProsCons
easily scalableNo official mechanism to prevent runaway scaling in case of a bug or DDoS
SDKs and cloud functionslimited by the features/languages they support, custom logic also depends on the exposed APIs the serverless function is allowed to tap into
Easy to use highly scalable NoSQL databases part of the packageNoSQL has its limits in terms of data modelling but even worse most of these solutions don't have self-hosting options
Fully managed services with generous free tiersVendor lock-in since you can't just dockerize it and self-host it

- Open source(superbase,pocketbase,Appwrite,..)

this class of Bass is open-source, meaning you can download the code and self-host it if you want to. lets look at some of the differences between firebase , Supabase Pocketbase

featureFirebaseSupabasePocketbase
DatabaseFirestore (NoSQL)Postgres (SQL)Sqlite
authenticationyesyesyes
storageyes cloud storageyes Supabase storageyes(hard drive where it's hosted or S# compatible storage )
Functionscloud functions JS/TS and GOsupabase functions JS/TSextend the pocketbase GO package and use it as a framework
hostingstatic site hosting + fully managed firebasefully managed + self-hosting capabiltyself-hosting only , + static files to pb_public
SDKsweb JS/TS , android , apple , unity, Flutterweb JS/TS , Pythonweb JS/Ts , flutter + unofficial python , go , c#

so as fireship described it, pocketbase is a stripped-down version of supabase which is also a smaller open-source version of Firebase

Why I'd pocketbase over supabase

  • better dashboard

  • easier to use with just the REST without the javascript client

  • extending the pocketbase backend with the exposed hooks is better and more cost effective than writing cloud functions , the customizations that can be done are only limited by your creativity and needs

  • easier to self-host , supabase is marketed as self-hostable , but the process involves changing multiple open-source pieces together thatis anything but easy , not mentioning that it doesn't come with a dashboardif you choose to self-host , pocketbase backend + database + dashboard are all in one executable which can be hosted on any machine / Linux VM

    from the pocketbase FAQ

    2.Does it scale?

    Only on a single server, aka. vertical. Most of the time, you may not need the complexity of managing a fleet of machines and services just to run your backend.
    PocketBase is a great choice for small and midsize applications - SaaS, mobile api backend, intranet, etc.
    Even without optimizations, PocketBase can easily serve 10 000+ concurrent and persistent realtime connections on a cheap $6 VPS (Hetzner 2vCPU, 4GB RAM).

    all in all , it's a great tool for small to medium projects which you can setup and get a cheap vps to host it on with n worry that an overnight influx of users will leave you with a massive bill