- 기존 코드 테스트 하던 중 여러 이슈를 발견하였다.
- 시큐리티 작업을 잠시 미루고 수정 작업에 들어간다.
1. Cache Data 저장 및 조회 이슈
USER/ADMIN Cache Not Match
- USER에서 조회 요청으로 인해 저장된 Cache를 Admin에서 조회하려고 할 때 에러 발생
- 직렬화/역직렬화 과정에서 사용한 Response 객체 형태가 달라서 발생한 문제로 확인
- 저장시엔 MainGetResponse, 조회시엔 ApiGetResponse로 조회했었다.
- 캐시 저장시에도 ApiGetResponse 형태로 저장하도록 통일
2. Redis Data a lot of Prefix Null Insert 이슈
- Redis에 데이터 저장 시 무수한 NULL 값이 앞에 같이 삽입되는 문제가 발생
- 정확한 원인은 파악을 하지못함
- 데이터 통신 등의 상황에서 발생한 오류로 추정
- 마땅한 좋은 방법을 찾지 못해 get으로 조회할 때 trim()메서드로 양 옆 공백으로 지우고 사용.
- 임시 해결
3. 데이터 정합성 문제
- 캐시서버에서 PUT, POSE, DELETE에 관해서 요청이 들어오면 Main 서버에게 바로 전송하고 결과를 처리하는 구조이다.
- 요청은 보내나 그 이후 결과에 따른 캐시 데이터 정합성 맞추기 작업이 구현되어있지 않음
- 또한 변경한다고 해도 어떻게 할 것인지에 대해 이슈가 있음
- 수정이나 추가 요청이 발생할 시 어떻게 추가하고 수정할 것인가?
- 요청에서 넘어온 값들이 완전하다면 그대로 저장하면된다.
- 그러나 변경, 추가에 대한 일부 값만 넘어온다면? 혹은 main에서 결과 값에 변경이 있었던 데이터를 반환해주지 않는다면?
- 현재 내부 데이터의 구조를 신경 쓰지 않고 String 형태로 그대로 전달만 하기에 변경 사항만 확인해서 저장하기는 무리가 있음
- 또한 여러 캐시에 쓰이는 정보가 바뀔 경우 다른 캐시의 정보도 바꿔줄 수 없음
- 아직 해결책은 미발견 상태