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

data location data residency API Gateway Apache APISIX Apache ShardingSphere

Managing Data Residency - concepts and theory

Cloud computing has opened a Pandora’s Box of many original issues compared to sound old on-premise systems. I believe that chief among them is Data Residency, or Data Location: Data localization or data residency law requires data about a nation’s citizens or residents to be collected, processed, and/or stored inside the country, often before being transferred internationally. Such data is usually transferred only after meeting local privacy or data protection laws, such as givin

Rust Axum Tokio Dall.E

Server-side rendering in Rust - a Dall.E use-case

Last week, I decided to see the capabilities of OpenAI’s image generation. However, I noticed that one has to pay to use the web interface, while the API was free, even though rate-limited. Dall.E offers Node.js and Python samples, but I wanted to keep learning Rust. So far, I’ve created a REST API. In this post, I want to describe how you can create a webapp with server-side rendering. The context Tokio is a runtime for asynchronous programming for Rust; Axum is a web framework t