dotcli: query graph data written in Graphviz DOT language

Share on:

Table of Contents

Problem Statement

In a microservices oriented world, applications might be split up over 10s, 100s, 1000s of service containers. Often, devs, QAs, performance testing teams want to just develop against and test a subset of these microservices. So, instead of spinning up the entire application and all its 100s of containers, it makes sense to only spin up a subset of these services that represent specific “whole” functionalities. One way to do this is to represent the dependencies between the services as a graph and use the graph to drive things like minimal deployments.

Use-cases

  • Given a service X, figure out the minimal number of application containers needed
  • Deploy things in order, parallel when possible, sequentially when hard dependency, w/ possibility of continuing w/ a soft failure and also short-circuting.
  • faster, controlled cloud/production deployments
  • performance testing only 1 or N number of services
  • devs/QA in the cloud environments

Solution

Graphviz DOT language is a popular layman way of quickly describing graph data in textual form and visualizing it. One could store the data in a graph database like neo4j or dgraph, but often dot language is a good least common denominator between devs, qa, devops and non-technical people. Hence, it makes sense to use the dot file as a “database” and use it to drive multiple downstream consumers based on the ability to query it.

However, once you have such a DOT file, how do you query this graph data using classic graph algorithms? This is the problem dotcli intends to solve.

Examples

  • Check out the installation docs here.
  • Check out the usage docs here
1dotcli src --help
2
3PATH_TO_DOT_FILE="TODO"
4NODE_NAME="TODO"
5dotcli src $PATH_TO_DOT_FILE $NODE_NAME