전체 글
-
21장 - 소리치는 아키텍처클린 코드(Clean Code)/클린 아키텍처요약 2023. 1. 13. 00:01
소리치는 아키텍처 건물의 청사진을 보고 그 계획서가 한 가족이 거주할 주택을 그리고 있다면 아키텍처는 집이라고 소리칠 것입니다. 만약 도서관의 아키텍처를 보고 있고 여러 가지 도서관에 필요한 구성을 보다면 아키텍처는 도서관이라고 소리칠 것입니다. 우리의 애플리케이션을 보고는 아키텍처는 뭐라고 소리칠까요? 상위 수준의 디렉터리 구조, 최상위 패키지에 담긴 소스 파일을 볼 때 "헬스 케어 시스템이야", "재고 관리 시스템이야"라고 소리칠까요? 아니면 "스프링/하이버네티트야", "레일스야"라고 소리치는가요? 주택이나 도서관의 계획서가 해당 건축물의 유스케이스에 대해 소리치는 것처럼, 소프트웨어 애플리케이션의 아키텍처도 애플리케이션의 유스케이스에 대해 소리쳐야 합니다. 아키텍처의 목적 책에서 여러번 언급하는 내..
-
20장 - 업무 규칙클린 코드(Clean Code)/클린 아키텍처요약 2023. 1. 12. 00:01
업무 규칙이란? 사업적으로 수익을 얻거나 비용을 줄일 수 있는 규칙 또는 절차입니다. 컴퓨터상으로 구현되었는지, 사람이 수동으로 직접 하는 것과는 연관이 없습니다. 보통 업무규칙은 데이터를 요구하며 이러한 데이터를 핵심 업무 데이터라 부릅니다. 핵심 규칙과 핵심 데이터는 본질적으로 결합되어 있기 때문에 객체로 만들 좋은 후보가 되며 이러한 유형을 엔티티라고 합니다. 엔티티 JPA등의 프레임워크를 다루며 엔티티는 친숙한 용어입니다. 예를 들어 대출을 뜻하는 Loan 엔티티는 다음과 같습니다 Loan 엔티티는 핵심 업무 데이터를 포함합니다. - 이율 - 기간 - 원칙 Loan 엔티티는 세 가지 핵심 업무 규칙을 인터페이스로 제공합니다. - makePayment - applyInterest - chargeLa..
-
데이터 중심 애플리케이션 설계 10장 - 일괄 처리CS/데이터 중심 애플리케이션 설계 요약 2023. 1. 11. 00:01
파생 데이터 서로 다른 데이터 시스템을 통합하는 게 힘들다 원본 데이터를 복제해서 읽기 질의 성능을 높이는 데 사용 (캐시, 반정규화) 개요 보통 사용자의 요청에 따라 응답하는 형태로 이루어지고 응답 시간 단축에 많은 노력을 기울입니다. 하지만 이외에도 다양한 시스템이 존재합니다. 1. 서비스(사용자의 요청에 응답) 2. 일괄 처리(매우 큰 입력 데이터를 받아 데이터를 처리) 3. 스트림 처리(서비스와 일괄 처리 사이에 존재하는 준실시간 처리 시스템) 여기서 일괄처리는 신뢰할 수 있고 확장 가능하며 유지보수하기 쉬운 애플리케이션을 구축하는 데 매우 중요한 구성요소입니다. 유닉스 도구로 일괄 처리하기 유닉스의 철학을 되새겨보며 유닉스가 주는 아이디어와 교훈이 대규모 이기종 분산 시스템으로 그대로 이어집니다..
-
고품격 Kotlin 개발: 테스트 코드를 우아하게 작성하는 방법세미나, 영상 요약정리 2023. 1. 10. 00:01
https://www.youtube.com/watch?v=PqA6zbhBVZc 테크코스교육개발팀의 박재성님의 영상을 요약한 내용입니다. 코틀린에서 단위 테스트 이름 fun `단위 테스트 이름`(){ } 백틱(`)을 활용하여 한글로 작성할 수 있습니다. 테스트 팩토리 테스트 픽스처를 반환하는 팩토리 함수를 만들 수 있습니다. 코틀린의 기본 인자를 활용하여 빌더 패턴처럼 사용할 수 있습니다. Soft Assertion 일부 Assertion에 실패하더라도 동작이 모두 수행되도록 합니다. (코드가 즉시 중지되지 않음) 이때 어떤 property 때문에 실패했는지 알아차리기 어려운데 이때 data 클래스로 만들어 비교하면 확인하기 쉬워집니다. 코틀린에서는 Kotest와 MockK Kotlin의 테스트 라이브러리..
-
9장 - 일관성과 합의CS/데이터 중심 애플리케이션 설계 요약 2023. 1. 9. 00:01
내결함성 분산 시스템에서는 많은 것들이 잘못될 수 있습니다. 가장 간단하게는 전체 서비스가 실패하도록 두고 사용자에게 오류 메시지를 보여주는 것입니다. 하지만 이런 결정을 받아들이기 어렵다면 결함을 견뎌낼 수 있도록 구성해야 합니다. 이번 장에서는 내결함성을 지닌 분산 시스템을 구축하는데 쓰이는 알고리즘과 프로토콜의 몇 가지를 예를 이야기합니다. 추상화 트랜잭션을 사용함으로써 애플리케이션이 걱정하지 않도록 합니다. 이는 트랜잭션의 추상화인데 이와 같은 방식을 분산 시스템에서는 합의라고 합니다. 합의는 모든 노드가 어떤 것에 동의하도록 만듭니다. 예를 들어 리더가 죽었다면 다른 노드들이 합의하여 새 리더를 뽑을 수 있습니다. 두 노드가 자신이 리더라고 생각하는 스플릿 브레인 상황에서도 올바르게 구현된 합의..
-
nGrinder란? (설치 및 부하 테스트)성능테스트 2023. 1. 8. 00:01
[1] nGrinder vs Jmeter [2] nGrinder란? (설치 및 부하 테스트) 개요 이전 포스팅에서는 nGrinder와 Jmeter에 대해 비교해보고 nGrinder를 사용하고자 했습니다. nGrinder가 무엇인지 조금 더 상세하게 알아보고 실제로 설치 및 부하 테스트를 진행해보겠습니다. nGrinder란? 네이버에서 진행한 오픈 소스 프로젝트로 서버의 부하 테스트를 위한 도구입니다. nGrinder는 어떻게 동작하는가? nGriner는 2가지의 중요한 컴포넌트인 Controller와 agent로 구성되어 있습니다. nGrinder Controller - 성능 테스터가 테스트 스크립트를 생성하고 테스트 실행을 구성할 수 있도록 하는 웹 애플리케이션 Agent - 대상 시스템에 부하를 주는..
-
nGrinder vs Jmeter성능테스트 2023. 1. 7. 00:01
[1] nGrinder vs Jmeter [2] nGrinder란? (설치 및 부하 테스트 with Docker) 개요 성능 테스트를 위해 오픈소스를 비교해보고 어떤 것을 사용할지 결정하고자 합니다. 성능 테스트는 주로 시스템이 운용 조건(사용자, 네트워크 등)에서 얼마나 안정적일 수 있는지에 대한 평가를 포함합니다. 성능을 평가하기 위한 상위 지표에는 페이지 응답 시간, 네트워크 응답성, 서버 요청 처리속도 및 메모리 소비 패턴이 포함됩니다. 이는 갑자기 사용량이 급증하는 동적 시스템을 개발하기 위한 매우 중요한 요소입니다. Jmeter란? Apache에서 만들었으며 순수하게 자바로 만들어진 웹 애플리케이션 성능 테스트 오픈 소스입니다. GUI를 제공하며 Logic controller라고 불리는 기능은..
-
S3 pre-signed url 만들기(Kotlin + Spring)프로젝트/미디어 스트리밍 서버 프로젝트 2023. 1. 6. 00:01
pre-sigend url이란? 모든 객체 및 버킷은 기본적으로 private입니다. 보통 고객/사용자가 AWS 보안 자격 증명을 얻어 버킷에 접근하여 객체에 업로드합니다. 이때 pre-signed url을 통해 선택적으로 객체를 공유하여 보안 자격 증명이나 권한 없이 버킷에 객체를 업로드하는 것을 허용할 수 있습니다. 보통 pre-sigend url의 기능은 이를 만든 사용자의 권한에 의해 제한됩니다. pre-sigend url을 만들기 위해서는 보안 자격 증명을 제공하고 버킷 이름, 객체 키, HTTP 메서드 및 만료 날짜와 시간을 지정해야 합니다. 지정된 기간 동안만 유효합니다. pre-signed url 동작 과정 [그림 1] 과정을 글로 설명하면 다음과 같습니다. 1. 클라이언트가 서버에게 pr..