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

[STEP 1-3] url-shortener 기능 정의 #65

Open
wants to merge 2 commits into
base: MyLittleChicken
Choose a base branch
from

Conversation

MyLittleChicken
Copy link
Collaborator

@MyLittleChicken MyLittleChicken commented Feb 28, 2025

안녕하세요 왓에버 기획자님!
현재 운영중인 url-shortener 서비스의 기능들에 대해
질문드릴 점이 있어 PR 드립니다.
부담 갖지 마시고 편하게 해주세요😊

🧑‍💻질문 사항

1. url 단축 기능

  • 단축된 url 은 몇 자가 적당할까요?
  • 단축된 url 은 고유해야 할까요?
  • 단축된 url 은 영구적으로 보관되어야 할까요?

Copy link
Collaborator

@Hyune-c Hyune-c left a comment

Choose a reason for hiding this comment

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

기획자) 네 좋다고 생각해요. (사실 별 생각 없음)
  • 단축된 url 은 고유해야 할까요?
기획자) 네. 그래야되지 않을까요?
  • 단축된 url 은 영구적으로 보관되어야 할까요?
기획자) 그랬으면 좋겠어요. 나중에 과금안에 따른 보관 기간 차등을 만들건데, 영구 보관도 플랜에 넣을 것 같아요.

1. 제한사항 항목 추가
2. 중복, 길이, 형태에 대한 제한 추가
- 단축 url(key) 는 서비스 내에서 `고유`하며, 하나의 url 을 가르킵니다.

## 2. 길이 제한
- 단축 url(key) 는 `7자리` 의 길이로 표현합니다.
Copy link
Collaborator Author

@MyLittleChicken MyLittleChicken Mar 6, 2025

Choose a reason for hiding this comment

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

다음과 같은 내용을 고려했습니다.

  • base62 를 통해 encode 하는 경우 최대 약 3.5조(62^7) 까지의 숫자를 7자리의 문자로 표현 가능합니다.
  • epoch time (ms) 를 통해 key 를 생성하는 경우 약 2081년 까지 7자리의 문자로 표현 가능합니다.
  • ms 를 사용하므로 중복 제거를 통해 초당 최대 1000개의 고유한 key 생성이 가능할 것으로 예상됩니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

base62 를 통해 hashing 하는 경우 최대 약 3.5조(62^7) 까지의 숫자를 7자리의 문자로 표현 가능합니다.

  • encode vs hash vs encrypt

ms 변환을 통해 초당 최대 1000개의 고유한 key 생성이 가능할 것으로 예상됩니다.

  • 채번 시점 1천개 vs 중복 제거 후 1천개

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

encode vs hash vs encrypt

  • 용어의 혼동이 있었습니다. 정확하게는 encode 가 맞는 표현입니다.
  • encode 는 암호화 시 key 가 필요하지 않으며 복호화 를 통해 원래 형태로 되돌릴 수 있습니다. (양방향)
  • hash 는 마찬가지로 암호화 시 key 가 필요하지 않으며, encode 와 다르게 원래 형태로 되돌릴 수 없습니다. (단방향)
  • encrypt 는 암호화 시 적절한 key 를 필요로 하며, key 를 이용하여 원래 형태로 되돌릴 수 있습니다. (양방향)
  • ref Encryption vs Encoding vs Hashing

채번 시점 1천개 vs 중복 제거 후 1천개

  • 채번 시점에서는 1000개를 초과할 수 있습니다.
  • 고유한 key 생성이라는 단서를 놓고 봤을 때 충분히 의미가 전달될 수 있다고 생각했습니다.
  • 다만 중복 제거 후 1000개가 더 명확한 표현임은 확실합니다.

피드백 주신 내용 두건 모두 반영하여 수정 진행하겠습니다.
감사합니다.

@MyLittleChicken MyLittleChicken requested a review from Hyune-c March 6, 2025 04:20
- 단축 url(key) 는 서비스 내에서 `고유`하며, 하나의 url 을 가르킵니다.

## 2. 길이 제한
- 단축 url(key) 는 `7자리` 의 길이로 표현합니다.
Copy link
Collaborator

Choose a reason for hiding this comment

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

base62 를 통해 hashing 하는 경우 최대 약 3.5조(62^7) 까지의 숫자를 7자리의 문자로 표현 가능합니다.

  • encode vs hash vs encrypt

ms 변환을 통해 초당 최대 1000개의 고유한 key 생성이 가능할 것으로 예상됩니다.

  • 채번 시점 1천개 vs 중복 제거 후 1천개

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants