전체 글
-
@Transactional 태그 안에서 Exception Handling 시 유의 할 점개발 2021. 8. 27. 00:04
@Transactional 태그 안에서 Exception Handling 시 유의 할 점 컨텍스트 설명 1. 요구사항 로그인이 실패할 때마다 그 횟수를 세고, 틀린 횟수가 5가 될 경우 계정을 잠금처리 해주세요 2. 내 접근법 로그인 시 비밀번호가 틀렸을 경우 member table 의 특정 필드를 +1 해주고, 그 필드 값이 5와 같을 경우 Exception 을 던지자 3. 마주친 문제 기존 코드는 이랬다. @Service public class AuthService { @Transactional(propagation = Propagation.REQUIRES_NEW) public UserProj authenticate(String emailAddress, String password) { UserPro..
-
[빅데이터 플랫폼]Lambda & Kappa Architecture개발 2021. 7. 28. 21:00
Intro 대용량 빅데이터를 스크래핑 하고, 그를 정제 및 저장할 빅데이터 분석 플랫폼을 설계 및 구축해야 하는 과제가 있었습니다. 그러나 스크래핑 될 데이터의 형태, 볼륨, 종류 등이 정해지지 않은 상태에서 아키텍처를 구상하기에는 한계가 있습니다. 특히 이전 프로젝트의 아키텍처(MSA)를 참고하기에는 새로 시작하려는 플랫폼의 목적이 달랐다는 것이 큰 문제였습니다. 구축하려는 시스템의 요구 사항이 명확하지 않은 상태에서 기술 스택을 정하는 것은 사실 불가능한 일이죠. 따라서 이후 정해질 요구 사항에 맞추어 빠른 의사 결정을 내리기 위해서는 최대한 다양한 상황을 가정하고 꼼꼼하게 기술들을 리서치한 후, 장점과 단점을 각각 비교 하여 문서화 해 둘 필요가 있습니다. 트렌디한 기술도 좋지만, 실제 프로덕션 환..
-
[JPA] Entity를 통해서 변경한 데이터를 DB는 어떻게 알아먹을까? → 영속성 관리개발 2021. 7. 28. 20:54
[JPA] Entity를 통해서 변경한 데이터를 DB는 어떻게 알아먹을까? → 영속성 관리 서버 코드 보고, QueryDsl 도 다루어 보면서 생긴 몇가지 궁금증을 해소해 주었던 지식을 기록 일단 궁금했던 점들 QueryDsl 을 작성할 줄 알고, 쓸 줄도 알겠어. 그런데 이 쿼리가 DB로 날라가는건 대체 어떤 시점이야? → 이 시점을 근본적으로 이해할 정도의 구조적 지식이 필요했다. 그 전에, JPA를 통해서 DB 테이블 정보를 바꿀 때는 member.setId(id) 이런 식으로 바꾼다. DB에 쿼리를 날린 것도 아니고, 트랜잭션을 따로 끝낸 적도 없는데 이게 어떻게 DB에 반영이 되는거야? → Dirty Checking! 엔티티 매니저 팩토리와 엔티티 매니저 엔티티 매니저는 말 그대로 엔티티를 관리..