AI-Optimized Custom Database Engine - Built entirely in TypeScript for LLM and AI Models
Developed by Ecocee - Next-Generation AI & Embedded Systems Engineering
- About Ecocee
- Overview
- Key Features
- Why SNAILDB?
- Quick Start
- Installation
- Real-World Use Cases
- Production Ready
- Documentation
- Support & Community
Ecocee is a next-generation AI and Embedded Systems engineering company specializing in:
- Artificial Intelligence Frameworks - Advanced ML models and algorithms
- Embedded Firmware - Real-time embedded systems
- IoT Architectures - Connected device ecosystems
- Automation Platforms - Intelligent process automation
- Secure Digital Technologies - Enterprise security solutions
We blend research, innovation, and practical engineering to deliver reliable, scalable, and future-ready solutions for industrial, commercial, and modern enterprise applications.
SNAILDB represents our commitment to providing production-grade, AI-first database technology that is open-source, self-hosted, and designed specifically for the LLM/AI revolution.
- Website: ecocee.in
- GitHub: github.com/ecocee/snaildb
- Email: info@ecocee.in
SNAILDB is a production-grade, self-hosted database designed specifically for AI/LLM applications with:
- High-Performance Vector Search - HNSW indexing for semantic embeddings
- Built-in Persistence - Write-Ahead Logs + RDB checkpoints
- Security First - Authentication, encryption, rate limiting
- Fast In-Memory Storage - Optimized for latency-sensitive operations
- AI-Ready - Purpose-built for LLM embeddings and semantic search
- Full Monitoring - Metrics, health checks, diagnostics
- Replication Ready - Master-slave architecture support
- Self-Hosted - Complete control, no vendor lock-in
- Docker Ready - Kubernetes-compatible deployment
- Open Source - MIT license, community-driven
- HNSW Algorithm - Hierarchical Navigable Small World indexing
- 384-dimensional support - Optimized for modern LLM embeddings
- Multiple distance metrics - Cosine, Euclidean, Dot Product
- Real-time indexing - Add vectors without rebuilding
- Batch operations - Efficient bulk inserts and searches
- Write-Ahead Logs (WAL) - Crash-safe operations
- RDB Snapshots - Periodic checkpoints with compression
- Automatic recovery - Replay logs on restart
- Configurable intervals - Tune performance vs durability
- Optional authentication - Server password protection
- Network isolation - Self-hosted, no external dependencies
- Rate limiting - Prevent abuse and DoS attacks
- Input validation - Secure command processing
- Audit logging - Track all operations
- 40,000+ SET ops/sec - High-throughput writes
- 60,000+ GET ops/sec - Sub-millisecond reads
- 10,000+ vector queries/sec - Fast semantic search
- LRU/LFU eviction - Efficient memory management
- Configurable memory limits - 512MB to multi-GB support
- LLM-optimized - Purpose-built for language models
- Context storage - Persist conversation state
- Semantic caching - Cache embeddings and results
- Session management - Track user interactions
- Prompt optimization - Store and retrieve prompt templates
- Real-time metrics - Connections, commands, errors
- Health checks - Verify server status
- Structured logging - Debug and audit trails
- Performance stats - Cache hits/misses, memory usage
- Prometheus-compatible - Integration with monitoring stacks
- No cloud vendor - Complete data control
- On-premises deployment - Full compliance support
- Network-isolated - Air-gapped environments supported
- Open source - Full transparency and auditability
- Customizable - Extend for specific needs
- Vector search built-in (Redis: add-on module)
- AI/LLM optimized design
- Smaller resource footprint
- Simpler deployment (no Lua scripting required)
- Perfect for semantic search workloads
- Simpler deployment (no Java/Python dependencies)
- All-in-one solution (no micro-services complexity)
- Lower latency for smaller datasets
- Faster iteration for prototyping
- Self-hosted, TypeScript native
- No subscription costs
- Complete data privacy
- Zero vendor lock-in
- Full customization control
- On-premises deployment
- Open source transparency
- Semantic search out-of-the-box
- LLM context caching
- Embedding storage optimized
- Session management built-in
- RAG pipeline ready
# Clone repository
git clone https://github.com/ecocee/snaildb.git
cd snaildb
# Install dependencies
npm install
# Build TypeScript
npm run build
# Start development server
npm run dev
# Server available at: snaildb://localhost:12222# Development mode (with hot reload)
npm run dev
# Production mode
npm run build
NODE_ENV=production npm run server:prod
# With custom configuration
npm run server -- --host 0.0.0.0 --port 9999 --password mypass
# Docker
docker build -t snaildb:latest .
docker run -p 12222:12222 -v snaildb-data:/app/data snaildb:latestimport SnailDBClient from './src/client/snaildb-client';
async function main() {
const client = new SnailDBClient({
uri: 'snaildb://localhost:12222',
timeout: 5000,
});
try {
// Connect
await client.connect();
console.log('Connected to SNAILDB');
// Store data
await client.set('user:1', {
name: 'Alice',
email: 'alice@example.com'
});
// Retrieve data
const user = await client.get('user:1');
console.log('User:', user);
// Vector search (AI embeddings)
const embedding = Array.from({ length: 384 }, () => Math.random());
await client.vectorSet('embedding:1', embedding, {
model: 'gpt-3.5',
text: 'Hello world'
});
const results = await client.vectorSearch(embedding, 10);
console.log('Search results:', results);
// Disconnect
await client.disconnect();
} catch (error) {
console.error('Error:', error);
}
}
main();# Start server in one terminal
npm run dev
# Run tests in another terminal
npm test # Jest tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
npm run test:simple # Simple integration testFor detailed installation instructions including Docker, Kubernetes, and cloud deployment, see INSTALLATION.md
Key methods:
- From source (development)
- npm package (when published)
- Docker (recommended for production)
- Kubernetes (enterprise deployments)
- Bare metal / VM (on-premises)
// Store and retrieve conversation context
await db.set(`context:${sessionId}`, {
messages: [...],
metadata: { model: 'gpt-4', tokens: 1250 }
});// Index documents and search by semantic similarity
const embedding = await model.embed(document);
await db.vectorSet(`doc:${id}`, embedding, { text: doc });
const similar = await db.vectorSearch(queryEmbedding, 10);// Track user sessions with metadata
await db.hset(`session:${id}`, 'user_id', userId, 'token', token);// Cache LLM responses to reduce API calls
await db.set(`cache:${hash}`, response, 86400); // 24h TTL// Implement per-user rate limiting
const count = await db.incr(`rate:${userId}`);
if (count > limit) throw new Error('Rate limited');For more examples, see EXAMPLES.md
- Authentication - Optional password protection
- Encryption - TLS ready (with reverse proxy)
- Rate limiting - Configurable per user/endpoint
- Input validation - All commands sanitized
- Error handling - Comprehensive error classes
- Audit logging - All operations logged
- Recovery - WAL-based crash recovery
- Testing - 14 comprehensive Jest tests
- Monitoring - Real-time metrics export
| Operation | Throughput | Latency |
|---|---|---|
| SET | 40,000+ ops/sec | <1ms |
| GET | 60,000+ ops/sec | <1ms |
| DEL | 35,000+ ops/sec | <1ms |
| Vector Search | 10,000+ queries/sec | 5-50ms |
| Batch (100 ops) | 5,000+ batches/sec | 10-20ms |
- Docker - Single container, all-in-one
- Docker Compose - Full stack with monitoring
- Kubernetes - Enterprise-grade orchestration
- VM/Bare Metal - Direct Node.js deployment
- Cloud - AWS, GCP, Azure compatible
| Document | Purpose |
|---|---|
| QUICKSTART.md | 5-minute quick start guide |
| INSTALLATION.md | Installation & deployment methods |
| API.md | Complete API reference |
| FEATURES.md | Feature matrix & capabilities |
| EXAMPLES.md | Real-world usage examples |
| SECURITY.md | Security best practices |
| ARCHITECTURE.md | Technical architecture |
| DEPLOYMENT.md | Production deployment guide |
| CONTRIBUTING.md | Contribution guidelines |
| PROJECT_STATUS.md | Project status & roadmap |
For enterprise support, training, and custom development:
- Website: ecocee.in
- Email: contact@ecocee.in
- LinkedIn: Ecocee
- Star the GitHub repo
- Fork for development
- Contribute - See CONTRIBUTING.md
- Suggest features - Open discussions
- Report bugs - GitHub Issues
- Docs - Full documentation
- Discussions - GitHub Discussions
- Issues - Report bugs
- Email - contact@ecocee.in
We welcome contributions! Please read CONTRIBUTING.md for:
- Development setup
- Code standards
- Pull request process
- Testing requirements
MIT License - See LICENSE file for details
Copyright (c) 2025 Ecocee
- Redis-compatible protocol mode
- GraphQL API
- Enhanced replication
- Distributed SQL queries
- GPU acceleration for vector search
- Time-series optimizations
- Kafka stream integration
- Machine learning model serving
- Distributed clustering
- Language - TypeScript 5.3+
- Runtime - Node.js 18+
- Storage - In-memory with RDB/WAL
- Vector Index - HNSW
- Testing - Jest
- Deployment - Docker, Kubernetes
- Monitoring - Prometheus-compatible
SNAILDB Redis Milvus Pinecone
─────────────────────────────────────────────────────
Vector Search Yes No Yes Yes
Self-Hosted Yes Yes Yes No
Simple Deploy Yes Yes No N/A
TypeScript Native Yes No No No
No External Deps Yes Yes No N/A
Open Source Yes Yes Yes No
AI/LLM Optimized Yes No Yes Yes
─────────────────────────────────────────────────────
- HNSW algorithm - Yu. A. Malkov and D. A. Yashunin
- Inspired by Redis, Milvus, and Weaviate
- Built with TypeScript and Node.js communities
- Website - ecocee.in
- Email - info@ecocee.in
- GitHub - @ecocee
- LinkedIn - Ecocee
Built for AI/LLM applications by Ecocee
Open Source | Production Ready | Self-Hosted
Version 2.0.0 | TypeScript | Node.js 18+ | MIT License
Last Updated: November 28, 2025
