{"id":15103663,"url":"https://github.com/ori0o0p/simple-redis-server","last_synced_at":"2026-01-19T03:33:40.945Z","repository":{"id":248908343,"uuid":"830147262","full_name":"ori0o0p/simple-redis-server","owner":"ori0o0p","description":"with netty framework!!","archived":false,"fork":false,"pushed_at":"2024-07-23T12:39:35.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T23:51:12.436Z","etag":null,"topics":["netty","redis-server"],"latest_commit_sha":null,"homepage":"","language":"Java","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/ori0o0p.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-07-17T17:27:58.000Z","updated_at":"2024-11-14T13:59:25.000Z","dependencies_parsed_at":"2024-09-20T10:00:41.631Z","dependency_job_id":"1c3493ca-8d0e-4561-9aab-2c1fdacd9c63","html_url":"https://github.com/ori0o0p/simple-redis-server","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"3871c8ed223c1ea2704bbc731157e9b6544ba3b3"},"previous_names":["ori0o0p/simple-redis-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ori0o0p%2Fsimple-redis-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ori0o0p%2Fsimple-redis-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ori0o0p%2Fsimple-redis-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ori0o0p%2Fsimple-redis-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ori0o0p","download_url":"https://codeload.github.com/ori0o0p/simple-redis-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247335510,"owners_count":20922445,"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":["netty","redis-server"],"created_at":"2024-09-25T19:41:18.713Z","updated_at":"2026-01-19T03:33:40.937Z","avatar_url":"https://github.com/ori0o0p.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netty-based Redis Server\n![image](https://github.com/user-attachments/assets/8b49a2f2-de6b-4e9a-ab9d-f5c475c8eab5)\n\n## 목표\n\n- 데이터 저장 : SET\n- 데이터 조회 : GET\n\nKey-Value 인메모리 스토어 역할을 할 수 있을 정도만 구현.\n\n예를 들어 Redis의 INCR, DEL과 같은 고오급~ 명령어는 구현 대상에서 제외.\n\nRedis Server만 구현 대상이기 때문에 Redis Client는 구현 대상에서 제외.\n\n### Netty Redis Server 구성 요소\n\n- Key-value 저장소 : In-memory Data Store\n    - Java Collections Framework의 Map 자료구조를 사용 예정\n    - Map 자료구조에서 Thread-safe하게 사용 가능한 ConcurrentMap 사용,\n      구현체로 ConcurrentHashMap 클래스 사용\n- 클라이언트 연결 수락을 하기 위한 Event Loop Group\n     ![image](https://github.com/user-attachments/assets/e9a612e5-9d53-4192-9c8a-78cfd328dc92)\n\n    - Netty Threading Model과 같이 클라이언트의 연결을 수락할 수 있는 Boss Group,\n      연결된 클라이언트의 실제 데이터 통신(I/O처리)를 하는 Worker Group으로 구성\n    - NIO API의 기능 활용하기 위해 NioEventLoopGroup 사용, Boss Group는 1개로 고정 NioEventLoopGroup(1)\n- Netty Server 설정 초기화의 단순화를 위한 헬퍼 클래스. Boot Strap\n    - ServerBootstrap을 사용하여 소켓 채널 바인딩, Event Loop Group 셋팅, 채널 초기화 pipeline 구성\n- 새로운 연결을 수락할 소켓 채널\n    - NIO API의 기능 활용하기 위해 NioServerSocketChannel 사용.\n![image](https://github.com/user-attachments/assets/60b5ddd6-9cd1-419f-af83-2c4ee33704d0)\n\n- 채널 초기화 pipeline\n  ![image](https://github.com/user-attachments/assets/6150cbb9-2d68-4387-ae60-6467c90c03f2)\n    \u003ci\u003e\u003csmall\u003e이해만을 돕기 위한 다이어그램\u003c/small\u003e\u003c/i\u003e\n    \n    - ServerBootstrap을 사용하여 채널 초기화 pipeline를 구성, ChannelPipeline를 사용하여  \n      인’아웃 바운드의 이벤트 흐름 제어\n    - Handler\n        - RedisDecoder, RedisBulkStringAggregator, RedisArrayAggregator 사용,\n          Redis 프로토콜을 디코딩하고, 적절한 객체로 변환할 수 있도록 도와주는 핸들러들\n    - RedisEncoder\n        - Redis 응답을 인코딩하여 클라이언트로 전송 역할\n    - RedisCommandHandler\n        - 실제 Redis 명령(인바운드 메시지)을 처리\n- 클라이언트의 인바운드 메세지 처리 로직\n    - GET, SET 메세지 처리 로직 구현 - channelRead0 메서드,\n      Redis 명령에 따른 적절한 명령 핸들러로 라우팅 (handleSetCommand, handleGetCommand)\n\n### 데이터 저장, 조회 처리 과정\n\n- GET : 데이터 조회\n    - 입력된 명령어의 인자 개수가 2개인지 검증 → GET {key}, 2개가 아니라면 에러 발생\n    - key 추출 후 해당 key로 dataStore에서 조회. 존재하지 않으면 NULL_INSTANCE 반환\n- SET : 데이터 저장\n    - 입력된 명령어의 인자 개수가 3개인지 검증 → SET {key} {value}, 3개가 아니라면 에러 발생\n    - key, value 추출 후 dataStore에 저장\n      데이터가 성공적으로 저장되면 클라이언트에게 OK 메시지 전송\n\n\n\n\n\u003cs\u003e저는 레디스가 싫어요\u003c/s\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fori0o0p%2Fsimple-redis-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fori0o0p%2Fsimple-redis-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fori0o0p%2Fsimple-redis-server/lists"}