I’d like to share a project I’ve been working on for a while and, more importantly, start a technical discussion about API Gateway architectures.
HTTP DMMR was born from a collection of old ideas that had been gathering dust in my Pastebin for years, eventually evolving alongside the technology itself. The original goal was to build a Layer 7 switch focused on mitigating DoS attacks. Time passed, cloud computing changed the way those problems are solved, but I realized that many of the architectural concepts behind that original idea were still worth exploring.
The result is an API Gateway implemented as a native NGINX module written in C, accompanied by an independent cache daemon.
I wanted to explore a different architectural approach based on three simple principles:
leverage as much as possible what NGINX already provides;
minimize external dependencies whenever possible;
keep the request path as short as possible.
Today we have API Gateways offering hundreds of features. That’s a perfectly valid approach and fits many use cases. My curiosity, however, was to explore the opposite direction: how far can we go with a simple, lightweight architecture written almost entirely in C?
The current version (0.0.2-alpha) already includes:
native NGINX module;
API Key authentication;
dynamic request routing;
rate limiting;
standalone cache daemon;
lightweight binary protocol between the module and the daemon;
Unix Domain Socket and TCP communication;
Berkeley DB persistence.
The next step I’m most excited about is evolving the daemon into a distributed peer-to-peer cache with state synchronization between instances. In a world dominated by containers and distributed applications, I believe this kind of architecture still has plenty of room to evolve.
I might be completely wrong. That’s exactly why I’m making the project public and bringing it here for discussion.
The project is still in alpha and there’s a long road ahead. At this stage, what I’m looking for is feedback, criticism, and technical discussions with people who also enjoy distributed systems, NGINX
, and C programming.
Project:
Best regards
Alessandro Silveira