NNG is a lightweight brokerless messaging library that implements the Scalability Protocols with a modern C API.
NNG solves the problem of building distributed systems that need reliable message passing without a central broker. It provides patterns like publish-subscribe, request-reply, and service discovery through a simple API that handles connection management, retries, and other low-level concerns automatically. The library is implemented in C and uses an asynchronous I/O framework with thread pools to scale across multiple cores while remaining embeddable and portable.
Developers should choose NNG if they need production-grade messaging in an embedded or resource-constrained context where a broker-based system would be overkill. It suits applications requiring reliable inter-process or network communication with minimal dependencies. The project improves on its predecessor nanomsg by adding TLS transport support, better scalability through asynchronous I/O, hardening against malicious attackers, and a more intuitive API that separates protocol context from socket state to simplify concurrent programming. A migration guide is available for those moving from NNG 1.x versions.
The project maintains both a development branch and a separate stable branch, with the development branch containing breaking API changes. The codebase is written in C11 and uses CMake for building, supporting compilation as either shared or static libraries. The architecture emphasizes modularity and maintainability, with documentation and design choices intended to make the codebase accessible to developers unfamiliar with it. The project is licensed under the MIT license to minimize adoption friction.