Automating Redis cluster setup

Introduction

This post serves as a companion to my repository, which provides an automated setup script for deploying a Redis cluster. Designed to streamline the process of configuring a clustered environment, the script enables users to quickly establish a functional Redis cluster with minimal manual intervention. In this guide, I’ll explain the purpose behind this project, detail the testing process for various configurations, and highlight key Redis capabilities uncovered during development. Additionally, I’ll clarify the differences between standalone and clustered Redis to provide context for when clustering is advantageous.

read more →

Judgement in software development

Judgment in software development is clutch—it’s what separates the code monkeys from the architects. (Grok)

Role of judgement in software development

In software development, judgment is about anticipating more than just today’s requirements—it’s about preparing for tomorrow’s unpredictability. You’re coding not only for current specifications but also for future challenges: will the system scale under load, will it fail unexpectedly, or will it create problems later? This foresight requires balancing intuition with analysis, much like strategizing in a game where the next move isn’t fully visible. Development involves a constant tension between order—such as clean code and design patterns—and chaos, driven by deadlines, bugs, and changing requirements. Judgment provides the balance, guiding you to enforce structure when it’s needed and to tolerate imperfection when time or resources demand it, adapting to uncertainty rather than resisting it.

read more →

Notes from Docker Up & Running

Docker Up & Running

Recently I was taking a deep dive into the workings of Docker with the help of Docker: Up & Running. These notes list useful commands and info for later use, covering ways to handle, check, and tune containers and images.

Monitoring and Stats

docker stats <container-name>

This one shows a live feed of resource usage stats for running containers, like CPU percentage, memory use, and network I/O. It acts as a real-time performance checker in the terminal, highlighting resource demands or spikes—handy for keeping an eye on container health without extra tools. The output refreshes constantly to track trends, and pairing it with glances gives a broader view of system and Docker stats together.

read more →

Coding challenge – HTML web server in PHP

I wanted to learn a bit more about concurrency and network programming, so I built two TCP socket servers in PHP as a coding challenge. It’s a practical way to practice and get a grip on managing multiple connections at once. I’m not going for anything complex—just experimenting and picking up the basics step by step. The code can be found in my repository: github.com/lzag/webserver

I found it quite useful to go through the Beej’s guide to network programming to understand the inner workings of sockets programming and have a better idea of how the PHP wrappers work underneath. I added comments in the code linking to relevant sections of the guide. Another helpful resource is Mastering Swoole PHP, which explains concurrency concepts and includes some network programming examples.

read more →

Notes from Grokking Concurrency

Introduction

I wrote this summary of Grokking Concurrency to take notes and help me remember the main ideas about parallel programming. The book covers things like multitasking and synchronization with examples and explanations that I want to understand better. It’s a way for me to keep track of what I’m learning so I can use it later.

Sequential Programming: Pros and Cons

Sequential programming refers to executing tasks one after another in a single-threaded, linear fashion.

read more →

Setting up MySQL replication with Docker

Introduction

Setting up MySQL replication is a powerful way to enhance the reliability, scalability, and performance of your database system. In simple terms, MySQL replication is a process where data from one MySQL database server (known as the primary or master) is automatically copied to one or more additional servers (called replicas or slaves). This creates a live backup of your data, ensuring that if the primary server fails, a replica can step in with minimal downtime. Beyond redundancy, replication also allows you to distribute read-heavy workloads across multiple servers, improving efficiency and speed for applications that rely on quick data access.

read more →

Thoughts on software architecture and decision-making

Recently, I read the book Software Architecture and Decision-Making by Srinath Perera. It contains a lot of content that is available in other software architecture books but offers some unique angles on certain topics.

I think the author is right to point out that you need to design deeply things that are hard to change, especially database schemas. For businesses, data is gold, and making changes to it comes with enormous risks. Therefore, changes are very rare and done only when absolutely necessary. The same applies to customer-facing APIs (or even internal APIs). These are usually contracts that other parts of the system adhere to, so changes to them come at a big cost. Facebook was famous for following the adage “move fast and break things,” but after they annoyed developers with constantly breaking APIs, they changed their attitude to “Move fast with stable infrastructure.”

read more →

hello world

New site, new stack. Ditched WordPress for Hugo + Cloudflare Pages.

Posts are Markdown files, resume is built from LaTeX, everything is in git. No database, no PHP, no plugin updates at 2am.

read more →

Removing bloatware from Android phones

Most Android phones come with many preinstalled apps that you might not ever use, but they do take up valuable space and clutter the interface. If you try to uninstall them the way you would any other apps you will find that it’s not possible. So is there a way to get rid of them?

It’s actually not too complicted to uninstall them using the right tool which are available for every major operating system.

read more →

Overview of PHP code quality tools

General

Below tools provide a comprehensive set of rules and analyse the code from different angles.

PHPStan

PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

read more →