-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Release] 동시성 문제 해결 및 캐시를 적용하여 성능 개선을 한다. (#203)
* feat: 골룸 노드 목록 조회 시 노드 설명과 이미지 반환하도록 수정 * [feat/CK-227] 로드맵 골룸 조회 시 최신순일때는 모든 상태를, 마감임박 순일 땐 모집 중인 상태만 반환한다 (#185) * chore: 패키지 경로 수정 * feat: 조건에 따른 로드맵 골룸 조회 시 쿼리 수정 * refactor: 1:N 문제 방지를 위해 @batchsize 설정 * feat: 로드맵 골룸 응답에 골룸 상태 추가 * chore: 서브모듈 업데이트 * chore: 패키지 경로 수정 * refactor: 메서드 네이밍 수정 * refactor: BaseEntity의 CreatedAt 스프링 의존성 끊기 (#191) * refactor: MemberIdentifierArgumentResolver에서 Authenticated 어노테이션 확인하도록 수정 (#193) * [feat/CK-232] 전역적으로 사용하는 Exception을 분리하고 AOP로 예외를 변환하는 기능을 구현한다. (#194) * refactor: exception 패키지를 service 패키지 하위로 이동 * feat: 도메인 Exception을 서비스 Exception으로 변환해주는 AOP 구현 * [feat/CK-222] Redis를 도입하고 Refresh Token을 Redis에 저장하도록 변경한다 (#190) * build: spring data redis 및 testcontainers 의존성 추가 * feat: RefreshToken 레디스에 저장하도록 변경 * test: Redis 테스트 설정 및 RefreshTokenRedisRepository 테스트 * chore: 서브모듈 업데이트 * refactor: JwtTokenProvider에서 RefreshToken 생성해서 반환하도록 수정 * refactor: 리뷰 반영 * refactor: RedisTemplate으로 변경 * test: JwtTokenProvider 테스트 추가 * test: test config에 redis 설정 추가 * test: test 추가 * chore: 기존 refresh token table을 drop하는 쿼리 추가 * refactor: ttl을 초단위로 변경하는 로직 변수 추출 * refactor: 변수명 변경 * refactor: 레디스 테스트 간 격리 * chore: git submodule 업데이트 * [feat/CK-235] Redis 캐시를 적용한다 (#197) * test: test container에 의존하지 않도록 변경 * feat: redis cache 적용 * feat: redis config 설정 수정 * fix: RedisConfig를 test에서 비활성화 시킨다 * test: CacheKeyGenerator test code 작성 * feat: 수정 요구사항 반영 * chore: 서브모듈 최신화 * chore: 서브모듈 최신화 * chore: flyway v4 파일 제거 * chore: flyway v4 파일 복구 * [feat/CK-237] 골룸 참여 시 발생하는 동시성 이슈를 해결한다 (#199) * refactor: 골룸 참여 시 발생하는 동시성 이슈를 비관적 락으로 해결 * test: 테스트 코드 수정 * [feat/CK-236] JdbcTemplate을 이용하여 bulk insert를 적용한다 (#198) * refactor: 기존 saveAll, deleteAll을 bulk insert로 개선 * refactor: Dao 대신 Repository 계층에 의존하도록 수정 - JdbcRepository 추상화 * [feat/CK-239] Amazon S3 접근 시 credential 정보를 이용하도록 수정한다 (#201) * feat: amazon s3 접근 시 credentials 사용하도록 수정 * test: test application.yml에 credentials 추가 --------- Co-authored-by: Miseong Kim <[email protected]> Co-authored-by: Ohjintaek <[email protected]> Co-authored-by: Miseong Kim <[email protected]> Co-authored-by: Ohjintaek <[email protected]>
- Loading branch information
1 parent
7088f17
commit c73aa21
Showing
148 changed files
with
1,094 additions
and
807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
backend/kirikiri/src/main/java/co/kirikiri/common/config/JpaConfig.java
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
backend/kirikiri/src/main/java/co/kirikiri/common/config/RedisConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package co.kirikiri.common.config; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | ||
import java.time.Duration; | ||
import org.springframework.cache.CacheManager; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.data.redis.cache.RedisCacheConfiguration; | ||
import org.springframework.data.redis.cache.RedisCacheManager; | ||
import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; | ||
import org.springframework.data.redis.serializer.RedisSerializationContext; | ||
import org.springframework.data.redis.serializer.RedisSerializer; | ||
import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
|
||
@Configuration | ||
@EnableCaching | ||
@Profile(value = {"prod", "dev", "local"}) | ||
public class RedisConfig { | ||
|
||
@Bean | ||
public RedisTemplate<String, String> redisTemplate(final RedisConnectionFactory redisConnectionFactory) { | ||
final RedisTemplate<String, String> redisTemplate = new RedisTemplate<>(); | ||
redisTemplate.setConnectionFactory(redisConnectionFactory); | ||
redisTemplate.setKeySerializer(new StringRedisSerializer()); | ||
redisTemplate.setValueSerializer(new StringRedisSerializer()); | ||
return redisTemplate; | ||
} | ||
|
||
@Bean | ||
public CacheManager redisCacheManager(final RedisConnectionFactory redisConnectionFactory) { | ||
final ObjectMapper objectMapper = new ObjectMapper(); | ||
objectMapper.registerModule(new JavaTimeModule()); | ||
objectMapper.activateDefaultTyping(objectMapper.getPolymorphicTypeValidator(), ObjectMapper.DefaultTyping.EVERYTHING); | ||
|
||
final RedisSerializer<Object> serializer = new GenericJackson2JsonRedisSerializer(objectMapper); | ||
|
||
final RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() | ||
.entryTtl(Duration.ofMinutes(30L)) | ||
.disableCachingNullValues() | ||
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(serializer)); | ||
|
||
return RedisCacheManager.RedisCacheManagerBuilder | ||
.fromConnectionFactory(redisConnectionFactory) | ||
.cacheDefaults(redisCacheConfiguration) | ||
.build(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
backend/kirikiri/src/main/java/co/kirikiri/common/interceptor/AuthInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
backend/kirikiri/src/main/java/co/kirikiri/controller/GlobalExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
backend/kirikiri/src/main/java/co/kirikiri/domain/BaseCreatedTimeEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.