| Crates.io | datastore-emulator |
| lib.rs | datastore-emulator |
| version | 0.1.0 |
| created_at | 2025-10-17 23:22:37.428615+00 |
| updated_at | 2025-10-17 23:22:37.428615+00 |
| description | A Google Cloud Datastore emulator written in Rust. |
| homepage | https://github.com/guibeira/datastore-emulator |
| repository | https://github.com/guibeira/datastore-emulator |
| max_upload_size | |
| id | 1888570 |
| size | 438,399 |
This project is a custom implementation of the Google Cloud Datastore emulator, written in Rust. It is designed to be a lightweight, high-performance alternative to the official Google emulator for local development and testing.
The repository includes a comprehensive test suite that runs against both this custom emulator and the official Google Datastore emulator to ensure a high degree of API compatibility.
Core Datastore API: Supports standard gRPC operations like Lookup, RunQuery, and Commit.
Mutations: Full support for Insert, Update, Upsert, and Delete operations.
Transactions: Implements BeginTransaction, Commit, and Rollback.
Querying: Supports property filters (=, !=, <, >, etc.) and composite filters.
Aggregation Queries: Supports COUNT, SUM, and AVG aggregations.
ID Management: Implements AllocateIds and ReserveIds.
Data Import: An HTTP endpoint to import data from official Datastore exports.
Make sure you have the following prerequisites installed on your system:
rustup)protoc)To build the Rust emulator, navigate to the project root and run:
cargo run --release
See the test instructions
Here are some results with 30 clients and 10 runs each:
| Operation | Total Time (Rust) | Total Time (Java) | Avg Time/Client (Rust) | Avg Time/Client (Java) | Verdict |
|---|---|---|---|---|---|
| Single Insert | 1.6883s | 95.1637s | 0.0563s | 3.1721s | Rust 56.37x faster |
| Bulk Insert (50) | 17.7474s | 375.3370s | 0.5916s | 12.5112s | Rust 21.15x faster |
| Simple Query | 20.5427s | 62.8813s | 0.6848s | 2.0960s | Rust 3.06x faster |
If you want to run the benchmarks yourself, run the following commands:
docker compose up --build -d
install python dependencies:
poetry install --no-root && poetry env activate
and then run the benchmarks:
python benchmark/test_benchmark.py --num-clients 30 --num-runs 10