Home

[AWS] 다른 계정 or Region 에 이벤트가 발생했을 때, EventBridge 로 Event 전달하기

1. Problem AWS 에서는 서비스 Region 을 지정하여 서비스를 운영할 수 있습니다. 서비스들에서 발생한 Event 들은 EventBridge 를 통하여 다른 Event 를 Trigger 할 수 있습니다. 어떤 Region 에서 에러가 발생했을 때, 이와 다른 Region 에서 이 이벤트를 확인하여 처리하고 싶을 수 있습니다. 예를 들어, AWS 서비스 중에서는 글로벌 서비스로 운영되는 서비스들의 일부 Event 들이 Default 로 미국 동부 (버지니아 북부) us-east-1 로 전송됩니다. 서비스가 서울에서 운영되고 있어도 이벤트가 미국 동부로 전달되기...

Read more

[Spring Boot] WebFlux란? reactive, 반응형 프로그래밍 개념정리

1. WebFlux란? 1.1 WebFlux 가 생긴 이유 기존 스프링 프레임워크는 Servlet API와 Servlet 컨테이너로 이루어졌고, 동기적으로 요청을 처리함. 기존 Spring MVC는 하나의 요청에 대해 하나의 스레드가 사용된다 thread:request(1:1), sync + blocking 방식 스레드 생성에는 시간이 걸리기 때문에, 다수의 요청을 고려하여 미리 스레드 풀을 생성해놓는다. 또한, 스레드는 컨텍스트 스위칭 비용이 발생한다. 기존에는 하나의 요청마다 하나의 스레드를 할당하여 처리했다. MSA 환경에서 한 ...

Read more

[AWS] SNS, SQS 란? 비동기 메시지 큐 개념정리 및 차이점 비교

0. 들어가기 전 AWS SNS, SQS 를 사용하면서 궁금한 점을 정리하게 되었습니다. 특히, seohyun0120 님의 블로그 _ AWS SNS vs SQS 차이점의 많은 도움을 받았습니다. 서비스가 커질수록 서버 한대로는 처리가 힘들어진다. 여러 서버에서 기능을 처리하면서 서버들끼리 주고 받는 메세지를 잃어버리지 않고 정확하게 처리하는 것이 중요해졌다. 이러한 니즈에 따라 중간에 큐 를 두고 서비스를 개발하게 되었다. 이러한 큐 서비스는 다중화 구성을 기본으로 장애 걱정 없이 믿을 만한 시스템으로 구축 시스템 일부에 장애가 ...

Read more

[leetcode] 49. Group Anagrams _ Algorithm Problem Solve for python

1. Problem 49. Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: strs = ["eat","tea","tan","ate","nat","bat"...

Read more

[leetcode] 207. Course Schedule _ Algorithm Problem Solve for python

1. Problem 207. Course Schedule There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai. For example, the pair [0, 1], indicates that to take course 0 you have...

Read more

[leetcode] 137. Single Number II _ Algorithm Problem Solve for python

1. Problem 137. Single Number II Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it. You must implement a solution with a linear runtime complexity and use only constant extra space. Example 1: Input: nums = [2,2,3,2] Output: 3 Example 2: Inp...

Read more

[leetcode] 190. Reverse Bits _ Algorithm Problem Solve for python

1. Problem 190. Reverse Bits Reverse bits of a given 32 bits unsigned integer. Note: Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer’s internal binary representation is the sa...

Read more

[leetcode] 9. Palindrome Number _ Algorithm Problem Solve for python

1. Problem 9. Palindrome Number Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Example 2: Input: x = -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121...

Read more

[leetcode] 100. Same Tree _ Algorithm Problem Solve for python

1. Problem 100. Same Tree Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the same value. Example 1: Input: p = [1,2,3], q = [1,2,3] Output: true Example 2: Input: p = [1,2], q = [1,null,2] Out...

Read more