Matchy
Fast unified database for IP addresses, strings, and glob patterns.
Match IP addresses, CIDR ranges, exact strings, and thousands of glob patterns in microseconds. One database format, one API, zero compromises on performance.
let db = open?;
// All query types use the same API
db.lookup?; // IP address
db.lookup?; // Exact string
db.lookup?; // Matches *.example.com pattern
Features
- 7M+ queries/second for IP lookups, 3M+ for glob patterns
- <1ms load time via memory mapping, regardless of database size
- 99% memory savings in multi-process deployments
- Unified database: IPs, strings, and patterns in one file
- MaxMind compatible: Extended MMDB format
- Rich metadata: JSON-like structured data storage
- Multiple APIs: Rust, C, and MaxMind-compatible C APIs
Quick Start
CLI
# Install
# Create a threats database
# Query - matches return JSON
# [{"threat_level":"high","category":"malware"}]
# [{"threat_level":"critical","category":"phishing"}]
# []
Rust API
use ;
// Build
let mut builder = new;
builder.add_ip?;
builder.add_pattern?;
builder.save?;
// Query
let db = open?;
if let Some = db.lookup?
C API
matchy_t *db = ;
matchy_result_t result = ;
if
;
Documentation
- The Matchy Book - Complete guide for CLI and APIs
- API Reference - Rust API documentation
- DEVELOPMENT.md - Architecture and implementation details
Building
Requirements: Rust 1.70+
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
License
BSD-2-Clause
Acknowledgments
Matchy extends MaxMind's MMDB format with Paraglob's pattern matching, creating a unified database for IPs, strings, and patterns with memory efficiency that scales to hundreds of worker processes.