Skip to content

[BE] 동시편집 Redis 연동#373

Merged
w0uldy0u merged 16 commits intodevfrom
feat/#356/use_redis_to_save_yjs_update
Feb 16, 2026
Merged

[BE] 동시편집 Redis 연동#373
w0uldy0u merged 16 commits intodevfrom
feat/#356/use_redis_to_save_yjs_update

Conversation

@w0uldy0u
Copy link
Collaborator

Closes #356

목적

작업 내용

  • Redis 연동
  • Update 프레임인지 판별
  • Redis에 XADD
  • 로컬, 스테이징 환경 Docker compose 작성

결과

image image

@w0uldy0u w0uldy0u requested a review from kimhji February 14, 2026 17:04
@w0uldy0u w0uldy0u self-assigned this Feb 14, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @w0uldy0u, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 실시간 동시 편집 기능을 지원하기 위해 백엔드에 Redis 연동을 도입합니다. 주요 변경 사항은 Yjs 프로토콜을 사용하여 클라이언트로부터 수신되는 업데이트 프레임을 감지하고, 이를 Redis Stream에 기록하여 데이터의 일관성과 실시간 동기화를 보장하는 것입니다. 또한, 개발 및 스테이징 환경에서 Redis를 쉽게 배포하고 관리할 수 있도록 Docker Compose 설정을 업데이트했습니다.

Highlights

  • Redis 연동: 동시 편집 기능의 기반을 마련하기 위해 백엔드에 Redis 연동을 도입했습니다.
  • Yjs 업데이트 프레임 감지: Yjs 프로토콜의 업데이트 프레임을 식별하는 로직을 추가하여 실시간 변경 사항을 정확히 파악할 수 있도록 했습니다.
  • Redis Stream에 업데이트 기록: 감지된 Yjs 업데이트 프레임을 Redis Stream에 저장하도록 구현하여 데이터의 일관성과 실시간 동기화를 지원합니다.
  • Docker Compose 환경 설정: 로컬 및 스테이징 환경에서 Redis를 쉽게 배포하고 관리할 수 있도록 Docker Compose 설정을 업데이트했습니다.
Changelog
  • backend/api/build.gradle
    • spring-boot-starter-data-redis 의존성을 추가했습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/CollaborationService.java
    • RedisStreamRepositoryRedisStreamStore로 변경하고, Yjs 업데이트 프레임을 감지하여 Redis에 추가하는 로직을 구현했습니다.
    • ByteBufferbyte[]로 변환하는 유틸리티 메서드를 추가했습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/RedisStreamRepository.java
    • 사용되지 않는 RedisStreamRepository 파일을 제거했습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/RedisStreamStore.java
    • Redis Stream 작업을 위한 새로운 서비스 클래스를 추가했습니다.
    • 이 클래스는 업데이트를 Redis Stream에 추가하고 스트림에 만료 시간을 설정하는 기능을 제공합니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/YjsProtocolUtil.java
    • Yjs 프로토콜 메시지에서 업데이트 프레임을 식별하는 정적 유틸리티 클래스를 추가했습니다.
  • backend/api/src/main/java/com/yat2/episode/global/config/RedisConfig.java
    • RedisTemplate<String, byte[]> 빈을 정의하여 Redis와의 바이트 배열 데이터 통신을 설정하는 Redis 구성 클래스를 추가했습니다.
  • backend/api/src/main/resources/application.yml
    • Redis 연결을 위한 호스트, 포트, 비밀번호 환경 변수 설정을 추가했습니다.
  • backend/docker-compose.yml
    • 로컬 개발 환경에서 Redis를 실행하기 위한 redis 서비스를 추가했습니다.
    • redis-data 볼륨을 정의했습니다.
  • infra/prod/docker-compose.yml
    • Caddy 서비스에 UDP 포트 443을 추가했습니다.
  • infra/stage/docker-compose.yml
    • api 서비스가 mysqlredis 서비스에 의존하도록 설정했습니다.
    • redis 서비스와 minio 서비스에 헬스 체크를 추가했습니다.
    • redis 서비스를 정의하고 redis-data 볼륨을 추가했습니다.
Activity
  • 현재까지 이 Pull Request에 대한 사람의 활동(댓글, 리뷰 등)은 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 동시 편집 기능을 위해 Redis를 연동하여 Yjs 업데이트 프레임을 Redis Stream에 저장하는 작업을 포함합니다. 주요 변경 사항은 다음과 같습니다:

  • Redis 의존성 및 설정 추가
  • CollaborationService가 업데이트 프레임을 Redis로 전송하도록 수정
  • Redis Stream 작업을 처리하는 새로운 RedisStreamStore 추가
  • 업데이트 프레임을 식별하기 위한 YjsProtocolUtil 추가
  • 로컬 및 스테이징 환경의 docker-compose.yml에 Redis 서비스 추가 (헬스 체크 및 서비스 의존성 설정 포함)

전반적으로 코드가 잘 구조화되어 있으며 애플리케이션의 안정성을 향상시키는 좋은 변경입니다. RedisStreamStore의 Redis 명령어 원자성 및 YjsProtocolUtil의 로직에 대해 몇 가지 제안 사항이 있습니다.

@w0uldy0u
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebf4fe8be1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Collaborator

@kimhji kimhji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코멘트 체크 부탁드립니다! 👍

@w0uldy0u w0uldy0u requested a review from kimhji February 15, 2026 18:28
Copy link
Collaborator

@kimhji kimhji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

@w0uldy0u w0uldy0u merged commit b5b9642 into dev Feb 16, 2026
4 checks passed
@w0uldy0u w0uldy0u deleted the feat/#356/use_redis_to_save_yjs_update branch February 16, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE] 동시편집에 Redis Stream 연동

2 participants

Comments