How statsig-io/statsig-server-core works
Statsig Server Core is a multi-language server SDK for evaluating feature gates, dynamic configurations, and experiments, and for logging exposures and events. A typical flow starts with an application supplying a user and requesting an evaluation; the SDK returns a typed result and may record exposure or event data. The Rust core contains the evaluation and networking machinery, with language bindings exposing it to applications. The README documents the product capabilities; several internal links below are dashed because the sampled excerpts do not show their runtime wiring.
Main entry points: evaluator.rs Evaluation engine · statsig.rs Statsig runtime · specs_adapter_trait.rs Specs adapters · Statsig.java Language SDKs
Components 16
SDK interfaces
- Language SDKs
statsig-java/src/main/java/com/statsig/Statsig.java - FFI bindings
statsig-ffi/src/lib.rs
Core runtime
- Statsig runtime
statsig-rust/src/statsig.rs - User context
statsig-rust/src/user/statsig_user.rs - Sticky storage
statsig-rust/src/persistent_storage/persistent_storage_trait.rs
Specs and evaluation
- Specs adapters
statsig-rust/src/specs_adapter/specs_adapter_trait.rs - Spec store
statsig-rust/src/spec_store.rs - Evaluation engine
statsig-rust/src/evaluation/evaluator.rs - Feature gates
statsig-rust/src/evaluation/evaluation_types.rs - Dynamic configs
statsig-rust/src/evaluation/dynamic_returnable.rs - Experiments and layers
statsig-rust/src/evaluation/evaluation_types.rs
Events and transport
- Event logging
statsig-rust/src/event_logging/event_logger.rs - Event queue
statsig-rust/src/event_logging/event_queue/queue.rs - Network client
statsig-rust/src/networking/network_client.rs
Other components
- Server application
- Statsig service
Connections 19
- Server application → Language SDKs: requests evaluations
README.md - Language SDKs → FFI bindings: calls native bridge
- FFI bindings → Statsig runtime: dispatches calls
- Server application → Statsig runtime: requests evaluations
README.md - Server application → User context: provides context
- Statsig runtime → Specs adapters: loads specs
- Specs adapters → Statsig service: fetches specs
- Specs adapters → Spec store: updates specs
- Statsig runtime → Evaluation engine: evaluates requests
- Evaluation engine → Spec store: reads specs
- Evaluation engine → User context: reads context
- Evaluation engine → Feature gates: returns gate results
README.md - Evaluation engine → Dynamic configs: returns configurations
README.md - Evaluation engine → Experiments and layers: returns experiment results
README.md - Evaluation engine → Sticky storage: uses sticky values
- Statsig runtime → Event logging: logs events
- Event logging → Event queue: queues events
- Event queue → Network client: sends batches
- Network client → Statsig service: sends requests