분류 전체보기
-
[Web] Web Server 와 WAS개발 2021. 10. 28. 19:07
WAS 와 Web Server 웹서버 웹서버는 클라이언트로부터 요청을 받아서 정적인 컨텐츠를 내려준다. 혹은 HTTP 프로토콜을 기반으로 하여 클라이언트(웹 브라우저 또는 웹 크롤러)의 요청을 서비스 하는 기능을 담당한다. 기능 1) 정적인 컨텐츠 제공 WAS를 거치지 않고 바로 자원을 제공한다. 기능 2) 동적인 컨텐츠 제공을 위한 요청 전달 HTTP 형태로 Request 와 Response 를 주고 받을 수 있다. 클라이언트의 요청(Request)을 WAS에 보내고, WAS가 처리한 결과를 클라이언트에게 전달(응답, Response)한다. WAS DB 조회나 다양한 로직 처리를 요구하는 동적인 컨텐츠를 제공하기 위해 만들어진 Application Server 웹 컨테이너, 서블릿 컨테이너 라고도 말한..
-
Http 파라미터 방식과 멱등성개발 2021. 10. 28. 19:05
Http 파라미터 받는 방식 정리 오늘 좀 어이없는 이슈가 있었는데 정리해보려고 한다. 1. 오늘 있었던 일 프론트에서 특정 post method api 가 500 에러가 뜬다는 이슈 발생 swagger 에서 테스트해보니 너무 잘 동작함 즉 에러 재현이 안됨 프론트쪽에 request url 어떻게 보냈는지 여쭤 봄 프론트에서는 post method 이니 당연히 body data 로 파라미터를 보냄 그런데 그 api 는 query param 을 받는 post method api 였음 위 과정 약 1시간 반 소요.. 2. 문제 분석 path param, query param, body data 의 차이를 몰랐다 POST 에서는 늘 body data 로 파라미터를 받아 왔는데, 이 API 만 Query Par..
-
@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! 엔티티 매니저 팩토리와 엔티티 매니저 엔티티 매니저는 말 그대로 엔티티를 관리..
-
[Spring Security] Stateless 서버를 위한 JWT 인증 방식개발 2021. 7. 28. 20:47
이번 포스팅을 통해 해소하고 싶은 궁금증들은 다음과 같다. - 로그인은 어떻게 이루어지나? - JWT 토큰은 왜 쓰는거야? - 인증 서버의 구조? - OAuth2 인증 - 브라우저마다 달라지는 로컬 스토리지 저장 방식 - 자동로그인 처리 방식? 포스팅을 본격적으로 시작하기 전에 먼저 알아두어야 할 것이 있다. Stateless 서버는 모든 요청에 대해 사용자의 상태를 저장하지 않는다. Stateless 란 사용자의 이전 상태, 즉 세션 정보를 기록하지 않는 접속이다. 서버에서는 모든 API 요청에 대해 인가된 사용자에게만 응답을 보내주어야 한다. 서버가 응답하는 데이터는 매우 민감한 개인 정보가 포함 될 수 있기 때문에, 적절한 권한을 가진 사용자의 요청에만 응답을 보내주어야 한다. 그러나 Statele..
-
[메시지큐] Kafka, RabbitMQ 비교 및 쓰는 이유개발 2021. 7. 21. 21:39
https://ellune.tistory.com/29 메시지 큐는 왜 쓸까? 메시지 큐는 주로 어플리케이션의 요청에 대해 서버가 실시간으로 응답해야 할 때 사용한다. Application 과 서버가 강하게 결합되어 있을 경우, db나 백엔드 단에서 문제가 발생하면 어플리케이션에도 장애가 발생한다. 즉 서버와 어플리케이션 간의 의존성이 높다. 메시지큐를 사용하면.. 느슨하게 결합된 설계 어플리케이션 아키텍쳐가 DB성능에 영향을 덜 받는다. 여러 다른 API 로부터 비동기 통신이 가능하다 다수의 프로세스로부터 메시지 처리 가능 비동기: Queue 에 넣기 때문에 나중에 처리 가능 메시지 큐 종류 Kafka RabbitMQ ActiveMQ 셋 다 비동기 통신하고, Sender 와 Receiver 를 구분하지만..
-
[Kafka] 카프카 개념, Topic, Broker, Partition, Lag, Burrow 등 기초편개발 2021. 7. 21. 20:41
** 본 글은 dev원영 님의 카프카 기초 강의를 기반으로 작성되었습니다. Kafka Application 혹은 서비스와 연결 된 데이터 소스가 많아 짐에 따라 데이터 파이프라인의 관리가 힘듬 데이터 소스와 실제 애플리케이션의 Coupling 을 약하게 만들려는 의도 Fault Tolerance / High Throughput / Low Latency Queue 의 한 종류라고 알면 됨 Topic? 데이터가 들어가는 공간 AMQP 와는 다르게 동작 1. Partition이 하나 인 경우 Kafka 는 하나의 큐처럼 작동함 (FIFO) 하나의 컨슈머가 record 를 가져가도 삭제 되지 않음. consumer 그룹이 다를 경우 이전 데이터를 다른 어플리케이션이 가져 갈 수 있음 조건 컨슈머 그룹이 다를 것..
-
.NET 이 제공하는 비동기 프로그래밍 async/await캐치마인드 클론 개발 2020. 12. 7. 14:43
ibocon.tistory.com/89?category=794757 [C#] 비동기 프로그래밍 비동기 프로그래밍 비동기 프로그래밍은 중앙처리장치(CPU)를 효율적으로 사용하기 위한 기술이다. 중앙처리장치는 매 초마다 정말 많은 작업을 요청받고 처리한다. 데이터를 읽거나 쓰거나, 네 ibocon.tistory.com TaskBased-Asynchronous Pattern(TAP) 을 기반으로 async / await 키워드로 구현할 수 있도록 제공하고 있다. 이렇게 쉽게 비동기 작업을 구현할 수 있다니 놀랍다. C#이 구현한 비동기 작업에 대한 개념 C# 의 비동기 모델은 Futures and promises 개념을 프레임워크로 구현했다. Futures는 "지금은 없지만 언젠가 사용가능해질 데이터를 기다리..