Building a Graph Store

It’s time to look at persistence.

We’re going to work with graphs of various types. We’ll want a place to store the graphs that we create and another place to source example graphs. We’ll also want to save the selected queries for the various graph types, each of which has its own query language.

In short, we’ll want a graph store. Let’s build one.

Creating a Storage Area

You’re going to set up a storage area in the usual place we use for bundling a project’s static files—the priv directory. First, create a new directory priv:

 .
 ├── README.md
 ├── lib
 │   └── ...
 ├── mix.exs
»├── priv
 └── test
  └── ...

Here’s the file organization we’ll create under priv:

 priv
»├── scripts
 │   ├── elixir
 │   └── shell
»└── storage ...

Get Exploring Graphs with Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.