Skip to content

bitgn/layers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Benchmarking

Currently the benchmark is done by compiling golang binary and copying it to the target load tester machine. I’m using the one with the pre-baked FDB cluster on AWS.

This works fine, however there are limitations:

  • Benchmark tool is hard to port to the other languages (coupled with the golang).
  • FDB apps are limited by the throughput of the single networking thread of `fdb_c` native library, so you need to run multiple clients against larger clients; current bench can run in parallel, but doesn’t aggregate the results.

I think, one of the approaches would be to break the current bench into the following parts:

  • load generator - a simple native app that does the work and pushes telemetry;
  • FDB statistics collector - a simple app that pushes telemetry about the FDB (to be replaced with some native solution);
  • Prometheus/InfluxDB - to gather all statistics (replacing TSV files);
  • Grafana - chart cluster performance in real-time.

Re Prometheus vs InfluxDB for this case. Prometheus pros:

  • better long-term solution;
  • understands histograms and can aggregate them;

InfluxDB pros:

  • I’ve used it for a long time and know how it works;
  • Easy to send custom events (like injected cluster faults).

Event Store Layer

Event store layer is an implementation of append-only log which also maintains indexes all messages by their stream name. It is frequently used to implement Aggregates with Event Sourcing pattern.

Key requirements:

  • large messages are split into chunks;
  • global stream and event streams are changed within a single transaction;
  • Events within a stream are stored by an incrementing version number;
  • Events in the global stream are stored by the version stamp.

Global event range

This design document outlines Event Store version 1, without any optimizations to reduce storage space.

Key ranges

We designate following key ranges:

PrefixDescription
0Settings for this Event Store
1All events ordered by the version stamp
2Events stored by streams and ordered by version within stream

Methods

AppendToStream

Arguments:

  • stream name (string)
  • stream version (long) - expected stream version, -1 to skip version check
  • events (list of byte[]) - message values

ReadFromStream

Arguments:

  • stream name (string)
  • starting from (long)
  • max count (int)

returns: list of stream data

ReadAll

Arguments:

  • starting from (long)
  • max count (int)

returns: list of stream data

GetStoreVersion

Returns: store version (long)

Language-specific implementations

.NET

.NET Methods are to be implemented as async returning Task and accepting CancellationToken as the last optional parameter.