Packages
reckon_db
1.5.1
5.11.0
5.10.4
5.10.3
5.10.1
5.10.0
5.9.1
5.9.0
5.8.3
5.8.2
5.8.1
5.8.0
5.7.0
5.6.1
5.6.0
5.5.5
5.5.4
5.5.3
5.5.2
5.5.1
5.5.0
5.4.0
5.2.2
5.2.1
5.2.0
5.1.0
5.0.0
4.0.0
3.1.2
3.1.1
3.0.0
2.3.7
2.3.6
2.3.5
2.3.4
2.3.3
2.3.2
2.3.1
2.3.0
2.2.2
2.2.0
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0
1.7.7
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.3
1.6.2
1.6.1
1.6.0
1.5.1
1.5.0
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
BEAM-native Event Store built on Khepri/Ra with Raft consensus. Event sourcing, persistent subscriptions, snapshots, and automatic cluster formation via UDP multicast discovery. Ships embedded Rust NIFs for 3-15x acceleration of crypto, hashing, compression, aggregation, filter matching, and grap...
Current section
Files
Jump to
Current section
Files
include/reckon_db.hrl
%% @doc Core records and macros for reckon-db
%% @author Reckon-DB
-ifndef(RECKON_DB_HRL).
-define(RECKON_DB_HRL, true).
%% Include shared types from reckon-gater
%% These define: #event{}, #subscription{}, #snapshot{}, #append_result{},
%% subscription_type(), read_direction(), append_error(), read_error(),
%% and constants: NO_STREAM, ANY_VERSION, STREAM_EXISTS, CONTENT_TYPE_*
-include_lib("reckon_gater/include/esdb_gater_types.hrl").
%%====================================================================
%% Version
%%====================================================================
-define(RECKON_DB_VERSION, "1.4.4").
%%====================================================================
%% Khepri Paths
%%====================================================================
-define(STREAMS_PATH, [streams]).
-define(SNAPSHOTS_PATH, [snapshots]).
-define(SUBSCRIPTIONS_PATH, [subscriptions]).
-define(METADATA_PATH, [metadata]).
%%====================================================================
%% Default Values
%%====================================================================
-ifndef(DEFAULT_TIMEOUT).
-define(DEFAULT_TIMEOUT, 5000).
-endif.
-define(DEFAULT_BATCH_SIZE, 100).
-define(DEFAULT_POOL_SIZE, 10).
-define(VERSION_PADDING, 12). %% Supports up to 999,999,999,999 events per stream
%%====================================================================
%% Store Configuration Record
%%====================================================================
-define(DEFAULT_GATEWAY_POOL_SIZE, 1).
-record(store_config, {
%% Store identifier
store_id :: atom(),
%% Data directory for Khepri/Ra
data_dir :: string(),
%% Mode: single | cluster
mode = single :: single | cluster,
%% Default timeout for operations
timeout = ?DEFAULT_TIMEOUT :: pos_integer(),
%% Writer pool size
writer_pool_size = ?DEFAULT_POOL_SIZE :: pos_integer(),
%% Reader pool size
reader_pool_size = ?DEFAULT_POOL_SIZE :: pos_integer(),
%% Gateway worker pool size (for load balancing)
gateway_pool_size = ?DEFAULT_GATEWAY_POOL_SIZE :: pos_integer(),
%% Additional options
options = #{} :: map()
}).
-type store_config() :: #store_config{}.
%%====================================================================
%% Cluster Node Record
%%====================================================================
-record(cluster_node, {
%% Erlang node name
node :: node(),
%% Whether this node is the leader
is_leader = false :: boolean(),
%% Node status: up | down | suspected
status = up :: up | down | suspected,
%% Last heartbeat timestamp
last_heartbeat :: integer() | undefined,
%% Store memberships
stores :: [atom()]
}).
-type cluster_node() :: #cluster_node{}.
%%====================================================================
%% PG Scope
%%====================================================================
%% Process group scope for event distribution
-define(RECKON_DB_PG_SCOPE, reckon_db_pg).
%%====================================================================
%% Telemetry Event Prefixes
%%====================================================================
-define(TELEMETRY_PREFIX, [reckon_db]).
-endif. %% RECKON_DB_HRL