TECHNICAL KNOWLEDGE BASE

[Section 0.] Microservice와 Spring Cloud 소개

Microservice란? Microservice와 SOA Spring Cloud란? 필수 SW 설치 1. IntelliJ IDEA Ultimate https://www.jetbrains.com/ko kr/idea 2. Git https://git scm.com 3.

MSA
MSALegacy Note

Legacy Engineering Note · 기존 기술 블로그에서 선별 이관한 기록입니다. 작성 당시 환경과 버전을 기준으로 합니다.

Microservice란?

Microservice와 SOA

Spring Cloud란?

필수 SW 설치

  1. IntelliJ IDEA Ultimate

  2. Git

  3. Visual Studio Code

  4. Postman

강의에 사용된 코드 github 주소

Microservice와 Spring Cloud의 소개

Cloud Native Application CD/CD

  • 지속적인 통합(결과물 통합, 코드 통합)

    • 통합 서버, 소스관리(SCM), 빌드 도구, 테스트 도구
    • ex) Jenkins, Team CI, Travis CI
  • 지속적인 배포(어떻게 배포하는지에 따라 나뉘어짐)

    • Continuous Delivery
      • 패키지화 되어있는 결과물을 실행환경에 수작업으로 배포
    • Continuous Deployment
      • 관리자의 개입 없이 실행 환경까지 자동화된 배포
    • pipe line
  • 카나리 배포와 블루그린 배포

Microservice의 특징

  1. Challenges
  2. Small Well Chosen Deployable Units
  3. Bounded Context
  4. RESTful
  5. Configuration Management
  6. Cloud Enabled
  7. Dynamic Scale Up And Scale Down
  8. CI/CD
  9. Visibility

Everything should be a microservice

  • q1) Multiple Rates of Change
  • q2) Independent Life Cycles
  • q3) Independent Scalability
  • q4) Isolated Failure
  • q5) Simplify Interactions with External Dependencies
  • q6) Polyglot Technology

SOA(Service-Oriented Architecture)와 MSA와의 차이점

  • 서비스 공유 지향점

    • SOA - 재사용을 통한 비용 절감
    • MSA - 서비스간의 결합도를 낮추어 변화에 능동적 대응
  • 기술 방식

    • SOA - 공통의 서비스를 ESB에 모아 사업 측면에서 공통 서비스 형식으로 서비스 제공
    • MSA - 각 독립된 서비스가 노출된 REST API를 사용

"A way to grade your API according to the constraints of REST"

RESTful Web Service

  • Consumer first

  • Make best use of HTTP

  • Request methods

    • GET
    • POST
    • PUT
    • DELETE
  • Response Status

    • 200
    • 404
    • 400
    • 201
    • 401
  • No Secure info in URI

  • Use plurals

    • prefer /users to /user
    • prefer /users/1 to/user/1
  • User nouns for resources

  • For exceptions

    • define a consistent approach /search PUT/gists/{id}/star/ DELETE/fists/{id}/star

Microservice Architecture Structures

Service Mesh Capabilities

  • Service Mesh :
    • MSA를 적용한 System 내부 통신
    • Service Mesh를 통해 Service간 통신을 추상화 및 안전하고 빠르게만들어주는 Infra structure의 layer
  • MSA 인프라 > 미들웨어
    • 프록시 역할, 인증, 권한 부여, 암호화, 서비스 검색, 요청 라우팅, 로드 밸런싱
    • 자가 치유 복구 서비스
  • 서비스간의 통신과 관련된 기능을 자동화

MSA 표준 구성 요소

  • CNCF(Cloud native Computing Foundation)
    • Cloud Native Interactive Landscape

MSA 기반 기술

Spring Cloud

https://spring.io/projects/spring-cloud

  • Spring Boot + Spring Cloud
    • Table 1. Release train Spring Boot compatibility
Release TrainRelease Train
2022.0.x aka Kilburn3.0.x, 3.1.x (Starting with 2022.0.3)
2021.0.x aka Jubilee2.6.x, 2.7.x (Starting with 2021.0.3)
2020.0.x aka Ilford2.4.x, 2.5.x (Starting with 2020.0.3)
Hoxton2.2.x, 2.3.x (Starting with SR5)
Greenwich2.1.x
Finchley2.0.x
Edgware1.5.x
Dalston1.5.x

Main Projects

  • Spring Cloud Config

Spring Cloud