Coder Social home page Coder Social logo

junha-ahn / kotlin-boot-deployment Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 160 KB

Study About Kotlin+Spring-Boot CI/CD

Dockerfile 3.65% Kotlin 25.43% Shell 29.68% HCL 41.25%
devcontainer docker-compose git-actions kotlin kubernetes spring-boot terraform

kotlin-boot-deployment's Introduction

We first make our habits, and then our habits make us. - John Dryden

kotlin-boot-deployment's People

Contributors

junha-ahn avatar

Watchers

 avatar

kotlin-boot-deployment's Issues

대기열 시스템 자료

레퍼지토리

대기열 및 MSA, k8s 기반으로 안정적인 콘서트 예매 사이트

  • 실제 우리가 구현하고자 하는 목표를 완벽하게 구현
  • Java로 짜여진 프로젝트

기프티콘 선착순 이벤트 (N명 화면에 남은 대기열 표출)

  • 가장 간단한 형태의 대기열 구현

Flab 대기열 프로젝트

  • Kotlin 기반

발표 자료 (영상)

[NDC] 실버바인 대기열 서버 설계 리뷰

  • 대기열은 예측 불가능(오픈런칭)한 경우를 대비하는 비상용
  • 사용자에게는 최악의 경험
  • '대기표'(순번) 발권 / '입장권' 검증 - 재사용공격 방지
  • stateless HTTP를 이용했다 모바일 환경의 경우 session이 끊길 수 있어서 (네트워크 이슈)
  • 대기열 서버가 죽으면? - 여러대일수는 없다. 이유는 서로 순서가 동일하지 않다

Airline Reservation System

Problem

  • Liimited Seats per flight
  • Multiple Users asking for the same seat
  • Handle flight booking along with payments (failure scenarios)

similar problems

  • other reservation systems : train, hotels, movies etc
  • Flash sale for resource contention

Non Functional Requirements

  • Highly available search system
  • Highly consistent booking system
  • Booking should handle concurrent booking request

APIs & Capacity Estimates

  • Scale
    • Daily Active Searches: 100K
    • Daily booking: 10K
    • Daily Fights: 100
  • TPS Estimation
    • Search: 100k/86400 = ~ 1TPS
    • Book: 10K/86400 = ~ 0.1 TPS

image

image

블로그 글

deployment

Todo

  • terraform with AWS
  • k8s
    • 1 ec2 for CP
    • 1 ec2 for Worker node
  • run spring boot hello world docker image on Worker node

메모용

대기열 작업 Follow up 가이드

https://github.com/f-lab-clone/queuing-system

첫번째 PR 을 통해 대기열 티켓을 발행하는 API 서버를 만들었습니다.

Nodejs가 익숙치 않다면 주요 체크 파일만 봐도 충분합니다.

두번째 PR을 통해 발행된 대기열 티켓(=Wating)을 입장시키는(Move into Running) 스케줄러를 개발했습니다.

현재 AWS development 환경에 배포 완료되었습니다. (물런 리뷰가 발생한다면, 수정해야겠지만요)

Todo

전체적으로 하단에 기재된 Todo List를 따라가시면됩니다.

박정섭

김민준

임하영

  • 대기열 PR 리뷰

만약 다 하셨다면 크게 세가지 루트가 있을 것 같습니다.

  1. 잔여 이슈 중 마음에 드는 것 처리
  2. 직접 K6 테스트해보기 (아래 성능테스트 Follow up 가이드 작성해놨으니 임하영수병님과 함께 따라해보세요~)
  3. Database 도서 학습
    • 추천: Real MySQL 8.0 (바이블)
    • 추천: 업무에 바로 쓰는 SQL 튜닝 (빠르게 필요한 부분만 읽어낼 수 있음)
    • 이 외에도 "SQL 튜닝, 인덱스, 실행계획" 등의 키워드가 포함된 책이면 자유롭게 읽어서 학습해보세요.

성능테스트 Follow up 가이드

현재 진행한 두가지 스파이크 테스트

실제로 어떻게 진행할 수 있을까?

  • kubectl 사용법 을 통해 가이드를 읽는다
  • 임하영 수병님과 손잡고 사지방가서 3명이서 한 1시간만 투자하면 될듯? 같이 배워서 하나씩 만들어보세용
  • 임하영수병님은 aws console 로그인 후 eksadmin (IAM User)의 key 발급해서 aws configure가능하게 해주시면 될듯요
  • 그 후 k6 어케하는지 설명 쭈욱

개인 메모용

2차 Spike Test 고려사항

현재 API 고도화(Pagenation) 지연으로 실행 불가능

Backend Pod 재실행 필요

kubectl delete replicaset <backend replica name>

하나의 이벤트에만 모든 트래픽이 몰려야한다.

  • 특정 Event ID를 준비해두자.

K6 옵션 noConnectionReuse 사용

about optimize docker image

  1. search specific docker image for JRE
  2. use docker image tag, not latest
  3. how about copy all source code into docker builder image and build inside the docker image (and use .dockerignore)
  4. use non-root user in docker image

study

study about --mount-type=cache

study about JIB and compare with "build with docker"

  • actually, we have to use docker in develop phase, because we want to setting our env as same as product
  • but why not study about new keyword

prepare-commit-msg hook for gitactions

commit

and I have to make some kind of final format check

  • commit message check in git actions(CI)
  • when running in both git actions and locally, I need to maintain some kind of consistency in the regular expression
  • ex) create a regular expression file and use it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.