목록2024/08 (36)
밤빵's 개발일지
API 게이트웨이는 마이크로서비스 아키텍처(MSA)에서 중요한 역할을 하는 중간 계층으로, 클라이언트 요청을 적절한 백엔드 서비스로 라우팅하고, 요청과 응답을 조작하며, 다양한 기능을 제공한다. 예를 들어, 인증, 권한 부여, 로깅, 로드 밸런싱, 속도 제한, 캐싱, 모니터링 등을 API 게이트웨이를 통해 구현할 수 있다. 🤓API 게이트웨이란?API 게이트웨이는 클라이언트와 백엔드 서비스 사이에 위치하는 중간 계층으로, 클라이언트 요청을 적절한 서비스로 전달하고 응답을 다시 클라이언트에 반환하는 역할을 한다. 이를 통해 클라이언트는 다양한 서비스 엔드포인트에 직접 접근할 필요 없이 API 게이트웨이를 통해 모든 요청을 관리할 수 있다. API 게이트웨이의 주요 기능은 다음과 같다.→ 요청 라우팅(Re..
🫨Locust와 nGrinder를 이용한 부하 테스트부하 테스트(Load Testing)는 소프트웨어 애플리케이션의 성능을 측정하고, 다수의 사용자 요청을 처리할 수 있는 시스템의 한계를 파악하는 중요한 절차이다. 결제 기능과 같이 민감한 데이터를 처리하는 백엔드 시스템에서는 고가용성, 안정성, 성능 최적화가 매우 중요하다. 그래서 Locust와 nGrinder 같은 도구를 사용해 부하 테스트를 수행하면 시스템이 얼마나 많은 사용자 요청을 견딜 수 있는지, 그리고 응답 시간은 어떤지 등을 확인할 수 있다. 이번 개발일지에서는 Locust와 nGrinder라는 두 가지 부하 테스트 도구에 대해 알아보고, 예시 코드를 통해 이를 결제 기능에 어떻게 적용할 수 있는지 지금 구현 중인 코드에 적용해봤다! ▶..
결제 기능을 구현하면서 웹훅(Webhook)이라는게 꼭 붙어있어서 내가 해야하는 부분인 줄 알고 공부해야하나? 라는 생각을 갖고있었다. 특히 포트원(PortOne)과 같은 결제 대행 서비스를 사용하면서 웹훅이 어떤 역할을 하는지 이해하는 게 필요하다고 생각했고, 매니저님이 프론트영역이라고는 하셨지만, 웹훅이라는 이름이 맘에들었기 때문에🤣 내용을 정리하기로 했다! 😚웹훅(Webhook)?웹훅(Webhook)은 서버에서 특정 이벤트가 발생할 때 다른 서버의 특정 엔드포인트(URL)로 HTTP 요청을 보내는 방식의 비동기적 통신 방법이다. 쉽게 말해, 웹훅은 이벤트 기반으로 동작하며, 서버 간의 데이터를 실시간으로 전달하는 데 매우 유용하다. 웹훅을 이용하면 서버가 특정 이벤트(예: 결제 완료, 주문 상태..
🤓인 컨텍스트 러닝(In-Context Learning)과 Spring Boot 활용!인 컨텍스트 러닝은 최근 자연어 처리(NLP) 분야에서 주목받고 있는 개념으로, AI 모델이 학습된 데이터 이외의 추가적인 학습 없이도 특정 문맥(context) 내에서 제공되는 예제를 기반으로 새로운 작업을 수행할 수 있게 하는 방법이다. 전통적인 머신러닝과 딥러닝 모델에서는 학습을 위해 데이터셋과 레이블을 활용한 모델 훈련이 필요하지만, 인 컨텍스트 러닝은 별도의 재학습 없이도 주어진 문맥에서 새로운 작업에 적응할 수 있다는 점이 특징이다. ▶인 컨텍스트 러닝이란?인 컨텍스트 러닝은 미리 학습된 AI 모델이 주어진 문맥(Context)에 대한 이해를 기반으로, 새로운 작업을 수행하는 능력을 말한다. 예를 들어, ..
나는 팀 프로젝트를 이어가고있기 때문에 다른 사람들이 하는 개인프로젝트에 관심이 많아서 이것저것 물어보고 다니고 있다. 그렇게 개인프로젝트 내용들을 들으면서 스케줄러와 같은 여러 키워드를 알게됐는데 Spring batch라는게 대규모 데이터 처리를 위해 설계된 프레임워크란걸 알게되서 오늘 개발일지 소재로 쓰게되었다.Spring Batch는 대용량 데이터 처리에 최적화된 스프링 프레임워크의 서브 프로젝트로, 배치 애플리케이션을 개발하기 위한 도구이다. 배치 애플리케이션은 대량의 데이터를 백그라운드에서 처리하는 작업으로, 금융 결산, 데이터 마이그레이션, 대규모 데이터 분석 등 다양한 분야에서 사용된다.▶ Spring Batch란 ?Spring Batch는 스프링 프레임워크를 기반으로 하는 배치 처리 프레임..
파인튜닝(Fine-Tuning)은 머신러닝, 특히 딥러닝 모델에서 사전 학습된 모델을 특정 작업에 맞게 추가로 학습시키는 과정이다. 파인튜닝을 통해 기본적인 패턴을 이미 학습한 모델을 사용해서 새롭고 특정한 데이터에 대해 더 나은 성능을 얻을 수 있다. 예를 들어, 기본적으로 이미지 인식을 학습한 모델을 기반으로 고양이와 개를 구분하는 모델을 파인튜닝할 수 있다. 예시 코드는 지금 구현하고있는 결제기능에서 서비스클래스 코드를 예시 코드로 사용했다. ▶ 파인튜닝의 개념과 필요성 ▷ 파인튜닝의 개념파인튜닝은 사전 학습된 모델을 재사용하여 특정 도메인이나 데이터셋에 맞게 최적화하는 과정이다. 사전 학습된 모델은 대규모 데이터셋으로 일반적인 패턴을 학습하며, 이를 "전이 학습(Transfer Learning)..
결제 기능을 구현하게되면서, 기술 매니저님의 조언에 따라 꼭 알아두어야 한다는 동시성 이슈와 LOCK 개념에 대해서 공부하면서 개념을 정리했다. 예시마다 이해가 쉽지않아서 시간이 오래걸렸다🥺▶ 동시성 이슈란? 동시성 문제(concurrency issue)란, 여러 사용자가 동시에 같은 자원 (데이터, 메모리 등)에 접근하거나 수정할 때 발생하는 문제를 의미한다. 결제 시스템에서는 이러한 문제가 심각한 버그나 금전적 손실로 이어질 수 있어 특히 주의가 필요하다. ▷ 온라인 쇼핑몰에서 100개 한정판 상품을 판매한다고 가정했을 때 : 재고 관리 문제 public class InventoryService { // 주문을 처리하는 메서드 public void processOrder(Long pro..
결제기능은 어려운 기능이라고 해서, 간단하게 구현하기로 했지만 알아둬야 할 문제점들이 많다. 기술매니저님께서 중요하다고 하는 문제점에 대해선 따로 더 세세하게 작성 할 예정이고, 오늘은 결제시스템 구현에 대해 알아보면서 알게 된 문제점들에 대해 간단하게 정리해보기로 했다. 결제 기능을 구현할 때 꼭 숙지해야 할 문제점들은 다양하다. 결제는 사용자와의 신뢰를 구축하는 중요한 기능이기 때문에 보안, 데이터 일관성, 성능 등 여러 측면에서 신중하게 설계하고 구현해야 한다. 오늘 개발일지에서는 결제 기능을 구현할 때 반드시 고려해야 할 몇 가지 주요 문제점과 이를 해결하기 위한 간단한 예시와 코드 예시를 정리했다! 1. 동시성 이슈→ 문제점:여러 사용자가 동시에 결제를 요청하면 데이터베이스의 동일한 상품에 접..
▶ MSA(Microservices Architecture)란?MSA(Microservices Architecture)는 하나의 애플리케이션을 여러 개의 작은 독립적인 서비스로 구성하는 아키텍처 스타일로, 각 서비스는 독립적으로 배포, 확장, 개발될 수 있으며, 서로 다른 기술 스택과 데이터베이스를 사용할 수 있다. 이러한 MSA는 모놀리틱 아키텍처(Monolithic Architecture)와 대비되는 개념으로, 최근 다양한 대규모 시스템 개발에 많이 사용되고 있다. ▶ MSA의 개념과 특징MSA는 큰 애플리케이션을 여러 개의 작은 서비스로 나누어, 각 서비스가 독립적으로 운영되도록 하는 아키텍처로 각 서비스는 고유한 비즈니스 기능을 담당하며, 다른 서비스와 느슨하게 결합되어 있다. 이러한 MSA의 특..
결제 기능을 구현할 때는, 시스템이 어떤 흐름으로 사용자 요청을 처리하고 결제를 완료하는지 이해하는 것이 중요하다. 오늘 개발일지에서는 결제 기능을 구현하기 위해 시퀀스 다이어그램을 그리는 방법과 그 흐름, 포트원 결제플로우만 보면서 어려워하고있던 중 기술매니저님이 그려주신 시퀀스 다이어그램과 포트원 결제 플로우를 비교해보면서 결제기능구현을위해 정리해보려고한다! ▶시퀀스 다이어그램이란?시퀀스 다이어그램은 소프트웨어 설계 단계에서 객체 간의 상호작용을 시간 순서대로 보여주는 다이어그램이다. 주로 요청과 응답의 흐름을 시각화하여 이해하기 쉽게 만든다. 시퀀스 다이어그램은 객체들이 어떤 순서로 메시지를 주고받는지, 시스템의 여러 부분이 어떻게 상호작용하는지에 대한 명확한 그림을 제공한다.▶시퀀스 다이어그램 ..