aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 6a4464bdc29dc4f944664f1757ec2b7a62f1b128 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
dreki
=====

**Dreki manages infrastructure.**

Each of your physical nodes should run Dreki, and that makes the "world".

Terminology:

  * `world` the overall "cluster"
  * `node` a machine, jail, container, vm..
  * `peer` a dreki running on a node

Dreki "core" is made of:

* Partisan distribution
* A global eventually consistent store (plum_db)
* Resolvable URNs
* Simple store abstraction

URNs address everything in Dreki and allows to mix multiple kind of data sources (called stores).

Currently, two kind of stores exists:

* The plum_db store, called "global", eventually consistent and replicated everywhere,
* Mnesia/DETS local store

All stores are queryable from all nodes, resorting to Partisan RPC if the store is local.

The world is a hierarchical acyclic graph, based on DNS. Members of World are regions and nodes:

```
world.domain
|- eu
   |- fr
   |  |- ovh
   |  | |- sbg1
   |  | |  `- **node1**
   |  | |`- rbx1
   |  | |   `- **node2**
   |  |- scw
   |  | |- dc2
   |  | | `- **node3**
   |  | `- dc5
   |  |   |- **node4**
   |- de
   |  ` hzn
   |   |  |- fsn1
   |   |  |  `- **node6**
   |- ch
   |  `- exo
   |     `- gnv
   |        `- **node5**
```

Each region must define a or many member entries: `_dreki.region IN SRV 0 0 1337 sub.region`, `_dreki.region IN SRV 0 0 1337 node.region`.

A region can be given a friendly name by defining in `_dreki.region IN TXT "Some cute name"`.

A node is defined by creating a node entry: `_node._dreki.name IN SRV 0 0 PORT dns.name.`, and:
* can be given a friendly name by defining `_name._dreki.name IN TXT "Some cute name",
* can be given a node name (erlang) by defining: `_node._name._dreki.name IN TXT "dreki2@node2"` (usually not needed!).

Dreki uses **partisan** as membership system and uses multiple databases:

* `plum_db` (world-wide, eventually consistent) for world metadata (called <<"global">>)
* ?? ra ?? 
* `mnesia` locally (usually called <<"local">>)
* whatever you want :) see `dreki_store` and `dreki_store_backend` behaviour!

TODO: A consistent K/V store backed by Ra, automagically made for each region!

Everything in Dreki is addressable and addressed by Dreki URNs (see `doc/URNs.md`).

A dreki peer may represent a node and may create nodes.

Stores:

* "inf.random.sh::qqch::id"
* "inf.random.sh:eu:fr:scw:dc2::qqch::id"
*