MSA 12

[MFA] 모노레포(Mono Repo)란? 장단점

모노레포 란? 하나의 레파지토리에서 여러 프로젝트, 모듈 또는 패키지를 관리하는 개발 방식 모든 소스 코드를 중앙화하여 관리하고 필요한 패키지를 공유하여 사용할 수어 코드의 재사용성과 개발의 협업을 용이하게 만든다. 모노레포 장점 중복 코드를 줄이고, 공통 모듈을 사용으로써 코드의 재사용서 높인다. 모든 서비스가 동일한 환경에서 작동하므로 일관성을 유지하고 호환성을 확보할 수 있다. 코드의 히스토리를 추적하기 쉽다. 다른 서비스를 수정 시 추가적인 배포 없이 테스트하고, 함께 빌드 배포를 할 수 있다. 모노레포 단점 레파지토리가 크기가 무거워질 수 있다. 여러 서비스와 모듈을 포함하여 레퍼지토리의 복잡성을 증가시킬 수 있다. 권한 관리와 보안 설정이 중요하다. 모노레포 경험하면서 느낀 점 아쉬웠던 점 다..

MSA 2023.10.28

[MFA] 마이크로 프론트엔드 아키텍처 특징 장,단점

마이크로 프론트엔드 특징 독립적으로 제공 가능한 프론트엔드 애플리케이션이 더 큰 전체로 구성되는 아키텍처 스타일 전통적인 모놀리식 웹 애플리케이션 아키텍처를 보완하기 위해 사용되는 개발 패턴 애플리케이션을 작은 독립적인 서브 애플리케이션으로 분할하고, 서브 애플리케이션을 모아 하나의 애플리케이션으로 구성하는 방법 독립된 기술 스택을 가지며, 개발, 테스트 및 배포가 독립적으로 이루어질 수 있다. 서로 다른 애플리케이션에 느슨하게 결합되어, 하나의 애플리케이션에서 변경을 할 때 다른 부분에 미치는 영향을 최소화한다. 큰 규모의 애플리케이션을 더 쉽게 관리하고 확장할 수 있다. 장점 덜 복잡하고, 적은 양의 코드를 관리하여 코드의 품질을 높일 수 있다. 배포의 범위가 줄어들어 빌드 및 배포 시간이 줄고, 장..

MSA 2023.10.22

[MSA] Prometheus, Grafana 란? Grafana연동Example

Prometheus Metrics를 수집하고 모니터링에 사용되는 오픈소스 애플리케이션 시계열 데이터베이스에 Metrics를 저장하고 조회 가능 https://prometheus.io/ Prometheus - Monitoring system & time series database An open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach. prometheus.io prometheus.yml target 정보 추가 job_name : 이름 설정 scrape_interval : 수집 데이터 간격 시간 설..

MSA 2023.05.16

[MSA] Spring Boot - Micrometer란? Micrometer Timer example

https://micrometer.io/ Micrometer Application Observability micrometer.io Micrometer JVM기반의 애플리케이션의 Metrics 제공, 처리 Prometheus 등 다양한 모니터링 시스템을 지원한다. Timer 지연시간, 이벤트의 사용 빈도 측정 시계열의 이벤트 시간, 호출 빈도 제공 의존성 주입 (build.gradle) dependencies { ... implementation 'io.micrometer:micrometer-registry-prometheus:1.10.5' } 설정값 변경 (application.yml) endpoint 추가 metrics prometheus management: endpoints: web: exposu..

MSA 2023.05.15

[MSA] Spring Boot - Zipkin 이란? Spring Cloud Sleuth Example

https://zipkin.io/ OpenZipkin · A distributed tracing system Zipkin Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures. Features include both the collection and lookup of this data. If you have a trace ID in a log file, you can jump di zipkin.io zipkin Twitter에서 사용하는 분산 환경의 Timing 데이터 수집, 추적 시스템 분산환경에서의 시스템 병목 형상 파..

MSA 2023.05.14

[MSA] Spring Boot - CricuitBreaker란? Resilience4J example

CircuitBreak 장애가 발생하는 서비스에 반복적인 호출이 되지 못하게 차단 다른 서비스로 대체 수행 의존성 주입 (build.gradle) dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j' ... } CircuitBreaker 설정 파일 (Default 설정 있어서 Custom 하게 사용할 경우만 생성) CircuitBreakerConfig failureRateThreshold CirucitBreaker open 결정 횟수 default : 50 waitDurationInOpenState CircuitBreak를 open 한 상태 유지하는 지속시간, 이후에는..

MSA 2023.05.13

[MSA] Spring Boot - Feign Client 란? Rest Api 호출

Feign Client Netfix에서 개발된 Http client binder이다. 간편하게 Rest Api를 호출할 수 있다. 의존성 주입 (build.gradle) dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' ... } Applicatoin - 어노테이션 등록 @EnableFeignClients 등록 import ... @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients public class GugbabVocaServerApplication { ... } Feign Client - 인터페이스 생성 @FeignClien..

MSA 2023.04.24

[MSA] Spring Boot - RestTemplate 란? 사용

RestTemplate Spring에서 지원하는 간편하게 Rest API를 호출할 수 있게 해주는 클래스 Application - Bean 등록 @LoadBalanced // 마이크로 서비스 이름으로 찾을 수 있게 해 줌 package com.gugbab.gugbabservices; import ... @SpringBootApplication @EnableDiscoveryClient public class GugbabServicesApplication { ... @Bean @LoadBalanced public RestTemplate getRestTemplate(){ return new RestTemplate(); } } RestTemplate 사용 예시 public class UserServicesIm..

MSA 2023.04.23

[MSA] Spring Boot - Spirng Cloude Bus (RabbitMQ)

Spring Cloude Bus 분산 시스템에서 구성 변경 사항을 전파하는 라이브러리 구성 변경 사항이 발생하면, 해당 변경 사항을 구독한 모든 인스턴스에 대해 자동으로 전파되어 구성 변경을 쉽게 처리할 수 있다. AMQP (Advanced Message Queuing Protocol) 메세지 지향 미들웨어를 위한 개방형 표준 으용 계층 프로토콜 Kafka 분산형 스트리밍 플랫폼 대용량의 데이터를 처리 가능한 메시징 시스템 초당 100k+ 이상의 이벤트 처리 pub/sub, Topic에 메시지 전달 Ack를 기다리지 않고 전달 가능 생산자 중심 RabbitMQ 초당 20+ 메시지를 소비자에게 전달 메시지 전달 보장, 시스템 간 메시지 전달 브로커, 소비자 중심 RabbitMQ 설치 (MAC) brew u..

MSA 2023.04.13

[MSA] Spring Boot - Spring Cloude Config 란? Config Server 생성

Spring Clude Config 마이크로서비스 아키텍처에서 구성 요소의 구성 관리를 위한 도구 중앙 집중식 구성 서버에서 구성 정보를 저장하고, 클라이언트는 이 서버에서 구성 정보를 가져와서 자신의 설정에 적용한다. application.yml 우선순위 application.yml -> applicatoin-name.yml -> application-name- ConfigServer 의존성 주입 (build.gradle) ext { set('springCloudVersion', "2021.0.6") } dependencies { implementation 'org.springframework.cloud:spring-cloud-config-server' ... } 어플리케이션 부분에 컨피그 서버 등..

MSA 2023.04.11