목록2024/08/25 (2)
밤빵's 개발일지
결제 기능을 구현하게되면서, 기술 매니저님의 조언에 따라 꼭 알아두어야 한다는 동시성 이슈와 LOCK 개념에 대해서 공부하면서 개념을 정리했다. 예시마다 이해가 쉽지않아서 시간이 오래걸렸다🥺▶ 동시성 이슈란? 동시성 문제(concurrency issue)란, 여러 사용자가 동시에 같은 자원 (데이터, 메모리 등)에 접근하거나 수정할 때 발생하는 문제를 의미한다. 결제 시스템에서는 이러한 문제가 심각한 버그나 금전적 손실로 이어질 수 있어 특히 주의가 필요하다. ▷ 온라인 쇼핑몰에서 100개 한정판 상품을 판매한다고 가정했을 때 : 재고 관리 문제 public class InventoryService { // 주문을 처리하는 메서드 public void processOrder(Long pro..
결제기능은 어려운 기능이라고 해서, 간단하게 구현하기로 했지만 알아둬야 할 문제점들이 많다. 기술매니저님께서 중요하다고 하는 문제점에 대해선 따로 더 세세하게 작성 할 예정이고, 오늘은 결제시스템 구현에 대해 알아보면서 알게 된 문제점들에 대해 간단하게 정리해보기로 했다. 결제 기능을 구현할 때 꼭 숙지해야 할 문제점들은 다양하다. 결제는 사용자와의 신뢰를 구축하는 중요한 기능이기 때문에 보안, 데이터 일관성, 성능 등 여러 측면에서 신중하게 설계하고 구현해야 한다. 오늘 개발일지에서는 결제 기능을 구현할 때 반드시 고려해야 할 몇 가지 주요 문제점과 이를 해결하기 위한 간단한 예시와 코드 예시를 정리했다! 1. 동시성 이슈→ 문제점:여러 사용자가 동시에 결제를 요청하면 데이터베이스의 동일한 상품에 접..