How theopfr/cachew-db works
Main Components
a) Server Component (cachew):
• Authentication Module
• Database Engine (B-tree implementation)
• Protocol Handler (CASP)
• Command Processor
• State Manager
• Error Handler
b) Client Components:
• CLI Client
• Python Client (planned)
• Dashboard (planned)
[Client Layer]
• ↕ CASP Protocol
[Server Layer]
• ↕
[Storage Layer]
Detailed Component Breakdown
• Surround it with the State Manager
• Command Processor interface
• Authentication Module
• Error Handler spanning across components
b) Protocol Layer (Between Server and Clients):
• CASP Protocol handler
• Bidirectional communication flows
• Authentication flow
c) Client Layer (Top):
• CLI Client
• Placeholder for Python Client
• Placeholder for Dashboard
• All connecting through CASP
Specific Elements
⬡ Server Components
⬢ Active Clients
⬣ Planned Clients
→ Data Flow
⇢ Authentication Flow
Key Relationships to Highlight
• How authentication flows through the system
• B-tree's relationship with the command processor
• Demonstrate concurrent client handling
• Error propagation paths
Technical Details
• Port/Host configuration (8080 default)
• Supported data types (STR, INT, FLOAT, BOOL, JSON)
• Command processing flow
• In-memory storage indication
Implementation Notes
• The non-persistent, in-memory nature
• Type safety mechanisms
• Concurrent client handling
• The ordered nature of the B-tree storage
Future Extension Points
Placeholder connections for:
• Persistence layer (planned)
• Additional client implementations
• Dashboard integration
• INCR/DECR command support