|
1 | 1 | elysium |
2 | 2 | ======= |
3 | 3 |
|
4 | | -Elysium provides dynamic access to a Cassandra cluster |
| 4 | +### Elysium provides dynamic access to a Cassandra cluster |
5 | 5 |
|
6 | 6 | - Uses round-robin connection semantics |
7 | 7 | - Manages live connections via checkin/checkout |
8 | 8 | - Addresses overload using a pending request queue |
9 | 9 | - Periodically checks for new Cassandra nodes |
10 | 10 |
|
| 11 | +------- |
| 12 | +### Resilience is provided via rest_for_one supervision |
| 13 | + |
| 14 | + - ETS data management: elysium_buffer_sup |
| 15 | + - Application status/control: elysium_queue |
| 16 | + - Load balancing: elysium_lb_queue |
| 17 | + - Cassandra node discovery: elysium_peer_handler |
| 18 | + - Connection queues: serial queue of connections and requests |
| 19 | + - Connection management: elysium_connection_sup |
| 20 | + |
| 21 | +------- |
| 22 | +### Supervision Tree |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +------- |
| 27 | +### Queues are more persistent than connections |
| 28 | + |
| 29 | + - Loss of all connections does not affect queues |
| 30 | + - unless elysium_sup itself is taken out |
| 31 | + - ets tables, status/control are last to die |
| 32 | + - ensures monitoring works when things are down |
| 33 | + - activate/deactivate adds/destroys connections |
| 34 | + - currently too abrupt |
| 35 | + - in future will nicely drain in flight queries |
| 36 | + - load balancing survives when requests/connection queues down |
| 37 | + - cluster node discovery runs even if connections gone |
| 38 | + - activate creates new connections using round-robin |
| 39 | + |
| 40 | +------- |
| 41 | +### Basic operation is a checkin/checkout |
| 42 | + |
| 43 | + - Load balancing via a ring buffer |
| 44 | + - checkin/checkout Cassandra {Host, Port} |
| 45 | + - connections are round-robin |
| 46 | + - slow to respond nodes are skipped |
| 47 | + - ring buffer updated by elysium_peer_handler |
| 48 | + - Connections are in a checkin/checkout queue |
| 49 | + - implemented as a behaviour |
| 50 | + - currently relies on elysium_serial_queue |
| 51 | + - elysium_parallel_queue trips on concurrency issues |
| 52 | + - Requests checkout a connection and then check it back in |
| 53 | + - if none available, request is put in pending queue |
| 54 | + - connection is long-lived seestar Cassandra socket gen_server |
| 55 | + - Also supports a one-shot request |
| 56 | + - spawns a new seestar connection |
| 57 | + - discards the connection after the request completes |
| 58 | + |
| 59 | +------- |
| 60 | +### Stochastic Connection Migration |
| 61 | + |
| 62 | + - Connections decay periodically |
| 63 | + - randomly in N chances per 1 Billion requests |
| 64 | + - decayed connections are immediately replaced |
| 65 | + - the new connection is placed at the end of the queue |
| 66 | + - unless it is used immediately on a pending request |
| 67 | + - Reconnect avoids congestion |
| 68 | + - round-robin skips slow to respond nodes |
| 69 | + - redistributes all connections over time |
| 70 | + - restarts seestar sessions to avoid memory/staleness issues |
| 71 | + |
| 72 | +------- |
| 73 | +### Data Flow Logic |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +------- |
| 78 | +### Three Methods of Configuration |
| 79 | + |
| 80 | + - {config_mod, Module} |
| 81 | + - defines a functional interface for all config values |
| 82 | + - allows adaptive functionally changing parameters |
| 83 | + - {vbisect, Binary} |
| 84 | + - uses a binary dictionary for all config values |
| 85 | + - shared, lock-free, read-only configuration |
| 86 | + - any changes have to be distributed to running processes |
| 87 | + - {config_app_config, elysium} |
| 88 | + - refers to a top-level config block in the app.config file |
| 89 | + - has to be the name of a loaded application |
| 90 | + - simplest is to use elysium as an included_application |
| 91 | + - Performance is not equal |
| 92 | + - config_mod is 50% slower |
| 93 | + - vbisect and app.config seem to have similar performance |
| 94 | + - not measured with 16-core or more servers |
| 95 | + |
11 | 96 |
|
0 commit comments