So I started using SQLite as a database for my side project, and I want to share my experience so far:
1. It is fast. Like really fast. My architecture is a monolith written in Go (this is intentional, I sacrificed scalability to improve my shipping speed), and this is where
how I squeeze 60K RPS out of SQLite on a $5 VPS:
There are tons of tutorials on how to setup SQLite, and sometimes they contradict each other. Here is what worked for me.
1. Configuring PRAGMAs. We need to send the following PRAGMA commands right after opening the connection:
@siyabuilt
It is really not. I'm thinking about writing a post, shall I do that?
I would cover:
1. securing ssh
2. setting up a firewall
3. configuring unattended upgrades
4. VPN access with tailscale
5. dashboards
6. GH actions for deploying to VPS
7. zero-downtime deploy via systemd
We all heard those stories. Netlify billed someone $104k for a static website. Cara got $96,280 bill from Vercel after going viral.
You want to be an indie-hacker, not an indie-bankrupt.
What if I tell you that a $5 VPS can serve 5K RPS? Here is how you can set it up yourself:
Important note: if you use synchronous = NORMAL with WAL your database won't be corrupted, but during a power loss the latest transactions could be rolled back.
To fix that use synchronous = FULL, you will lose around 30% in write performance, but sqlite will sync the WAL after
@StephanGarland
I’m not saying I completely avoid joins, sometimes it’s just way too tempting to filter in the application and then query one more time. It’s good to have flexibility knowing that n+1 is not going to slow you down that much.
I've released a stable (means it won't corrupt your data if you mount a single volume concurrently) version of the Block device layer for
@FoundationDB
!
With it you can magically add replication to a legacy application that doesn't support it.
A month ago I started writing an interpreter from the using Rust (with zero prior Rust and interpreters knowledge), and today it became Turing-complete. Wow! What a journey! Thank you
@thorstenball
for writing this amazing book!
How I create UI for my side-projects with (almost) no JavaScript.
As a backend dev, I've never worked with modern Single Page Application (SPA) frameworks. They all seem to be way too complex for what I want. I don't want offline functionality. I don't want to have separate
@daniele_dll
True, there is no replication, but streaming backups with 1s lag are fine for a lot of cases. In the worst case I will just refund my customer.
@AshConnell
I use systemd socket activation to buffer incoming connections while my service is restarted. Also graceful shutdown to finish with the existing requests.
@AhmedRouizi
Not a particular framework, just a bunch of Go libraries stitched together. For http routing I use echo, and templ for server side templating. Frontend is done with htmx, tailwind and alpinejs.
From a report by Nikita Melkozyorov
@meln1k
(
@MOIAmobility
) we learned why the akka-persistence-cassandra plugin is not perfect and what to do about it.
#ScalaConf2019
@rando_137
@StephanGarland
Very true, but chances are this will never happen and I move on to the next project. However, this is a nice problem to have in the first place.
@Blue0lemming
I think the main difference compared to a "traditional" db is that you can't talk to sqlite over the network. You need to have a direct access to the database file. That means you deployment is expected to fit on a single server. If this is not possible in your scenario, then
@aguynamedben
Just go plus a bunch of libraries that I find useful. I like echo as an http router because of the amount of features available. I also use templ, htmx and alpinejs when it comes to UI.
@untalpablodz
I did some tests, and I have to say it works just fine. But I do the following: I keep two connections open: one for reads and one for writes. Then I set go's connection limit on the „write“ connection to 1, and keep the read limit as high as it gets. By doing this I offload
New blog post: Image Classification from scratch without a PhD.
If machine learning still seems like magic to you, then after you read this post, the problem of image classification will be completely demystified.
@Akshat_Giri
I prefer to keep things simple. I use GH actions that rsync the compiled binary to my VPS, and then systemd unit takes care of the restart process.
You don't need netlify/vercel/railway/render/fly/heroku to automatically deploy when you push to main.
All you need is:
1. a github action that builds your code and sends the artefacts to your VPS via rsync,
2. docker/systemd that restarts the application on update.
ShipFast backend edition: Go monolith + SQLite + HTMX + Alpine + tailwind. Minimal complexity and friction.
Feels like the good old PHP days are back and launching in a weekend is possible again.
@pilotbob
There are many options, depending on what your architecture is and how much time you’re willing to spend on that. Random ideas from my head: shard by users, replicate the WAL to make read replicas, use mvsqlite, completely drop SQLite and use something like foundationdb and do a
storing json blobs in a database and de-serializing them with Go feels so good. every time I change the structure, nothing explodes in my face and then a default-initialized struct is returned. 10/10, period.
Claude enables ultra-fast MVP development for more languages.
Previously this was a niche occupied by Django, Rails, and Laravel because they have a nice CLI for generating CRUDs.
In 2024 you can promt a complete SaaS in Go and HTMX in almost no time. What a time to be alive.
Here's a sneak peek at what I've been working on lately - a service that creates promotional packets for software engineers to increase their visibility and chances of getting promoted.
@NickLaptev
Well, a fridge won’t suddenly change the monthly price, make a feature you rely on paid, or charge you 500 more for the electricity it consumes. The egress traffic costs of many serverless vendors are just ridiculously high, so you could get a hefty bill even on a moderate
It was a mistake to start reading on German legal entity structures, taxes, and law compliance. The whole day is gone, and no product improvements has been made :(
Devs, want a promotion? 🚀
I'm building a service to help you showcase your impact and achievements. With AI assistance, we'll create a polished promotional package for your next 1:1 with your manager.
Link in replies. 👇
Comment for free credits at launch!
TIL: there is a thing called systemd socket activation, and it can buffer incoming connections while you're restarting your systemd unit. Zero-downtime deploys, yay!
writing documents for performance reviews was pretty tedious for me in the past, so I decided to change that.
dev folks, does it resonate with anything from your experience?
cc
@_buildspace
@_nightsweekends
just coded a persistent LLM prompt queue with rate limiting and load balancing across several inference providers. took 2 hours and 250 lines of code in total.
monoliths in Go give you hyper-productivity.
I reached the peak of server side templating today. I had go structs, arrays, html templates with HTMX and Alpine.js all in one .templ file. All type-checked. Locality of Behavior FTW!
I think that
@github
should have 2 different buttons for approving pull requests:
• One for "I don't see anything bad in this PR"
• Another for "I confirm that this PR is correct"
Although those statements might sound the same, there is a big difference between them.
@LotusHints
Pretty much the same. Works fine for a monolith! For something more complex you would need an online schema migration, e.g. read from the old and a new table while migrating the data in the background.
It seems like I’m going to ditch Llama 3 and go full anthropic. I really wanted llama 3 to work, but no matter how I changed the prompt, I couldn’t get the writing style feel right. It always looked fake and AI-generated. Not the case with sonnet 3.5 though.
I prepared 5 headlines for the landing page. Showed them to 10 friends, and next day deleted the messages. Asked my friends which one do they still remember. Almost everyone gave the same answer. Super cool trick by
@marc_louvion
How to accelerate turnover in your org:
1. Hire people from abroad and pay them a bare minimum above the visa requirements.
2. Wait until they realize that they have been treated unfairly cos the market salaries are 50% higher.
3. Tell them that "our max pay raise is 10% a year"
One of the best RoI skills to have as an indie-hacker might just be learning the basics of Linux admin.
Linux existed 30 years ago, available now, and will exist in 50 years, unlike the VC funded serverless offerings.
Bonus: you won't get a $100k invoice after a DDoS attack.
Is there a good UX/design book for a fellow backend engineer?
I can easily design and deploy distributed systems to k8s, but my UIs look like... made by an engineer and I don't know why.
Any hints highly appreciated!
@jonny555333
@siyabuilt
I don’t deny that Vercel has better UX. But VPS gives you ownership and independence. You will only need 20-30 minutes to complete the list above, and you do it once during the server setup.
Also, if you write it as an Ansible playbook, you can spin up a new VPS in seconds.
It’s not “if you build, they will come”, but “if you share valuable stuff, they might want to know your better, start trusting you, notice your product, and if they’re in the market they might even buy it“.