reactive programming database

Reactive database access on the JVM

A couple of years ago, Reactive Programming was all the rage, but it had one big issue: reactive stopped as soon as you accessed a SQL database. You had a nice reactive chain up to the database, defeating the whole purpose. Given the prevalence of SQL databases in existing and new apps, one couldn’t enjoy the full benefits of Reactive Programming but still pay the full price of complexity. Since then, the landscape has changed tremendously. Most importantly, it offers many reactive driver

sticky session session affinity Apache APISIX Hazelcast Spring Session Spring Security

Sticky sessions with Apache APISIX - the demo

Last week, we described the concept behind sticky sessions: you forward a request to the same upstream because there’s context data associated with the session on that node. However, if necessary, you should replicate the data to other upstreams because this one might go down. In this post, we are going to illustrate it with a demo. The overall design Design options are limitless. I’ll keep myself to a familiar stack, the JVM. Also, as mentioned in the previous post, one should on

sticky session session affinity Apache APISIX

Sticky sessions with Apache APISIX - Theory

Sticky sessions, also known as session affinity, is a mechanism by which a routing component that acts as a facade always routes a request to the same underlying upstream node. In this post, I’ll describe the reason behind sticky sessions, available alternatives, and how to implement them via Apache APISIX. Why sticky sessions? Sticky sessions became popular when we stored the state on the upstream node, not the database. I’ll use the example of a simplified e-commerce shop to exp

Apache APISIX Spring Spring Cloud Gateway

Evaluating Apache APISIX vs. Spring Cloud Gateway

Given the number of API Gateways available on the market, I’m regularly asked which is better. Better is a very subjective term. However, there’s no denying that if you’re advocating for a product, you should know your product and its competitors. In this post, I’d like to share my understanding of Spring Cloud Gateway and how it compares to Apache APISIX. I’m cautious when comparing products because most comparisons I read are heavily biased. That’s a risk,

Docker WebAssembly WASM WASI

Playing with WASM on Docker

The idea of bytecode that can run anywhere dates back to the JVM inception (as far as I know). WebAssembly is the new implementation of an old idea. While WebAssembly is meant to run in the browser, Docker recently announced its capability to run WASM code without needing containers. In this post, I want to explore how it can work. Prerequisite Running WebAssembly is a beta feature and requires using containerd. To enable containerd, go to the Docker Desktop dashboard, then Settings  Fea

GitLab GitLab pages

GitLab Pages preview

When I write Apache APISIX-related blog posts, I want my colleagues to review them first. However, it’s my blog, and since I mix personal and business posts, I want to keep them from the repository. I need a preview, accessible only to a few, something like Vercel’s preview. I’m using GitLab Pages, and there’s no such out-of-the-box feature. I tried two methods: GitHub gists and PDFs. Both have issues. Gists don’t display as nicely as the final page. I tried to i

health check HTTP API

Health Check Response Format for HTTP APIs

I’m continuing my journey on getting more familiar with HTTP APIs by reading related RFCs. This time, I read the Health Check Response Format for HTTP APIs on the suggestion of Stefano Fago. In this post, I’d like to summarize my reading. Note that it’s a draft. Moreover, it has been dormant for nearly two years and, thus, has been automatically expired. However, it’s the closest to a specification on health checks and thus deserves some love. Sample data visualization

data location data residency API Gateway Apache APISIX Apache ShardingSphere

Managing Data Residency - the demo

I explained the concepts and theory behind Data Residency in a previous post. It’s time to get our hands dirty and implement it in a simple demo. The sample architecture In the last section of the previous post, I proposed a sample architecture where location-based routing happened at two different stages: The API Gateway checks for an existing X-Country header. Depending on its value, it forwards the request to the computed upstream; If no value is found or no value matches, it forwar

code maintenance

Working on an unfamiliar codebase

In our profession, it’s common to work on an unfamiliar codebase. It happens every time one joins a new project or even needs to work on a previously untouched part in big ones. This occurrence is not limited to a developer having to fix a bug; it can be a solution architect having to design a new feature or an OpenSource contributor working on a GitHub issue in their free time. Hence, I want to describe how I approach the situation so it can benefit others. An example issue To illustra