drasi-lib

Build Change-driven Rust solutions

Build Change-driven Rust Solutions

drasi-lib is a Rust crate that brings Drasi's powerful change processing functionality directly into your application. Monitor data changes and react to them in real-time without external infrastructure.

How drasi-lib Works

Add drasi-lib to your Rust project, create Sources, Continuous Queries, and Reactions in code, and handle changes programmatically. Everything runs in-process with no external infrastructure.

Add Crate
Include drasi-lib in Cargo.toml
Write Code
Create Sources, Queries, and Reactions
Handle Changes
React to results in your code

Your application can ingest changes from external sources (like PostgreSQL or gRPC streams), from internal application state via App Sources, or both. Continuous queries process these changes and produce results that flow to Reactions—which can call external systems, update internal state via App Reactions, or both. The API layer gives your application direct access to query results and runtime control.

drasi-lib architecture showing Sources, Queries, and Reactions running inside a Rust application

When to Use drasi-lib

drasi-lib is ideal when you are developing a Rust application or service and need efficient and precise change detection without deploying separate infrastructure:

  • Event-driven microservices — React to database changes without polling; get before/after states for every change
  • Real-time monitoring — Trigger alerts when aggregations cross thresholds or conditions persist
  • In-app reactive logic — Use application sources and reactions to drive and respond to state changes within your application, replacing complex event wiring with declarative queries
  • Edge and embedded systems — Run change detection locally with minimal footprint
  • Custom data pipelines — Embed reactive queries in ETL processes or stream processors

Documentation Resources

The drasi-lib crate is published to crates.io with full API documentation available on docs.rs.