Building the Most Over-Engineered Personal Blog

4 months ago 8

So, I made myself a personal blog and called it OKBlog. Personal blogs are usually simple, right? Well... mine runs on seven microservices (and counting), each written in a different language, powered by three separate database systems, a message queue, and monitored obsessively. Overkill? Absolutely. That’s why it’s called OKBlog! OK as in Over Kill, not “okay.”

What's In It For You

If you want to learn about setting up multiple services that work together, OKBlog can be a good starting point. You can fork the repo and run it locally to test it out, then try deploying it in Kubernetes or (like me) in CapRover. It's a hands-on way to practice more complex deployments.

Or maybe you have a WordPress blog but wanting to write on something that you deploy by yourself. Well, the features are not as complete as Wordpress (albeit architecturally more complex), but you can still write on OKBlog. If you need a demo, well you are reading this on OKBlog.

Under The Hood

Let's talk about the tech. As mentioned earlier, OKBlog has seven microservices, and a myriad of components supporting them. The design can be seen in the following picture.

At the frontend, there are three components: API gateway using nginx, admin written in React.js, and public web written in Vue.js. The images are being served directly from a CDN which pulls them from an S3 bucket.

At the backend, there is the profile service written in Go and Go-Kit, which stores data in Postgres. The post service is using Java Spring Boot 3 and MySQL. There is Debezium which does CDC from the MySQL tables, and sends the changes to Kafka.

Another service is the search service which is written in Rust with Axum. It doesn't do a simple query to MySQL, instead it gets the data from Elasticsearch to support full text search and allow typos. Therefore, there's also another connector to send data from Kafka to ES.

There's also the tag service which again is not just a simple SQL query. It consumes messages from Kafka to store posts for each tag in Valkey using a sorted set with published date as the score. This ensures each tag is served fast without querying the DB every time.

The last one is the file service. Unlike previous ones, this one is written in Python with Flask. It connects to an S3 bucket.

Getting It Live

To deploy the services, we are using CI/CD. The code is tested and an image is built on GitHub Actions. If the test passes, it stores the image in Docker Hub. The security scanner runs on the image to find vulnerabilities. If it passes all of those, it automatically deploys the image to CapRover. As expected, the Rust code takes the longest to build, and the Python image is the largest.

For the logs, all services send their logs to Elasticsearch, which we can observe and visualize in Kibana. We also have New Relic which monitors resource usage and applications. They offer a generous free tier that opens up all the features and only limits 100GB data ingest monthly. It's a great way to familiarize yourself with all the knobs and buttons in NR. For traffic analytics, we use Umami instead of Google Analytics for better privacy.

AI as My Coding Buddy

This project is also an opportunity for me to try vibe coding using Cursor. It's amazing what AI can do these days since most of the code in this project was written by Claude. In my opinion, just like with other inventions in the software world, it won't replace humans but it will raise the standard. New apps and services that enrich human life will emerge. Hopefully, the number of newly created jobs will be higher than the number of replaced programmers.

Final Thoughts

Building OKBlog turned out to be one of those projects where embracing complexity actually kept me motivated to finish. Unlike my previous abandoned blog attempts, having multiple moving parts made it interesting enough to see through to the end. I already have fun ideas on what services to add! Would I recommend seven microservices for a personal blog? Only if you enjoy the chaos of distributed systems in your free time.

The code is available on GitHub if you want to fork it, modify it, or just gaze at the madness. Happy over-engineering!

Read Entire Article