전체글236 [사용자 수에 따른 규모 확장성] 캐시 캐시는 값비싼 연산 결과 또는 자주 참조되는 데이터를 메모리 안에 두고, 뒤이은 요청이 보다 빨리 처리될 수 있도록 하는 저장소입니다. 캐시 계층 캐시 계층(cache tier)은 데이터가 잠시 보관되는 곳으로 데이터베이스보다 훨씬 빠릅니다. 별도의 캐시 계층을 두면 성능이 개선될 뿐 아니라 데이터베이스의 부하를 줄일 수 있고, 캐시 계층의 규모를 독립적으로 확장시키는 것도 가능해집니다. (캐시 서버를 두는 방법 중 하나) 요청을 받은 웹 서버는 캐시에 응답이 저장되어 있는지를 봅니다. 만일 저장되어 있다면 해당 데이터를 클라이언트에 반환합니다. 없는 경우에는 데이터베이스 질의를 통해 데이터를 찾아 캐시에 저장한 뒤 클라이언트에 반환합니다. 이러한 캐시 전략을 읽기 주도형 캐시 전략(read-throug.. 2021. 9. 1. [스프링 입문] 순수 JDBC 환경 설정 build.gradle 파일에 jdbc, h2 데이터베이스 관련 라이브러리 추가 implementation 'org.springframework.boot:spring-boot-starter-jdbc' runtimeOnly 'com.h2database:h2' 스프링 부트 데이터베이스 연결 설정 추가 spring.datasource.url=jdbc:h2:tcp://localhost/~/test spring.datasource.driver-class-name=org.h2.Driver spring.datasource.username=sa 주의!: 스프링부트 2.4부터는 spring.datasource.username=sa를 꼭 추가해주어야 합니다. 그렇지 않으면 Wrong user name or pa.. 2021. 8. 31. [스프링 입문] H2 데이터베이스 설치 개발이나 테스트 용도로 가볍고 편리한 DB, 웹 화면 제공 https://www.h2database.com/ 다운로드 및 설치 h2 데이터베이스 버전은 스프링 부트 버전에 맞춥니다. 권한 주기: chmod 755 h2.sh(윈도우 사용자는 x) 실행: ./h2.sh(윈도우 사용자는 h2.bat) 데이터베이스 파일 생성 방법 jdbc:h2:~/test(최초 한번) ~/test.mv.db 파일 생성 확인 이후부터는 jdbc:h2:tcp://localhost/~/test 이렇게 접속 테이블 생성하기 테이블 관리를 위해 프로젝트 루트에 sql/ddl.sql 파일을 생성 drop table if exists member CASCADE; create table member ( id bigint generated b.. 2021. 8. 31. [스프링 입문] 회원 웹 기능 - 조회 회원 컨트롤러에서 조회 기능 package hello.hellospring.controller; import hello.hellospring.domain.Member; import hello.hellospring.service.MemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation... 2021. 8. 31. 이전 1 ··· 32 33 34 35 36 37 38 ··· 59 다음