전체 글
-
스프링 시큐리티가 OAuth 로그인을 처리하는 방법프로젝트/WebRTC 화상통화 프로젝트 2022. 8. 3. 00:01
(1) OAuth2.0이란? (2) Spring Security와 OAuth 2.0으로 로그인 구현하기(SpringBoot + React) (3) Spring Security OAuth 2.0 단위테스트 (4) Spring Security가 OAuth 로그인을 처리하는 방법 로그인 구현을 하고 나서 스프링 시큐리티가 많은 것을 추상화해준다고 느꼈습니다. 실제로 어떻게 로그인을 처리해주는지 알아보고자 합니다. Config 설정 스프링 시큐리티를 사용할 때 단지 application.properties 또는 application.yml에 client-id, cleint-secret 등의 정보만 적어줍니다. application.properties spring.security.oauth2.client.regi..
-
Spring JPA에 Index 적용하기프로젝트/WebRTC 화상통화 프로젝트 2022. 8. 2. 00:01
개요 - Spring JPA + MySQL에 Index를 적용해보자 - Index를 어떻게 걸어야 효율적일까? 인덱스(Index)란? 인덱스란 우리가 책에서 원하는 분야를 찾기 위해 처음부터 끝까지 읽는 게 아니라 목차에서 원하는 부분을 찾아 가는 것처럼 데이터베이스에서 데이터를 찾을 때 처음부터 끝까지 읽는 것이 아니라 효율적으로 데이터를 탐색할 수 있게 합니다. 어떻게 빠르게 탐색이 가능할까요? 추가적인 공간을 활용하여 데이터를 정렬시킴으로써 수정,삭제의 성능을 수정하여 조회의 성능을 높입니다. 데이터가 정렬되어있으면 이분탐색을 통해 원하는 데이터를 빠르게 탐색할 수 있는 것을 떠올릴 수 있습니다. 인덱스에 대해서 조금 더 자세하게 알고 싶거나 이해가 되지 않는다면 다음 글을 참고하세요 https:/..
-
Docker로 Apache 웹서버 띄우기MSA & 쿠버네티스(Kubernetes) - k8s 2022. 8. 2. 00:01
Docker에 대한 기초적인 지식은 있다는 가정하에 진행하겠습니다. - Docker 이미지란 - Docker 설치법 - 가상화와 컨테이너 개념 - 네트워크 포트개념 간단하게 설명하자면 Docker Hub에 이미지들이 존재하고 이 이미지들을 실행하면 컨테이너가 됩니다. 또한 이미지는 여러 개 실행할 수 있습니다. 이때 Docker Hub은 App Store, 이미지는 프로그램, 컨테이너는 프로세스의 개념으로 이해하시면 좋을 것 같습니다. 1. Docker Desktop 열기 2. cmd 창 열기 3. 아파치 웹서버 이미지 내려받기 docker pull httpd 4. 이미지가 정상적으로 받아졌는지 확인 docker images httpd가 잘 생성된 것을 확인할 수 있습니다. 5. 컨테이너로 실행 dock..
-
Redis Sorted Set을 이용한 실시간 랭킹 시스템 구축(1)프로젝트/WebRTC 화상통화 프로젝트 2022. 8. 1. 02:06
이해하는데 필요한 사전 지식 - Redis란? - 관계형 DB 지식 - Docker(Redis를 docker로 띄우기 위해) 관계형 데이터베이스로 랭킹 구축하기 예를 들어 영화의 관객수를 가지고 랭킹을 매기기 위한다고 가정하겠습니다. 이러한 순위는 관계형 데이터베이스로도 간단하게 산출해낼 수 있습니다. 데이터베이스의 테이블 이름은 movie Column에서 영화 이름을 name, 관객 수를 view라고 가정하겠습니다. movie 테이블은 name, view 칼럼을 가진다 순위의 경우에는 간단하게 관계형 데이터베이스로도 산출해낼 수 있습니다. select * from movie ORDER BY views DESC 만약 101위에서 200위까지 가져온다면 다음과 같은 쿼리를 작성하면 됩니다. select *..
-
[백준] 2447번 : 별 찍기 - 10 - 자바(JAVA)알고리즘/백준 2022. 8. 1. 00:01
https://www.acmicpc.net/problem/2447 2447번: 별 찍기 - 10 재귀적인 패턴으로 별을 찍어 보자. N이 3의 거듭제곱(3, 9, 27, ...)이라고 할 때, 크기 N의 패턴은 N×N 정사각형 모양이다. 크기 3의 패턴은 가운데에 공백이 있고, 가운데를 제외한 모든 칸에 별이 www.acmicpc.net 문제 해석 재귀함수를 활용하여 별을 찍는 문제 같습니다. 분할정복 느낌으로 사각형 크기가 3인 사각형을 확장해 나가는 것 같습니다. 문제 풀이 전 설계 재귀함수의 반복은 N=3일때까지 반복을 합니다. (가장 작은 단위가 N=3일때 ) 만약 N=9가 들어오게 된다면 위 사각형 그리기, 가운데 공백있는 사각형 그리기, 아래 사각형 그리기로 나뉘어 재귀함수를 호출해야 할 것 ..
-
Base62 인코딩을 활용해 초대링크 만들기프로젝트/WebRTC 화상통화 프로젝트 2022. 7. 31. 10:37
사용자가 그룹에 가입하게 위해 그룹장과 사용자에게 편의성을 주기 위해 초대링크를 제공하고자 했습니다. 요구사항은 다음과 같았습니다. 1. 초대링크는 Unique 해야 한다 2. 너무 길지도 너무 짧지도 않아야 한다 3. 어떤 그룹의 초대링크인지 예측할 수 없어야 한다. 예를 들어 그룹id 1의 초대링크가 1이라면 그룹1에 대한 초대링크인지 알게 되고 이를 악용할 수 있는 여지가 발생하게 됩니다. 따라서 흔히 알려진 URL Shortener기법을 사용하여 이 문제를 해결하고자 했습니다. URL Shortener는 긴 URL을 짧게 축약하여 5~9개 정도로 단축하는 것을 말합니다. 해결하기 위한 방법들 MD5, Sha-1등의 해시 알고리즘들은 길이가 너무 깁니다. MD5: 9e107d9d372bb6826bd..
-
애자일은 애자일이란 단어를 버려야 한다 - 신정호세미나, 영상 요약정리 2022. 7. 31. 10:12
https://www.youtube.com/watch?v=sR_r2wdYBhw&t=25s OKKYCON 열린 신정호님의 발표를 요약한 내용입니다. 보행자가 교통사고에 나지 않는 법 길을 건널때 좌우를 살피고 파란불에 손을 들고 건너야 한다. 누구나 다 알고있는 사실이지만 여러 가지 예외 상황이 존재하기 때문에 교통사고는 빈번히 발생합니다 프로젝트에 성공하는법 회고, 짧은 주기의 릴리즈, 스프린트 계획 회의, 현황판, 번다운 차트, 테스트 케이스 등을 잘 수행하면 프로젝트를 성공할 수 있습니다. 하지만 프로젝트에서도 시간이 부족하는 등 예외 상황이 존재하기 때문에 프로젝트에 실패할 수 있습니다. 방법론은 중요하지 않다 위의 예시를 통해 알 수 있듯이 애자일이라는 방법론을 잘 알더라도 적용하는 것은 다른 이..
-
[Java]ExecutorService란?Java 2022. 7. 31. 00:01
읽기 전 미리 알고 있으면 이해하기 좋은 개념들 Thread ThreadPool Runnable, Callable Future Blocking Queue ExecutorService란? 병렬 작업 시 여러 개의 작업을 효율적으로 처리하기 위해 제공되는 Java 라이브러리입니다. ThreadPool을 이용하여 Task를 실행하고 관리합니다. 보통 Thread를 구현할 때 Runnable 인터페이스를 구현하거나 Thread를 상속하여 구현합니다. 이때 Thread를 new MyThread().start()로 호출할 수 있지만 java.utli.concurrent 패키지의 ExecutorService를 이용하여 실행할 수 있습니다. ExecutorService에서 Task를 지정해주면 가지고 있는 Thread..