전체 글
-
[AWS] SQS 사용시 주의사항AWS 2023. 6. 4. 00:01
SQS란? 대기열(Queue)를 제공하여 분산 소프트웨어 시스템과 구성요소를 통합 및 분리할 수 있게 해주는 도구입니다. SQS 동작과정(기본 아키텍처) 분산 메시징 시스템으로 이루어져 있습니다. 메세지는 한 지역 내의 여러 가용 영역에 걸쳐 분산 방식으로 저장됩니다. 큐(메시지 A부터 E까지 보유)는 여러 Amazon SQS 서버에 메시지를 중복 저장합니다. Message Lifecycle 1. 생산자(component 1) 메세지 A를 대기열로 전송하고 이 메시지는 SQS 서버에 중복 분산되어 저장됩니다. 2. 소비자(component 2)는 메시지를 대기열에서 소비합니다. 메시지 A가 처리되는 동안 대기열에는 그대로 존재하고 제한시간초과가 지속되는 동안 후속 수신 요청을 반환하지 않습니다. 3. 소..
-
[AWS] SpringBoot LocalStack으로 SNS, SQS 구성하기AWS 2023. 6. 3. 00:01
LocalStack이란? Localstack은 AWS Cloud 리소스들을 로컬에서 테스트할 수 있게 도와주는 테스트/모킹 프레임워크를 제공합니다. LocalStack을 활용하면 장점 AWS 클라우드 리소스를 직접 수행하지 않고 로컬 테스트가 가능해진다. 준비물 Docker AWS CLI Docker-Compose.YML version: '3.4' services: localstack: image: localstack/localstack:latest container_name: localstack_sns_sqs ports: - '4566:4566' environment: - DEFAULT_REGION=ap-northeast-2 - SERVICES=sns,sqs - DEBUG=1 - DATA_DIR=/tm..
-
QR코드 인증방식 원리프로젝트/WebSocket 2023. 6. 2. 00:01
QR코드란? QR 코드는 Quck Response Code의 약자로 컴퓨터가 만든 흑백 격자무늬 패턴 코드입니다. 이 코드를 통해 정보를 나타낼 수 있는 매트릭스 형태의 이차원 코드입니다. 각 사각형 또는 점은 문자, 숫자 또는 기호와 같은 정보를 나타냅니다. QR 코드는 어디에 사용될까? QR 코드는 웹사이트 URL, 쿠폰, 제품 코드 또는 연락처 정보와 같은 정보를 인코딩하는 데 자주 사용됩니다. 내가 하려고 하는 것 앱을 이용해 QR로그인을 생성하고 TV에서 편리하게 로그인할 수 있도록 한다. 1. TV에서 로그인 시도 시, QR코드를 제공한다. 2.앱에서 QR코드 인식 시, 계정 정보를 TV로 전달한다. 3. TV에서 로그인이 완료된다. QR 코드의 인증방식 1. 사용자가 앱에 로그인한다. 2. ..
-
Ngrok란?Mac OS 2023. 6. 1. 00:01
개요 dev 서버에서 cors 문제로 500 에러가 발생했다. 하지만 local에서는 문제없이 잘 기동되어 미리 파악하지 못하였다. 이럴 때 ngrok를 사용하면 dev에 올리기 전 미리 확인할 수 있다. Ngrok란? 로컬에 구성한 개발 환경을 급하게 외부에 공개해야 할 경우에 사용할 수 있습니다. 개발용 localhost를 터널링을 통해 외부에서 연결할 수 있도록 해줍니다. Homrbrew로 설치하기 brew install ngrok Ngork로 localhost 터널링하기 예를 들어 로컬 웹 서비스가 8080 포트에 떠있다면 다음과 같이 명령을 하면 됩니다. ngrok http 8080 https://12c1-43-200 으로 시작하는 ngrok 도메인으로 접속하면 localhost에 띄운 웹 서비..
-
Batch Performance 극한으로 끌어올리기: 1억건 데이터 처리를 위한 노력세미나, 영상 요약정리 2023. 5. 31. 00:01
https://if.kakao.com/2022/session/65 if(kakao)dev2022 함께 나아가는 더 나은 세상 if.kakao.com 카카오페이 정산플랫폼팀의 베니님의 발표를 요약해보고자 합니다. 발표에서 다루고자 하는 내용 대량 데이터 read 데이터 Aggregation 처리 대량 데이터 write batch 구동 환경 대량 데이터 처리 방식 총정리 개발자들은 언제 Batch를 사용할까? 특정 시간에 많은 데이터를 일괄 처리하는 경우 특정 시간에 상품 주문 배송 정보를 고객에게 문자로 일괄 전송하는 경우 서버 개발자는 Batch로 개발해서 16시에 스케줄을 걸어놔야겠다고 생각합니다 일괄 생성 READ -> CREATE -> WRITE 기존의 정보를 조합하여 새로운 정보를 만들어낼 때 일..
-
Spring Event 사용하기프로젝트/선착순 쿠폰 발급 시스템 2023. 5. 30. 00:01
개요 이벤트를 사용하는 이유는 무엇일까요? 개인적으로 생각했을 때 가장 주된 이유는 서비스 간의 의존성을 줄이기 위해서입니다. 서비스 의존성을 줄이기 예를 들어 회원가입으로 보았을 때, 회원가입을 수행하고 사용자에게 회원가입 성공 알림을 전송하거나, 신규가입 쿠폰을 할당한다고 가정해 보겠습니다. 이때 알림에서 장애가 발생하거나, 신규가입 쿠폰할당 과정에서 오류가 난다면 회원가입도 같이 실패하게 됩니다. 하지만 회원가입은 성공하였는데 회원가입이 끝나고 수행되는 그 외의 작업들로 회원가입이 실패하면 안 됩니다. 이벤트 발행하기 @Service class SignUpService( private val memberRepository: MemberRepository, private val applicationE..
-
Learn IntelliJ IDEAIntelliJ 2023. 5. 29. 00:01
개요 IntelliJ에서는 Learn LntelliJ IDEA라는 것을 제공합니다. 해당 코스를 통해 인텔리제이에 대해 알아보고자 합니다. 파란색의 Start Leraning버튼을 눌러서 시작해 보겠습니다. README 맨 처음으로 리드미페이지가 보입니다. 해당 러닝코스에 대한 소개의 페이지로 보이며 요약하면 다음과 같습니다. 유용한 단축키를 배울 수 있는 코스이다. 여러 코스가 존재하고 원하는 순서로 선택해서 수행할 수 있다. 코스는 아래 그림과 같이 왼쪽에 보입니다. 온보딩투어의 하위로 보이는 Get Acquainted with IDEA를 클릭해 보겠습니다. 본격적으로 코스가 시작됩니다. 유용하다고 생각한 단축키를 정리(MacOS) 현재 실행 중인 Projct 파일로 이동: Command + 1 프로..
-
Kotlin JPA Update Query 작성하기프로젝트/선착순 쿠폰 발급 시스템 2023. 5. 28. 00:01
UserJpaRepositry @Repository interface UserJpaRepository : JpaRepository{ @Modifying @Query("update UserJpaEntity u set u.representationMobileNumber = :mobileNumber where u.userId = :userId") fun updateMobileNumber(mobileNumber: String, userId: String): Int } @Modifying과 @Query를 사용하여 update쿼리를 작성해 주었습니다. userId와 mobileNumber를 인자로 받아 userId가 동일한 row의 representationMobileNumber를 변경해 주는 역할을 수행합니다. ..