Motives to choose nlohmann as json-library #27
lennartbecker-d
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
As there is an open discussion which JSON-library to choose, everyone is open to add their opinion on this topic. To the current state of this project, the nlohmann/json library was selected over other JSON libraries, such as RapidJSON, due to its reliability, ease of integration, and overall popularity within the developer community. A detailed explanation of the decision-making process is provided, based on Google Trends, release/maintenance data, and compatibility within the existing software landscape:
Google Trends: Current Usage
(Source: Google Trends)
When comparing nlohmann/json and RapidJSON using Google Trends, it is evident that the nlohmann/json library enjoys significantly higher popularity and wider usage across the developer community. The sustained attention it receives highlights its reliability, active adoption, and strong online presence, which often correlates with community trust, better documentation, and more tutorials/examples for practical implementation.
While RapidJSON used to have higher popularity from the beginning, within the last years there was a turnover with significant superiority for nlohmann/json.
Data on Releases & Maintenance
The release history and bug maintenance practices indicate that the nlohmann/json library is well-maintained and actively developed:
In contrast, RapidJSON's maintenance has slowed down in recent years, with its last notable release being August 2016 (version 1.1.0). While RapidJSON is still functional, its stagnation poses a risk in terms of long-term support and addressing bugs in newer C++ versions.

Compatibility with Existing Toolchains
The baselibs-team has already utilized the nlohmann/json library and it is fully integrated into the current development landscape. This pre-existing compatibility ensures seamless integration without additional configuration or setup effort. By using a library that is already embedded into our tooling and processes, the risks of incompatibility and maintenance overhead are minimized.
Comparison of Advantages: nlohmann/json vs RapidJSON
Advantages of RapidJSON:
Advantages of nlohmann/json:
Conclusion
(Source: libhunt)
The decision to use the nlohmann/json library was influenced by its popularity, active development, and compatibility with the existing software landscape. While RapidJSON offers superior performance in specific cases, the advantages of nlohmann/json in terms of ease of use, feature richness, and ongoing maintenance make it the better choice for most applications. Additionally, its integration into the baselibs tooling further simplifies adoption and reduces the risk of compatibility issues. Other JSON-libraries such as simdjson, JsonCpp are neglected in this discussion so far due to significant smaller popularity or difficulties of integration.
Beta Was this translation helpful? Give feedback.
All reactions