전체 글
-
인텔리제이로 스프링부트 시작하는 법Spring Framework 2022. 3. 24. 23:21
우선 인텔리제이를 다운로드하여 보겠습니다. 인텔리제이 홈페이지 https://www.jetbrains.com/ko-kr/idea/download/#section=windows 다운로드 IntelliJ IDEA: 우수성과 인체 공학이 담긴 JetBrains Java IDE www.jetbrains.com 설치방법은 여기서 너무 친절하게 알려주십니다. https://goddaehee.tistory.com/195 [IntelliJ] Intellij 설치방법 [IntelliJ] Intellij 설치방법 안녕하세요. 갓대희 입니다. 이번 포스팅은 [ IntelliJ 설치 방법 ] 입니다. : ) Eclipse에서 IntelliJ로 갈아탄 친구에게 추천받았는데, 개발 퍼포먼스 면에서 엄청 .. goddaehee.t..
-
Service Discovery란?MSA & 쿠버네티스(Kubernetes) - k8s 2022. 3. 24. 18:05
Service Discovery란? MSA로 구성되어 있는 서비스들은 각자 다른 IP와 Port를 가지고 있습니다. MSA와 같은 분산 환경은 서비스 간의 원격 호출로 구성되며 원격 서비스 호출은 IP주소와 포트를 이용하는 방식입니다. 클라우드 환경이 되면서 서비스가 Auto-Scaling등에 의해서 동적으로 생성되며 서비스의 IP가 동적으로 변경되는 일이 잦아졌습니다. 따라서 서로 다른 서비스들의 IP와 Port 정보에 대해서 저장하고 관리할 필요가 있는데 이것을 Service Discovery라고 합니다. AutoScaling이란? 사용자가 정의한 주기나 이벤트에 따라 서버를 자동으로 생성하거나 삭제하는 것을 말합니다. 제공하는 서비스에 대해서 사용자가 몰리거나, 여유로운 시간대에 서버를 자동으로 늘..
-
로그인 기능 구현 시 고려 사항(쿠키, 세션, 로컬 스토리지, 인증과 인가, 토큰, Oauth)프로젝트/게시판 프로젝트 2022. 3. 24. 01:19
로그인 기능을 위한 사전 지식 쿠키란? 쿠키는 클라이언트(브라우저) 로컬에 저장되는 키와 값이 들어가 있는 작은 데이터 파일입니다. F12로 개발자 모드를 켜고 document.cookie를 하면 현재 쿠키 정보가 나옵니다. 사용자 인증이 유효한 시간을 명시할 수 있으며, 유효시간이 정해지면 브라우저가 종료되어도 인증이 유지됩니다. 쿠키는 클라이언트의 상태 정보를 로컬에 저장했다가 참조합니다. 클라이언트에 300개까지 쿠기가 저장 가능하며, 하나의 도메인당 20개의 값을 가질 수 있습니다. 하나의 쿠키값은 4KB까지 저장됩니다. 쿠키의 구성 요소 이름 : 각각의 쿠키를 구별하는 데 사용되는 이름 값 : 쿠키의 이름과 관련된 값 유효시간 : 쿠키의 유지시간 도메인 : 쿠키를 전송할 도메인, 만약 이 값이 ..
-
[Java] 직렬화(Seralize)란?Java 2022. 3. 24. 00:01
직렬화(Seralize)란? 자바 시스템 내부에서 사용되는 Object 또는 Data를 외부의 자바 시스템에서도 사용할 수 있도록 byte 형태로 데이터를 변환하는 기술 객체를 파일 등에 저장하거나 네트워크로 전송하기 위해 연속적인 데이터로 변환하는 것 JVM의 메모리에 상주되어 있는 객체 데이터를 바이트 형태로 변환하는 기술 CSV, JSON의 경우 우리에게 많이 친숙한데 이들 또한 데이터를 문자열 형태로 확인 가능하도록 직렬화한 방법입니다. 그러면 자바에서도 CSV, JSON을 사용되는걸 직렬화를 써야 하는 이유는 무엇일까요? 정답은 없고 목적에 따라 적절하게 써야 합니다. CSV, JSON 형태의 포맷을 이용하면 특정 라이브러리를 도입해야하며, 구조가 복잡하면 직접 매핑시켜야 하는 작업도 포함해야 ..
-
스프링 부트 - 회원 관리 예제 실습 (컴포넌트 스캔과 자동 의존관계 설정)Spring Framework 2022. 3. 23. 00:01
MemberService와 MemberRepository를 만들었습니다. 또한 테스트 코드를 통해 회원가입이 잘 동작하는 것도 테스트해 보았습니다. 이제 여기에 화면을 붙이려면 Controller와 View Template가 필요합니다. Controller는 MemberService를 통해 회원을 추가해야 합니다. 또한 MemberService는 MemberRepository를 통해 회원의 정보를 조회하고 등록합니다. 따라서 Controller -> MemberService -> MemberRepository 의존관계가 성립합니다. 1. hello.hellospring.controller 패키지에 MemberController.java 파일 생성 package hello.hellospring.contro..
-
로드 밸런서(Load Balancer)란?MSA & 쿠버네티스(Kubernetes) - k8s 2022. 3. 22. 02:08
로드 밸런서(Load Balancer)란? 하나의 인터넷 서비스에 발생하는 트래픽이 많을 때 여러 대의 서버가 분산 처리하여 서버의 로드율 증가, 부하량, 속도 저하 등을 고려하여 적절히 분산 처리해주는 서비스입니다. 클라이언트 요청 또는 네트워크 부하를 여러 서버에 효율적으로 분산시킵니다. 온라인 상태인 서버에만 요청을 보내 고가용성과 안전성을 보장합니다. 수요에 따라 서버를 추가하거나 제거할 수 있는 유연성을 제공합니다. 로드 밸런서는 왜 필요할까요? 로드 밸런서가 왜 필요한지 알아보기 전에 먼저 서버에 대해 조금 알아보겠습니다. 만약 하나의 서버에 수많은 클라이언트들이 요청하면 서버는 메모리가 부족해 다운될 수 있습니다. 이를 해결하기 위해서는 어떻게 해야 할까요? Scale-up : Server가..
-
[백준] 3040번 : 백설 공주와 일곱 난쟁이 - 자바(JAVA)알고리즘/백준 2022. 3. 22. 00:01
https://www.acmicpc.net/problem/3040 3040번: 백설 공주와 일곱 난쟁이 매일 매일 일곱 난쟁이는 광산으로 일을 하러 간다. 난쟁이가 일을 하는 동안 백설공주는 그들을 위해 저녁 식사를 준비한다. 백설공주는 의자 일곱개, 접시 일곱개, 나이프 일곱개를 준비한다. www.acmicpc.net 문제 해석 일곱 난쟁이의 모자의 합은 100이다 그런데 갑자기 아홉 난쟁이가 등장하여 각자 자신이 진짜라고 우기는 상황이다. 이때 모자의 합을 통해 진짜 난쟁이가 누구인지 판별하라 모든 숫자는 서로 다르고, 답이 유일한 경우만 입력으로 주어진다. 문제 풀이 전 설계 N의 크기가 9이며 조합을 통한 완전 탐색으로 해결합니다. 9C7을 통해 7명의 난쟁이를 뽑고 모자의 합이 100이라면 출력..
-
[백준] 2089번 : 외판원순회 - 자바(JAVA)알고리즘/백준 2022. 3. 21. 00:18
https://www.acmicpc.net/problem/2098 2098번: 외판원 순회 첫째 줄에 도시의 수 N이 주어진다. (2 ≤ N ≤ 16) 다음 N개의 줄에는 비용 행렬이 주어진다. 각 행렬의 성분은 1,000,000 이하의 양의 정수이며, 갈 수 없는 경우는 0이 주어진다. W[i][j]는 도시 i에서 j www.acmicpc.net 문제 해석 N개의 도시가 존재합니다. 도시를 연결하는 단방향 도로가 존재하며 도로를 가는 데는 비용이 존재합니다. 문제 풀이 전 설계 1번도시에서 출발한 경우, 2번 도시에서 출발한 경우를 모두 DFS를 통해 완전 탐색해보기 -> 시간 초과 문제 풀이하면서 1번 도시에서 출발한 경우, 2번 도시에서 출발한 경우를 세어줄 필요는 없습니다. 어떤 도시를 선택해도 ..