This documentation describes the YANGcore design.
Some end user goals that greatly influenced the design.
Many opportunities are missed due to onerous installation procedures. Keeping installation as simple as possible seems good. Note, this is why YANGcore doesn’t use any configuration files, preferring instead to put all data into the database supplied on the command line.
Deployment environments vary, with many variations of Linux, BSD, and Windows to choose from, not to mention some niche systems. In the same desire to simplify installation, a highly portable product seems like goodness.
There seems to be a sweet spot of having a minimal footprint, e.g., on CPU, memory, etc.. A low footprint allows it to run as a micro-service within a larger framework, or as an ephemeral daemon in an SDN context.
Having everything available via a programmatic API enables many integration options. Not only can a deployment-specific GUI be layered on top of it, but it can also be called into by controller / NMS applications.
The ability to persist all YANGcore data into a RDBMS is needed to enable the use of a host of RDBMS management tools enabling, for instance, backup, recovery, and encryption.
The immediate use-case is the network equipment vendors and, from their perspectives, they would need to expose a multi-tenant service to their customers. Supporting tenants with isolated data views is critical.
DISCLAIMER: The multi-tenancy implementation was temporarily removed in late 2024. It is planned to be added back as a post-1.0 feature.
Using Python as the programming language was made based on past experience. Python is known for its easy installs, high portability, and low footprint.
Previous experience suggests that a single process can handle the expected load with CPU cycles to spare. The simplicity goal is further achieved by not having to worry about virtual machines or Docker containers.
Using SQLAlchemy was selected for its ability to work with multiple database backends, including in-memory, file-based, and RDBMSs such as MySQL, MariaDB, Postgres, Oracle, etc.
A few “no SQL” databases were looked at. In particular, document and graph based databases, but all required setting up an external server (no built-in in-memory or file-based options. Future plugins may be made available to support no-SQL backends.
In anticipation of developing a multiplicity of YANGcore-based products, it is desired to factor application code into a generic application layer (YANGcore).
YANG RFC 7950 has been shown to be well suited to defining APIs for networking equipment. The RESTCONF RFC 8040 protocol has been shown to provide an easy to use YANG-driven API.
YANG models define arbitrary N-ary trees. It was needed to map arbitrary N-ary trees to SQL tables and rows. Having a “DAL” layer for this seemed prudent.
The options for how to validate YANG datastore were unclear. Decision to use Yangson, as integrating into DAL didn’t seem right. Currently a separate “VAL” layer is used so it can be swapped out with another option if ever needed.
The database itself only ever persists the ‘native’ view. This is why it is called the “native” view. The other views only define “facades” on top of the native view.
Python objects are nearly indistinguishable from JSON objects - they both print the same tree structures. Thus using JSON natively made sense. This decision was/is further constrained by the fact that Yangson initially only supported JSON, though now it supports XML as well.
YANGcore supports “dynamic callouts” in order to interact with external systems (except an RDBMS). Notable uses are:
At this time, dynamic callouts must be implemented by a plugin-based callback but, in a future release, may be implemented as via a webhook (i.e., an HTTP POST request).
The following diagram illustrates how the various Python modules within YANGcore are composed.