-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
티켓 재고 관리 시스템 설계 #2
Comments
역정규화
Application level synchronized
Database Lock
public interface StockRepository extends JpaRepository<Stock, Long> {
@Lock(LockModeType.PESSIMISTIC_WRITE)
@Query("select s from Stock s where s.id = :id")
Stock findByIdWithPessimisticLock(Long id);
}
@Entity
public class Stock {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Long productId;
private Long quantity;
@Version
private Long version;
} public interface StockRepository extends JpaRepository<Stock, Long> {
@Lock(LockModeType.OPTIMISTIC)
@Query("select s from Stock s where s.id = :id")
Stock findByIdWithOptimisticLock(Long id);
} Redis 분산 락큐 기반 요청 처리 (Kafka, RabbitMQ)
|
Merged
Merged
위에 첨부한 인프런 강의 구성을 따라가면 어떨까요?
이렇게 분류해서 접근하면 체계적으로 사고할 수 있겠어요. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
티켓 재고 관리 시스템 설계를 고민합니다.
The text was updated successfully, but these errors were encountered: