Notes

I write on tech-related topics, mostly about programming and software architecture. I try to keep it short; it's easier to read, it's easier to write.

Items followed by a glowing star ("🌟") are the most popular articles.

You can subscribe to the RSS feed: here is the link.

Last published

Zstd is Impressive: A Real-World Example

Zstd is faster and more efficient than Gzip in a medium text-based log file scenario. Zstd is well balanced in comparison with high-efficiency algorithms such as Brotli and Xz.

What I like about Go

I was asked what I like about the Go language, and I realized I hadn't really given much thought to that. After some thought, I decided to write it down.

TIL: Go's CompareAndSwap is not always Compare-and-swap

Go's CompareAndSwapT functions compile to the CPU-level CAS instruction. But, what about architectures that do not provide such built-in instructions, like some Arm64 versions and RISC-V?

Selecting a Random Object in S3 (and in SQL, and others)

By using UUIDv4 identifiers as names or hash hex digests, there is a nice trick to efficiently select a random item as long as the database support querying with a range condition (S3, SQL, DynamoDB, etc.)

Implementing a Lock-Free Snowflake ID Generator

Lock-free programming is hard to get it right, and modern mutexes (futexes) are generally fast when contention is expected to be low. However, I did this interesting exercise to learn more on lock-free techniques.

Using the Ninja build system to generate this site

This static website is generated with a Python script that produces a build.ninja file which is then processed by the Ninja build system to generate the final HTML files.

Maybe We Don't Need UUIDv7 After All

In the last weeks, the topic of interest seemed to be UUIDv7 identifiers and how they solve DB index problems caused by random identifiers such as UUIDv4 IDs.

Secure DNS (DoT & DoH) is not enough

Enabling DNS-over-TLS or DNS-over-HTTPS is now easy on smartphones and non-tech savvy machines. In conjunction with HTTPS, it's a great step towards a privacy-friendly browsing experience. Well, almost...

DNS Leak: How it Works and How to Implement It

Checking for DNS leaks is a technique to guess a client's ISP, even when it is connecting through a VPN or some other proxy service. Implementing a DNS Leak check is pretty straightforward.