How destrivate/ddb works
DDB is a small in-memory key-value database exposed over TCP. Its main workflow starts at the process entry point, loads optional pipe-delimited defaults into the shared store, then accepts client connections; each handler dispatches set/get/del commands to the store and sends the resulting status or value back. Configuration supplies the port and default-file path. The README documents syntax-error responses, though the sampled handler does not cover every malformed-command case; other runtime links are shown only where the excerpts establish them.
Main entry points: main.cpp Process startup · server.cpp Command handler · ddb.cpp Key-value operations · ddb.hpp In-memory map
Components 10
Startup
- Process startup
src/main.cpp - Default loader
src/main.cpp
TCP Server
- TCP server
src/server/server.cpp - Command handler
src/server/server.cpp
Key-Value Storage
- Key-value operations
src/storage/ddb.cpp - In-memory map
src/storage/ddb.hpp
Runtime Support
- Config reader
include/config_utility.hpp - Logger
include/logger.hpp
Other components
- Default data file
default.txt - TCP client
Connections 12
- Process startup → Config reader: reads settings
src/main.cpp - Process startup → Logger: logs port
src/main.cpp - Process startup → Default loader: loads defaults
src/main.cpp - Default loader → Default data file: reads rows
src/main.cpp - Default loader → Key-value operations: inserts values
src/main.cpp - Process startup → TCP server: starts server
src/main.cpp - TCP server → TCP client: accepts connections
src/server/server.cpp - TCP client → Command handler: sends commands
- TCP server → Command handler: dispatches clients
src/server/server.cpp - Command handler → Key-value operations: calls operations
src/server/server.cpp - Key-value operations → In-memory map: reads and writes
src/storage/ddb.cpp - Command handler → TCP client: sends replies
src/server/server.cpp