Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agenda.voted, admin.agenda.voted api 수정 논의 #49

Open
Ariaspect opened this issue Aug 7, 2023 · 2 comments · May be fixed by #83
Open

agenda.voted, admin.agenda.voted api 수정 논의 #49

Ariaspect opened this issue Aug 7, 2023 · 2 comments · May be fixed by #83
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Ariaspect
Copy link
Contributor

Ariaspect commented Aug 7, 2023

현재의 agenda.voted, admin.agenda.voted api는 voters 오브젝트를 넘겨주는데 불필요하다는 생각을 했습니다. 이를 넘겨주기 위해 db에서 많은 정보에 접근해야하고 쿼리가 (최적화는 안했지만)복잡해지는 문제점이 있습니다.

Current Query (unoptimized)

select: {
  choice: {
    select: {
      agenda: {
        select: {
          choices: {
            select: {
              users: {
                select: {
                  user: {
                    select: {
                      id: true,
                      username: true,
                      displayName: true,
                    },
                  },
                },
              },
            },
          },
          voters: {
            select: {
              user: {
                select: {
                  id: true,
                  username: true,
                  displayName: true,
                },
              },
            },
          },
        },
      },
    },
  },
},

db 접근을 통해 전부 넘겨주는 형식이 아닌 변동사항(투표)만 넘겨주고, 로직 파트에서 업데이트 할 수 있도록 하면 어떤지 궁금합니다.
ex) agendaId, choiceId(, userId)만 넘겨주고, 프론트에서 이를 이용해 incremental 하게 업데이트 하기

@Ariaspect Ariaspect added enhancement New feature or request help wanted Extra attention is needed labels Aug 7, 2023
@SnowSuno
Copy link
Member

안그래두 확인하고 생각해보고 있던 부분이었어요
예전에 @kjy2844 랑도 간단히 얘기해보긴 했었는데 좋은 것 같아요!

다만 프론트에서 어떻게 잘 aggregate 해줄지 봐야할 것 같아서 요부분은 해당 부분 작업할때 함 같이 보면 좋을거같아요

@prectal123
Copy link
Contributor

무결성 문제가 해결되고 짧은 시간동안 여러 소켓 통신이 들어왔을때 핸들링만 잘 이루어진다면 이 방향이 변화가 좋을 것 같다고 생각합니다!

@Ariaspect Ariaspect linked a pull request Aug 16, 2023 that will close this issue
@SnowSuno SnowSuno added this to the Version 2 release milestone Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants