oxigdal_ha/lib.rs
1//! # OxiGDAL High Availability (HA)
2//!
3//! High availability, disaster recovery, and automatic failover for OxiGDAL.
4//!
5//! ## Features
6//!
7//! - **Active-Active Replication**: Bi-directional replication with conflict resolution
8//! - **Automatic Failover**: Sub-second failover with leader election
9//! - **Point-in-Time Recovery**: WAL-based recovery with snapshots
10//! - **Incremental Backups**: Efficient backup strategies
11//! - **Disaster Recovery**: Cross-region DR with automated runbooks
12//! - **Health Monitoring**: Comprehensive health checks
13//!
14//! ## Target Availability
15//!
16//! - **Uptime**: 99.99% (52 minutes downtime/year)
17//! - **Failover Time**: < 1 second
18//! - **RTO**: < 5 minutes
19//! - **RPO**: < 1 minute
20//!
21//! ## Example
22//!
23//! ```no_run
24//! use oxigdal_ha::replication::active_active::ActiveActiveReplication;
25//! use oxigdal_ha::replication::{ReplicationConfig, ReplicationManager};
26//! use uuid::Uuid;
27//!
28//! #[tokio::main]
29//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
30//! let node_id = Uuid::new_v4();
31//! let config = ReplicationConfig::default();
32//! let replication = ActiveActiveReplication::new(node_id, config);
33//!
34//! replication.start().await?;
35//!
36//! Ok(())
37//! }
38//! ```
39
40pub mod backup;
41pub mod conflict;
42pub mod dr;
43pub mod error;
44pub mod failover;
45pub mod healthcheck;
46pub mod recovery;
47pub mod replication;
48
49pub use error::{HaError, HaResult};
50
51/// Version information.
52pub const VERSION: &str = env!("CARGO_PKG_VERSION");
53
54#[cfg(test)]
55mod tests {
56 use super::*;
57
58 #[test]
59 fn test_version() {
60 assert!(!VERSION.is_empty());
61 }
62}