CQEngine Next

Ultra-fast NoSQL Indexing and Query Engine for Java Collections

Java 21 Apache 2.0 License Maven Central Maintained Fork GitHub Stars

Key Features

⚡

Ultra-fast Queries

Orders of magnitude faster than iterating collections. Execute 1.1+ million queries per second with sub-microsecond latency.

📊

SQL-like Syntax

Familiar query syntax with complex boolean logic. Write queries like SQL but on in-memory Java collections.

🔍

Multiple Index Types

Hash, NavigableSet, Radix Tree, Suffix Tree, and more. Choose the perfect index for your query patterns.

ðŸ’ū

Flexible Persistence

Store data on-heap, off-heap, on disk, or in SQLite. Scale from memory to persistent storage seamlessly.

🔒

Thread-safe

Concurrent reads and writes supported with MVCC transaction isolation. Lock-free concurrent operations.

ðŸŽŊ

Zero Dependencies

Core library has no external dependencies. Add only what you need for optional features.

Performance Benchmarks

1.1M+
Queries per Second
0.896Ξs
Per Query Latency
330,000%
Faster than Iteration

Benchmark: Range Query Performance

Performance Benchmark Chart

CQEngine dramatically outperforms naive and optimized iteration for range queries on a single 1.8GHz CPU core.

Use Cases

🔄 In-Memory Caching

Complex queries on cached data with ultra-low latency for real-time applications.

📈 Real-time Analytics

Live data analysis with sub-millisecond query responses for dashboards and monitoring.

ðŸŽŊ Data Filtering

High-performance filtering and aggregation for large datasets in memory.

ðŸ“ą Embedded Databases

Desktop and mobile applications requiring local data storage and querying.

🌊 Standing Queries

Continuous queries on streaming data with automatic index updates.

⚖ïļ Limit Checking

Real-time exposure and counterparty limit validation in financial systems.

Quick Start

1. Add Maven Dependency

<dependency>
    <groupId>io.github.msaifasif</groupId>
    <artifactId>cqengine</artifactId>
    <version>1.0.0</version>
</dependency>

2. Create and Query Your Collection

import com.googlecode.cqengine.*;
import com.googlecode.cqengine.query.Query;
import static com.googlecode.cqengine.query.QueryFactory.*;

// Create an indexed collection
IndexedCollection<Car> cars = new ConcurrentIndexedCollection<>();

// Add indexes for fast queries
cars.addIndex(NavigableIndex.onAttribute(Car.CAR_ID));
cars.addIndex(HashIndex.onAttribute(Car.MANUFACTURER));
cars.addIndex(NavigableIndex.onAttribute(Car.PRICE));

// Add data
cars.add(new Car(1, "Ford", "Focus", Color.BLUE, 5, 9000.50));
cars.add(new Car(2, "Honda", "Civic", Color.RED, 5, 5000.00));

// Query with SQL-like syntax
Query<Car> query = and(
    equal(Car.MANUFACTURER, "Ford"),
    lessThan(Car.PRICE, 10000.0)
);

ResultSet<Car> results = cars.retrieve(query);
for (Car car : results) {
    System.out.println(car);
}

Real-World Usage

"Used for exposure and counterparty limit checking in financial trading systems."

Excelian - Financial Technology

"Powers our marketing intelligence platform with real-time data analysis."

Gravity4 - Marketing Platform

"Processes 3-5 billion requests per day with ultra-low latency requirements."

Snapdeal - E-commerce Platform

Why This Fork?

This is a maintained fork of the original CQEngine by Niall Gallagher, updated for modern Java development.

✅
Java 21 Support

Full compatibility with latest Java features

🔄
Updated Dependencies

All dependencies updated with security fixes

ðŸģ
Docker Testing

OS-independent integration tests

🚀
Active Maintenance

Continued development and support