{"id":18487138,"url":"https://github.com/botirk38/fastkey","last_synced_at":"2025-07-19T09:34:28.076Z","repository":{"id":273424778,"uuid":"919587988","full_name":"botirk38/fastkey","owner":"botirk38","description":"A high-performance key-value store built with C, utilizing a thread pool for concurrency and the RESP protocol for communication.","archived":false,"fork":false,"pushed_at":"2025-07-03T13:48:12.000Z","size":356,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T14:50:38.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botirk38.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-20T17:04:24.000Z","updated_at":"2025-07-03T13:48:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"78a536e8-dded-428f-b1ee-20a5dfde4e5f","html_url":"https://github.com/botirk38/fastkey","commit_stats":null,"previous_names":["botirk38/fastkey"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/botirk38/fastkey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botirk38%2Ffastkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botirk38%2Ffastkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botirk38%2Ffastkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botirk38%2Ffastkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botirk38","download_url":"https://codeload.github.com/botirk38/fastkey/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botirk38%2Ffastkey/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265909822,"owners_count":23847506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T12:50:14.744Z","updated_at":"2025-07-19T09:34:28.064Z","avatar_url":"https://github.com/botirk38.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastKey - Redis Clone\n\n## Project Overview\nFastKey is a Redis clone implementation written in C that supports core Redis functionality including key-value storage, replication, streams, transactions, and concurrent client handling.\n\n### Key Features\n- **Redis Protocol Compatibility**: Implements Redis Serialization Protocol (RESP)\n- **Core Commands**: SET, GET, DEL, PING, ECHO, CONFIG, INFO, KEYS, TYPE, XADD, XRANGE, XREAD\n- **Replication**: Master-slave replication with PSYNC, REPLCONF commands\n- **Transactions**: MULTI, EXEC, DISCARD support\n- **Streams**: Redis streams with XADD, XRANGE, XREAD operations\n- **Concurrency**: Thread pool for handling multiple client connections\n- **Persistence**: RDB file format support\n- **Expiration**: TTL support for keys\n- **Logging**: Comprehensive logging system\n\n## Getting Started\n### Prerequisites\n- **C Compiler**: GCC or compatible C compiler\n- **POSIX Threads**: pthread library for threading support\n- **Standard C Libraries**: stdlib, string, time, etc.\n\n### Building\n```bash\n# Clone the repository\ngit clone https://github.com/botirk38/fastkey.git\ncd fastkey\n\n# Build using the provided script\n./your_program.sh\n\n# Or build manually\ngcc -o fastkey app/*.c -lpthread\n```\n\n### Running\n```bash\n# Start the server (default port 6379)\n./fastkey\n\n# Start with custom configuration\n./fastkey --port 8080 --dir /tmp --dbfilename dump.rdb\n\n# Start as replica\n./fastkey --replicaof localhost 6379\n```\n\n## Usage\n### Connecting\nConnect using any Redis client (redis-cli, telnet, etc.):\n```bash\nredis-cli -p 6379\n```\n\n### Supported Commands\n- **String Operations**: SET, GET, DEL\n- **Server**: PING, ECHO, CONFIG GET, INFO\n- **Keys**: KEYS, TYPE, EXPIRE\n- **Replication**: PSYNC, REPLCONF\n- **Transactions**: MULTI, EXEC, DISCARD\n- **Streams**: XADD, XRANGE, XREAD\n- **Blocking**: WAIT (master-replica synchronization)\n\n## Architecture\n### Core Components\n- **Server**: Main server loop and connection handling\n- **Client Handler**: Per-client connection management\n- **Command Parser**: RESP protocol parsing and command execution\n- **Redis Store**: In-memory key-value storage with thread safety\n- **Replication**: Master-slave replication logic\n- **Streams**: Redis streams implementation\n- **Thread Pool**: Concurrent client handling\n- **Logger**: Structured logging system\n\n### Thread Safety\nThe implementation uses read-write locks to ensure thread-safe access to the shared data store while allowing concurrent reads.\n\n## Configuration\n### Command Line Options\n- `--port`: Server port (default: 6379)\n- `--dir`: Working directory for RDB files\n- `--dbfilename`: RDB filename\n- `--replicaof`: Configure as replica of specified master\n\n### Environment\nLogging level can be configured via the logger initialization in main.c.\n\n## Development\n### Testing\nThis project includes a comprehensive test suite covering all core functionality:\n\n```bash\n# Build and run all tests\nmake test\n\n# Build the main application\nmake\n\n# Clean build artifacts\nmake clean\n```\n\n**Test Coverage:**\n- **Redis Store Module**: Key-value operations, expiry handling, type checking\n- **RESP Protocol**: Buffer management, string encoding, array parsing\n- **Command Execution**: PING, ECHO, SET, GET, TYPE commands\n- **Stream Operations**: Stream creation, entry management, range queries\n- **Integration Tests**: Server initialization, networking, concurrency\n\n**Test Results:**\n- 256 total tests with 100% pass rate\n- Memory leak detection and proper cleanup validation\n- Thread-safe operation testing\n\n\n### Code Quality\nThe codebase follows these principles:\n- Memory safety with proper cleanup\n- Thread safety for concurrent access\n- Error handling and logging\n- Modular design with clear separation of concerns\n\n## License\nThis project is for educational purposes and open source development.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotirk38%2Ffastkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotirk38%2Ffastkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotirk38%2Ffastkey/lists"}