C++ developers can get an assist in building asynchronous microservices, with a new open source framework intended to solve the problem of efficient I/O interactions.
Called Userver, the asynchronous framework offers a set of abstractions for “fast and comfortable” creation of C++ microservices, services, and utilities, according to the project’s GitHub repo. The project is currently in beta.
Userver promises to solve the issue of efficient I/O transactions transparently for developers. The developers behind the the framework say it offers the speed of C++, the simplicity of Python, and the coroutine model of Go.
With Userver, operations that normally suspend the thread of execution do not do so; instead, the thread processes other tasks and returns to the handling of the operation only when it is guaranteed to execute immediately.
Developers get straightforward source code and avoid CPU-consuming context switches from the OS, while efficiently utilising the CPU with a small number of execution threads, the project states.
Other features of the Userver framework include a set of high-level components for caches, distributed locking, JSON/YAML/BSON, logging, metrics, statistics, and tasks.
This is in addition to the ability to perform on-the-fly service configuration changes and a comprehensive set of asynchronous and low-level synchronisation primitives and OS abstractions.
Meanwhile, asynchronous drivers for MongoDB, Postgres, Redis, and other databases are available plus synchronous drivers for data transfer protocols including HTTP, GRPC, and TCP, and for for tasks including construction and cancellation.
A July 29 bulletin announcing the beta of Userver emphasises the simplicity of the Userver development process, claiming even interns and students can write and deploy to production a new microservice in just a week. The bulletin notes that issues including errors with multithreading are caught at compile time. Documentation for userver can be found at userver.tech. The framework is published under an Apache 2.0 licence.
The beta of Userver follows closely revelations of a potential successor to C++, a language called Carbon. Carbon is currently in an experimental phase.