-
Notifications
You must be signed in to change notification settings - Fork 0
[Chanyeol] Week 10 미션 #116
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
Open
coconutcococode
wants to merge
1
commit into
main
Choose a base branch
from
Chanyeol-week10
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+87
−142
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| - 클라우드 컴퓨팅이란? | ||
| - 서버, 저장소, 데이터베이스, 네트워크 같은 IT 자원을 직접 구매하고 관리하지 않고, 인터넷을 통해 필요할 때 빌려 쓰는 방식 | ||
| - 서버를 안쓰는 것이 아닌 서버 운영 책임의 일부를 전문 업체에 맡기는 방식 | ||
| - 대표 유형 | ||
| - IaaS: 서버, 네트워크, 스토리지 같은 인프라를 빌림. 예: EC2, Compute Engine | ||
| - PaaS: 앱 실행 플랫폼까지 제공. 개발자는 코드와 설정에 집중. 예: App Engine, Elastic Beanstalk | ||
| - SaaS: 완성된 소프트웨어를 서비스로 사용. 예: Gmail, Slack, Notion | ||
| - 장점: 빠른 배포, 탄력적 확장, 초기 비용 절감, 글로벌 배포, 관리 부담 감소 | ||
| - 단점: 비용 구조 복잡, 특정 클라우드에 종속, 보안 설정을 잘못하는 경우 위험이 커짐 | ||
| - AWS? GCP? | ||
| - AWS는 Amazon Web Services의 약자로, Amazon이 제공하는 클라우드 플랫폼. 컴퓨팅, 스토리지, 데이터베이스, 네트워크, AI, 보안 등 폭넓은 서비스 제공 | ||
| - GCP: 공식적으로 Google Cloud라고 부름. Google 검색, Gmail, YouTube 등에 쓰이는 인프라 기반 위에서 컴퓨팅, 스토리지, 데이터 분석, 머신러닝 서비스를 제공 | ||
|
|
||
| | 항목 | AWS | GCP | | ||
| | --- | --- | --- | | ||
| | 강점 | 서비스 종류가 많고 생태계가 큼 | 데이터, AI, Kubernetes, 네트워크 강점 | | ||
| | 대표 서비스 | EC2, S3, RDS, Lambda, ECS | Compute Engine, Cloud Storage, BigQuery, Cloud Run, GKE | | ||
| | 장점 | 자료 많음, 기업 도입 많음, 선택지 넓음 | BigQuery, GKE, Cloud Run 같은 관리형 서비스가 강력함 | | ||
| | 단점 | 서비스와 요금 체계가 복잡함 | AWS보다 국내 자료/레퍼런스가 적게 느껴질 수 있음 | | ||
| - 환경변수 처리 방법과 왜 환경변수로 민감 정보를 가려야 하는가? | ||
| - 환경변수는 실행 환경마다 달라지는 설정값을 코드 밖에서 주입하는 방법 | ||
| - 예를 들어 DB 주소, DB 계정, API Key, JWT Secret 같은 값이 여기에 해당 | ||
| - Spring Boot도 `application.properties`, `application.yml`, 환경변수, 커맨드라인 인자 등 외부 설정을 지원. 특히 OS 환경변수는 Spring 설정으로 바인딩 될 수 있음 | ||
| - 민감 정보를 환경변수로 분리해야 하는 이유 | ||
| - GitHub에 비밀번호, API Key가 올라가는 사고를 막기 위해 | ||
| - 개발, 테스트, 운영 환경마다 값을 다르게 주입하기 위해 | ||
| - 같은 코드로 여러 환경에 배포하기 위해 | ||
| - 비밀번호 교체 시 코드를 수정하지 않기 위해 | ||
| - yml 환경 분리 방법 | ||
|
|
||
| Spring Boot에서는 보통 `application.yml`에 공통 설정을 두고, 환경별로 `application-dev.yml`, `application-prod.yml`을 나눌 수 있음 | ||
|
|
||
| ``` | ||
| application.yml | ||
| application-dev.yml | ||
| application-prod.yml | ||
| ``` | ||
|
|
||
| 실행 시 활성 프로필을 지정 | ||
|
|
||
| ``` | ||
| SPRING_PROFILES_ACTIVE=dev java -jar app.jar | ||
| ``` | ||
|
|
||
| 또는 | ||
|
|
||
| ``` | ||
| java -jar app.jar --spring.profiles.active=prod | ||
| ``` | ||
|
|
||
| Spring Boot 공식 문서에 따르면 `spring.profiles.active`로 활성 프로필을 지정할 수 있고, 프로필별 설정 파일도 로드됨 | ||
|
|
||
| 다른 방법으로 하나의 `application.yml` 안에서 `---`로 문서를 나누는 방법 | ||
|
|
||
| ``` | ||
| spring: | ||
| application: | ||
| name: my-app | ||
|
|
||
| --- | ||
| spring: | ||
| config: | ||
| activate: | ||
| on-profile: dev | ||
|
|
||
| server: | ||
| port: 8080 | ||
|
|
||
| --- | ||
| spring: | ||
| config: | ||
| activate: | ||
| on-profile: prod | ||
|
|
||
| server: | ||
| port: 80 | ||
| ``` | ||
|
|
||
| Spring Boot는 YAML의 multi-document 문법을 지원하고, `spring.config.activate.on-profile`로 특정 프로필에서만 설정을 활성화 가능 | ||
|
|
||
| - Docker와 .jar vs Docker 이미지 | ||
|
|
||
| `Docker`는 애플리케이션을 컨테이너로 패키징하고 실행하게 해주는 플랫폼입니다. Docker 공식 문서에 따르면 컨테이너는 애플리케이션 컴포넌트를 격리된 환경에서 실행하는 프로세스이며, 독립적이고 이식성이 좋습니다. | ||
|
|
||
| `.jar`는 Java Archive입니다. Oracle 공식 JAR 명세에 따르면 JAR 파일은 ZIP 기반 파일 형식이며 여러 파일을 하나로 묶는 데 사용됩니다. 실행 가능한 JAR은 `Main-Class`를 통해 `java -jar app.jar` 형태로 실행됩니다. | ||
|
|
||
| `Docker image`는 컨테이너 실행에 필요한 파일, 바이너리, 라이브러리, 설정을 담은 표준 패키지입니다. Docker 이미지는 불변이며 여러 레이어로 구성됩니다. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Markdown 표 구분선 앞에 들여쓰기가 들어가 있어 일부 뷰어에서 표로 렌더링되지 않을 수 있습니다.
| --- | --- | --- |처럼 헤더 바로 아래에 같은 들여쓰기 없이 맞추는 것을 권장합니다.