You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/_index.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,13 @@ archetype = "home"
3
3
title = "flatgraph"
4
4
+++
5
5
6
-
[flatgraph](https://github.com/joernio/flatgraph) is a fast and memory efficient columnar graph database with support for domain specific and typesafe traversal language. Written in [Scala 3](https://www.scala-lang.org/).
6
+
[flatgraph](https://github.com/joernio/flatgraph) is a fast and memory efficient columnar graph database with a framework to generate domain specific and typesafe traversals.
7
+
Model your domain in flatgraph's schema builder ([examples](https://github.com/joernio/flatgraph/tree/master/test-schemas/src/main/scala/flatgraph/testdomains)) and the code generator will generate all required classes and steps required to traverse your domain in a graph as well persistence. Note: flatgraph is not supposed to be a full ACID compliant database - our design goals are efficiency, minimalism, simplicity and rapid prototyping.
7
8
8
-
flatgraph was developed as the underlying database for the code analysis platform [joern](https://joern.io) as well as [qwiet.ai's](https://qwiet.ai/) proprietary static code analysis tools. Many design decisions were driven by the needs of code analysis, however we are certain that flatgraph is useful for other domains as well, and we've tried our best to make it easy to give it a go.
9
+
flatgraph is developed and maintained as the underlying database for the code analysis platform [joern](https://joern.io) as well as [qwiet.ai's](https://qwiet.ai/) proprietary static code analysis tools. Many design decisions were driven by the needs of code analysis, but flatgraph is useful for other domains as well, and since we love open source (and hope to get bug reports and feature contributions back), we decided to share it with the world.
9
10
10
11
## Main characteristics / design decisions
11
-
*flatgraph runs locally in a JVM
12
+
* runs locally in a JVM (written in [Scala 3](https://www.scala-lang.org/))
12
13
* provides a DSL to model your domain-specific graph schema
13
14
* code generator creates a domain specific typesafe query language
14
15
* code generator can be used programmatically or as an sbt plugin
@@ -19,10 +20,11 @@ flatgraph was developed as the underlying database for the code analysis platfor
19
20
* transactions, and therefor all ACID properties (atomicity, consistency, isolation, durability)
20
21
* fail safety: flatgraph does not create a write-ahead log - this is not a design decision though and could be implemented if needed
21
22
* remoting: flatgraph does not provide a client in order to connect to a remote flatgraph instance and/or manage concurrent clients
23
+
* clustering: flatgraph does not support multiple instances that coordinate each other
22
24
* swapping to disk: your graph will need to fit into the heap at all times
23
25
24
26
## Glimpse of a simple use case
25
-
I have a history in [tinkerpop](https://tinkerpop.apache.org), so allow me to take a very simple graph domain from there to show how to get started with flatgraph. Working code is often better than prose: and the full setup is part of the tests in the [flatgraph repository](https://github.com/joernio/flatgraph).
27
+
We have a history in [tinkerpop](https://tinkerpop.apache.org), so allow us to use a very simple graph domain from there to show how to get started with flatgraph. Working code is typically better than prose: the full setup is part of the tests in the [flatgraph repository](https://github.com/joernio/flatgraph).
26
28
{{< figure src="/grateful-dead-schema.png" caption="grateful dead sample domain">}}
27
29
28
30
Excerpt from the [GratefulDead domain schema](https://github.com/joernio/flatgraph/blob/44005cf16373dfaf629da8628071ebbfaf02b551/test-schemas/src/main/scala/flatgraph/testdomains/GratefulDead.scala):
@@ -65,9 +67,13 @@ The full working test is [here](https://github.com/joernio/flatgraph/blob/92f4cc
65
67
## Memory footprint
66
68
flatgraph uses an efficient columnar layout to make most of your available heap. The actual space required depends on your domain, but to get a rough idea we can look at some numbers from the code analysis tool [joern](https://joern.io): for the analysis of the linux networking driver source, joern creates a flatgraph instance with 9m nodes, 88m node properties, 84m edges and 19m edge properties. This requires 3.7G heap, and if we persist it to disk storage it takes up 300MB.
67
69
70
+
## Dependencies
71
+
We tried to streamline the dependency tree as much as possible: flatgraph-core most notably depends on [zstd-jni](https://github.com/luben/zstd-jni) (fast compression for storage), [Scala 3](https://www.scala-lang.org/) and [ujson](https://com-lihaoyi.github.io/upickle/#uJson).
72
+
73
+
68
74
# TODOs
69
75
* full setup with sbt and codegen plugin: on separate page, link here
70
-
* setup example repo and describe here
76
+
* setup example repo and describe here
71
77
* demo node specific starter steps, regex filter steps, number filter steps, boolean filter steps
72
78
* explain concepts of `NewNode` and StoredNode
73
79
* graph modifications all go via the DiffGraph api. Prefer few large DiffGraph applications over many small ones, since the cost of applying a DiffGraph is almost independent of it's size.
@@ -79,7 +85,7 @@ flatgraph uses an efficient columnar layout to make most of your available heap.
79
85
* based on the always double check the result type
0 commit comments