My Tech Stack
Yeah, GPT couldn't draw the C++ icon with two
+
characters.
I don't know about you, but I like to KISS, a lot.
So here is my tech stack:
- C++
- Python
- Svelte
- SQLite3
- Podman
Let's go piece by piece
C++
I've learned basic C in uni, then fell in love with C++. It's my favorite language. You are really instructing the machine.
By using the right data structures and algorithms, you can go pretty damn fast. If you use wrong data structures and/or algos, you gonna be slow.
Modern C++23 has pretty nice features and a rich ecosystem.
When dealing with web servers, I choose the Simple Web Server↗ by Ole Christian Eidheim↗, it's a very simple, fast, multithreaded and platform independent HTTP web server, that uses boost asio.
It has a brother called Simple WebSocket Server↗, which by name you might guess it's for an WebSocket server. It's great!
Both have an very simple interface, are simple, and get you going in no time! In fact, I am using them both at Blocky↗, so it's fueling an crypto exchange.
I also choose the Nlohmann JSON↗ lib to work with JSON. Yeah, technically it is one of the slowest libs, there are other libs like Glaze↗ which are order of magnitudes faster. But Nlohmann JSON interface is great, it's simple and get's you going fast.
And for a database, what's simplier and faster than SQLite3? It works great with C++.
SQLite
It's one of the top 5 most deployed databases in the world if I am not mistaken?
In uni it was clear that the old guard of professors had a particular preference in Oracle Database (and Oracle products in general).
We learned Mysql and PostgreSQL. I did used PostgreSQL for a while.
I remember years ago when I was attempting to stress-test inserts and PostgreSQL was struggling. I then tried SQLite3 and immediatelly saw nice results. By configuring SQLite3 you can get crazy performance, sspecially using NVMe M.2 SSDs and optimized filesystems.
You can have one writer and multilple readers (in different process). And if you got tons of tables, you might even split up those tables in different database files to speed writes, while using DATABASE ATTACH
to perform queries on readers.
Anyway, it's pretty simple, fast, reliable and it gets the job done.
There is one SQLite3 evangelist that I've saw that launched a website called High Performance SQLite↗. He also runs a podcast if I am not mistaken. Unfortanely, I can't afford the course, but it seems pretty well made and the free content is awesome.
Python
Getting into Python after learning C++ was easy. The best part of it, compared to C++, is that it is fast (in getting things done, not actual speed).
The ecosystem is also great, so it works perfectly for gluing things together.
Also, by using pypy
with asyncio
and tons of asynchonous libs like aiosqlite
, aiohttp
etc, it's possible to go fast with it.
An awesome framework I am using is Socketify.dev, made by a brazilian! It is a high-performance HTTP and WebSocket server.
I want to thanks Ciros Paciari that helped me on all my questions and issues I've encountered while using it.
Svelte
When I was building the World's First Minecraft Commodity Exchange, which would become Blocky afterwards, I needed to create the frontend after getting the backend done.
I then started messing around with some frameworks, but nothing really seemed to make a lot of sense. I don't recall exactly how but I've stumbled across Svelte 4, played around and dude, it just works!
So easy to use, and it makes sense! Then I started looking around for some UI and found out about shadcn-ui and the Svelte counterpart shadcn-svelte. Beautiful minimalist and easy to use components.
Podman
Podman is rootless and doesn't require a running daemon. By using Podman-Compose you can run docker-compose.yaml
files just as nicely as docker-compose
.
In theory, it's safer and more isolated.
Putting it all together
C++ and Python for the backend. Python usually will connect to Logto and other components, while exposing an public API and passing calls to C++ if needed via HTML or WebSocket message. The Svelte 5 frontend is compiled into static files and served by a caddy-alpine server. So the frontend connects to the backend API (no server side rendering).
SQLite3 is used as the primary database whenever it is needed.
Podman creates all containers.
I think that's pretty simple.
I also want to mess around with htmx and franken-ui sometime...