{"id":27957811,"url":"https://github.com/glyphack/redis-clone","last_synced_at":"2025-05-07T18:14:44.687Z","repository":{"id":268243787,"uuid":"903458802","full_name":"Glyphack/redis-clone","owner":"Glyphack","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-05T17:49:39.000Z","size":365,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T18:14:39.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Glyphack.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}},"created_at":"2024-12-14T16:56:21.000Z","updated_at":"2025-04-05T17:49:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"949cb69c-4a5a-4fd8-92ac-21753b38ebbf","html_url":"https://github.com/Glyphack/redis-clone","commit_stats":null,"previous_names":["glyphack/redis-clone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fredis-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fredis-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fredis-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glyphack%2Fredis-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glyphack","download_url":"https://codeload.github.com/Glyphack/redis-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931539,"owners_count":21827112,"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":"2025-05-07T18:14:44.200Z","updated_at":"2025-05-07T18:14:44.675Z","avatar_url":"https://github.com/Glyphack.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"My solution to [\"Build Your Own Redis\" Challenge](https://codecrafters.io/challenges/redis).\nThis is a Redis clone that I built. It implements part of the Redis protocol (RESP 2) and supporting several commands.\n\n## Features\n\n- **Basic Commands**: `GET`, `SET`, `PING`\n- **Concurrency**: Supports multiple concurrent clients\n- **Persistence**: Loads RDB files and serves the content\n- **Replication**:\n  - Performs replication handshake\n  - Propagates commands to replicas\n  - Supports the `WAIT` command for synchronization of replicas\n- Latency of `GET` and `SET` commands are similar to original Redis server! No libraries used.\n\n## Architecture\n\n- Uses an **event loop**\n- Runs on a **single thread**\n\n## Usage\n\n```\nmake build\n./build/redis\n```\n\nSend messages using `redis-cli ping`. Try other commands.\n\nTo run a replica run:\n\n```\n./build/redis --replicaof 6379\n```\n\n## Technical Deep Dives\n\n- Implemented binary protocol parsing\n- Built a non-blocking I/O system\n- Managed concurrent client connections\n- Used my own hash map: https://nullprogram.com/blog/2023/09/30/\n- Used memory arena for easier memory management: https://nullprogram.com/blog/2023/09/27/\n- Used custom string type to avoid limitations of C strings: https://nullprogram.com/blog/2023/10/08/\n- Created a master-replica synchronization mechanism\n- Handled data persistence with RDB files\n\n## What I Learned\n\n- Network programming and protocol implementation\n- Async programming in C\n- Distributed systems concepts through replication\n- High-performance tcp server design\n- Implemented a hash map in C\n- Using my custom allocator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglyphack%2Fredis-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglyphack%2Fredis-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglyphack%2Fredis-clone/lists"}