litestream
pocketbase
Our great sponsors
litestream | pocketbase | |
---|---|---|
164 | 174 | |
9,700 | 32,348 | |
- | 4.5% | |
7.5 | 9.7 | |
6 days ago | 7 days ago | |
Go | Go | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
litestream
-
How (and why) to run SQLite in production
This presentation is focused on the use-case of vertically scaling a single server and driving everything through that app server, which is running SQLite embedded within your application process.
This is the sweet-spot for SQLite applications, but there have been explorations and advances to running SQLite across a network of app servers. LiteFS (https://fly.io/docs/litefs/), the sibling to Litestream for backups (https://litestream.io), is aimed at precisely this use-case. Similarly, Turso (https://turso.tech) is a new-ish managed database company for running SQLite in a more traditional client-server distribution.
-
SQLite3 Replication: A Wizard's Guide🧙🏽
This post intends to help you setup replication for SQLite using Litestream.
wget https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb sudo dpkg -i litestream-v0.3.13-linux-amd64.deb
-
Pocketbase: Open-source back end in 1 file
Litestream is a library that allows you to easily create backups. You can probably just do analytic queries on the backup data and reduce load on your server.
- Litestream – Disaster recovery and continuous replication for SQLite
-
Why you should probably be using SQLite
One possible strategy is to have one directory/file per customer which is one SQLite file. But then as the user logs in, you have to look up first what database they should be connected to.
OR somehow derive it from the user ID/username. Keeping all the customer databases in a single directory/disk and then constantly "lite streaming" to S3.
Because each user is isolated, they'll be writing to their own database. But migrations would be a pain. They will have to be rolled out to each database separately.
One upside is, you can give users the ability to take their data with them, any time. It is just a single file.
-
Monitor your Websites and Apps using Uptime Kuma
# Builder image FROM docker.io/alpine as BUILDER RUN apk add --no-cache curl jq tar RUN export LITESTREAM_VERSION=$(curl --silent https://api.github.com/repos/benbjohnson/litestream/releases/latest | jq -r .tag_name) && curl -L https://github.com/benbjohnson/litestream/releases/download/${LITESTREAM_VERSION}/litestream-${LITESTREAM_VERSION}-linux-amd64.tar.gz -o litestream.tar.gz && tar xzvf litestream.tar.gz # Main image FROM docker.io/louislam/uptime-kuma as KUMA ARG UPTIME_KUMA_PORT=3001 WORKDIR /app RUN mkdir -p /app/data COPY --from=BUILDER /litestream /usr/local/bin/litestream COPY litestream.yml /etc/litestream.yml COPY run.sh /usr/local/bin/run.sh EXPOSE ${UPTIME_KUMA_PORT} CMD [ "/usr/local/bin/run.sh" ]
Upstream Kuma uses a local SQLite database to store account data, configuration for services to monitor, notification settings, and more. To make sure that our data is available across redeploys, we will bundle Uptime Kuma with Litestream, a project that implements streaming replication for SQLite databases to a remote object storage provider. Effectively, this allows us to treat the local SQLite database as if it were securely stored in a remote database.
-
Backup Grafana SQLite with Litestream using s6-overlay in a container app
FROM docker.io/grafana/grafana-oss:9.5.12-ubuntu # Set USER to root escalating priviliges to perform installation of litestream and s6-overlay USER root RUN apt-get -qq update && \ apt-get -qq install -y xz-utils \ && rm -rf /var/libs/apt/lists/* # https://github.com/benbjohnson/litestream-s6-example/blob/main/Dockerfile # Download the static build of Litestream directly into the path & make it executable. ADD https://github.com/benbjohnson/litestream/releases/download/v0.3.11/litestream-v0.3.11-linux-amd64.tar.gz /tmp/litestream.tar.gz RUN tar -C / -xvzf /tmp/litestream.tar.gz ARG S6_OVERLAY_VERSION="3.1.5.0" # Download the s6-overlay for process supervision. ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz # Copy s6 init & service definitions. COPY etc/s6-overlay /etc/s6-overlay # Copy Litestream configuration file. COPY etc/litestream.yml /etc/litestream.yml # The kill grace time is set to zero because our app handles shutdown through SIGTERM. ENV S6_KILL_GRACETIME=0 # Sync disks is enabled so that data is properly flushed. ENV S6_SYNC_DISKS=1 # Reset USER to 472 to reset the escalated privileges USER 472 # # Run the s6 init process on entry. ENTRYPOINT [ "/init" ]
Litestream is a game changer allowing to backup all your changes to a an s3 compatible cloud storage at 1sec intervals using the WAL all done via the API and not interacting with the DB itself to avoid corruption or impacting performance.
pocketbase
-
Soul: A SQLite REST and Realtime Server
Hi, PocketBase author here.
Keep in mind that PocketBase do a lot more than just executing a raw DB query. We perform data validation, normalization, serialization, enriching, auto fail-retry to handle additional SQLITE_BUSY errors, etc. All of this comes with some cost and will always have an effect when doing microbenchmarks like this.
The performance would also depend on what version of PocketBase did you try, whether you used CGO or the pure Go driver, etc.
For a benchmark closer to a "real world" scenarios tested on various servers you can check the results from https://github.com/pocketbase/benchmarks.
There is definitely room for improvements (I haven't done any detailed profiling yet) but the current performance is "good enough" for the purposes the applications PocketBase is intended for (I've shared some numbers regarding a PocketBase app on production in https://github.com/pocketbase/pocketbase/discussions/4254).
Hope the above helps.
I wonder if it is inspired by [1], looks very similar including the "realtime" blurb.
--
-
Deploying Pocketbase with Docker, Nginx and SSL
What is Pocketbase? Pocketbase is an open-source backend solution offering a real-time database, file storage, and seamless user authentication with OAuth integration, all readily available right out of the box.
-
Ask HN: What two software products should have a kid?
Browsing HN, GitHub and the like we get to see a huge variety of software products and code bases.
I often see products and think - if this product X, got together with Y, it would be pretty cool - kind of like if they had a kid together.
Not too literally, but more on the conceptual level - my level of programming is low.
E.g. Just some....
- pocketable.io & datasette (+with some more charting) [https://pocketbase.io, https://datasette.io]
-
Ask HN: What development tools are you using for your current project?
I'm working on a personal project and found myself looking for an alternative to Postman/Insomnia this morning. This made me realize i've been using the same tools for so long for work (mobile development, finance) that this project may be a good time to try out some new things.
Here are a few tools that i've been using lately that I really enjoy:
https://pocketbase.io/ - A dead-simple self-hosted firebase/supabase-like "backend in a box" using golang and sqlite. So far i've been really impressed. I've gone the route of extending the base offering with more go code and am really enjoying the experience.
https://excalidraw.com/ - An open source whiteboarding tool. Slick to use and after learning some keybinds I've gotten pretty fast at throwing together diagrams to explain things to people on my team. The killer piece though is that the filetype is just json, so I can source control my diagrams. Even better, their "export to png" function has a box to embed the json data _into_ the png, allowing me to slap the diagram in places that only accept images (think confluence) and still be able to change the diagram later if needed. 10/10.
https://docs.gitlab.com/ee/ci/ - Gitlab's CI/CD toolset is really impressive, and I've gotten really intimate with it's deeper features over the past year. I'd be curious though to hear from someone who's familiar with it vs it's competitors.
- FLaNK Weekly 08 Jan 2024
-
Pocketbase: Open-source back end in 1 file
Is there an article somewhere, outside of the Pocketbase docs, presenting that pattern?
- https://github.com/pocketbase/pocketbase/blob/master/core/ap...
-
Show HN: Build your startup or side project faster with these SaaS templates
Really hard to find projects related Go and HTMX but I found pocketbase it is based on Go. Interesting and seems promising - https://pocketbase.io/ based on sqllite but great for simple SaaS products
What are some alternatives?
supabase - The open source Firebase alternative.
Appwrite - Build like a team of hundreds_
surrealdb - A scalable, distributed, collaborative, document-graph database, for the realtime web
Strapi - 🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.
rqlite - The lightweight, distributed relational database built on SQLite.
thin-backend - 🔥 Thin Backend is a Blazing Fast, Universal Web App Backend for Making Realtime Single Page Apps
htmx - </> htmx - high power tools for HTML
realtime - Broadcast, Presence, and Postgres Changes via WebSockets
k8s-mediaserver-operator - Repository for k8s Mediaserver Operator project
Hasura - Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
sqlcipher - SQLCipher is a standalone fork of SQLite that adds 256 bit AES encryption of database files and other security features.
Socket.io - Realtime application framework (Node.JS server)