How Ariane Is Moving from Monolith to Microservices with NATS
Read how and why one project is breaking down its architecture to move to more flexible architecture.
Join the DZone community and get the full member experience.Join For Free
some words about the ariane project
while the devops trend is reducing application delivery time with automation on any step of the deployment, we still need to reduce the time to understand complex distributed applications:
- we still rely on hand-written technical documentations and diagrams.
- these documentations and diagrams are dispatched across teams (silo effect).
- the documentations and diagrams are also often not up to date (technical debt effect).
knowledge management is a key factor in reducing silo effect and improving the integration of new team members. and it finally impacts your production kpis like ttr (time to resolution). but:
- when done correctly, it costs a lot of time to produce and maintain the knowledge persistence.
- when not done or done partially, it costs a lot of time to understand your technical environment through reverse-engineering.
the ariane project is focused on reducing the knowledge production time through real-time diagram automation.
basically, the ariane project is a framework: it allows you to develop plugins which will automate the data mining from your runtime and the transformation of this mined data into a bigraph stored in a graph database ( neo4j ).
then the user will request the ariane web server to get the map — or the technical diagram —between some technical points or around a technical point (a technical point could be a server or a process inside a server, for example).
currently, three open source plugins are available as proof of concept, and we are in the process of developing a nats plugin:
- the rabbitmq plugin which allows you to map rabbitmq clusters, resources and connected applications.
- the procos plugin which allows you to map the process running inside your operating system and their connections.
- the docker plugin which allows you to map the docker containers running inside your operating system and their connections.
below the result map of the ariane application mapping ( full picture ):
the system view is a concatenation of the data coming from procos and docker plugins. the rabbitmq view has been done with the rabbitmq plugin.
you can see the ariane server (process:  java), the procos and docker plugins (processes:  python3 and  python3) running in the system view. rabbitmq plugin is running inside the ariane server.
scale the monolith: from nanoservices to microservices
the previous ariane versions have been done as a big java monolith which is not really sexy with all the last cloud trends but this was a cost saver for the little startup echinopsii :
- it allowed us to focus on the ariane apis and functionalities instead of deployment problems.
- it allowed us to quickly show demonstrations to some prospects and at some meetup.
anyway, monolith doesn’t mean it’s poorly architectured: we followed separation of concern everywhere and ariane is a combination of many osgi nanoservices (note: 1- years back, the osgi alliance has coined µservice, but today, i prefer to call them nanoservices to provide a clear distinction with the current containerized and network oriented microservice definition).
so, all these nanoservices are speaking together in the same java process through memory and clean interfaces. ariane also provides rest implementation of these services, which allowed us to develop first ariane python3 client used by procos and docker plugins.
but while http and rest apis are great for human interface, we believe machine to machine communications deserve more efficient network transport:
- we want to reduce transport latency and cost as much as possible. http is slow and more expensive compared to mom.
- we may need routing across datacenters and firewalls while installing procos and docker plugins as local agents on the operating systems to map. the majority of mom provide easy solutions for that.
since ariane 0.8.0 launched, we’re providing a messaging implementation for the ariane mapping service and since then procos and docker plugins are able to push the data to the mapping service through the messaging bus.
below a quick diagram describing ariane 0.8.0 monolith architecture:
as you can see, the ariane monolith is embedding lot of stuff from a tomcat server to a neo4j database server. to improve the ariane scalability, we are currently splitting the monolith as described below :
this architecture migration has been done with minimal cost on the plugins side, as they are using the ariane apis the same way as before: we just need some changes in the configuration to define which implementation to use (rest or messaging // memory or messaging).
based on this new architecture:
- we will provide cloud ready docker images and orchestration script templates.
- we will scale the back mapping database with neo4j enterprise separately to the front web server.
now, this is how this migration looks like from a system point of view:
before ( full picture )
after ( full picture )
if you look closely the ariane maps provided, you’ll notice that:
- a new java process appears: this is the ariane mapping microservice which embeds the neo4j community distribution.
- we were already using rabbitmq and we decided to add a nats implementation for our messaging libraries (java and python).
finally, and to resume the reasons why we are using nats now:
- as we’re migrating data flows from memory to the messaging bus, we have deep concern on the messaging bus latency and throughput: the nats benchmark scores are impressive .
- we don’t need messaging persistence/transaction (although nats now has this via nats streaming ) in the mom server: persistence and transactions are managed in the ariane endpoints.
- we like simplicity: nats is simple.
careful readers have noticed some hand-made diagrams in this blog post. this is typically the kind of work we love to automate.
as you may understand, the ariane project is a big trip that makes fun and profit from new graph database technology and which needs an efficient messaging bus to push, as much as possible and as quickly as possible, the data coming from your runtime to a big and unified mapping database.
ariane is also an open source and inclusive project because there are lots of plugins to write: every day, we’re developing new applications which will raise new problems tomorrow and which will need a fast and deep understanding from ops and devs.
from our point of view, this human understanding of tech is a key point in providing the next step of our evolution : efficient and trusted ia.
the next ariane delivery (0.8.1) is scheduled for the end of august 2016. meanwhile, i’d be happy to read your feedback !
Published at DZone with permission of Mathilde Ffrench. See the original article here.
Opinions expressed by DZone contributors are their own.