Cloud

Aurora 도입 맨땅 헤딩

Zac 2021. 5. 13. 09:57

mariadb 10.5.9 -> aurora (MySQL 5.7) 2.09.2

 

1. charset이 기본이 latin1이라서 utf8mb4로 변경

2. timezone이 UTC라서 Asia/Tokyo로 변경

3. 위 설정을 변경하기 위해 파라미터그룹 변경을 사용

4. 각종 config 값들 비교중

5. grant 만으로 계정생성 및 권한이 한방에 되지 않음. create user로 계정생성 후 grant 로 권한을 줘야하는데 grant all도 안되고 grant select, insert, update,  이런식으로 다 지정해줘야함. aurora만 그런건지 mariadb만 grant로 한방에 되었던건지 기억이 가물하지만

여튼 aurora는 저렇게 해야함.

 

개발변경

1. 기존에 db통신에 ssl을 사용고 있지 않았는데 aurora는 ssl이 enable이 default이고 변경도 안되기 때문에

당장 적용을 위해서 자바 연결문자열에서 useSSL=false 추가해줘야 했음.

 

2. 서비스쿼리에서 maraidb의 json_arrayagg, json_object등의 함수를 사용하였는데 Aurora에서는 지원하지 않는상황.

MySQL에서는 5.8에서 도입된듯함. 대신 Aurora에서 별도로 구현한듯한 JSON 함수를 알려주긴 했는데

https://aws.amazon.com/ko/blogs/database/using-json-with-mysql-5-7-compatible-amazon-aurora/

 

Using JSON with MySQL 5.7–compatible Amazon Aurora | Amazon Web Services

What’s the big deal about JSON support in MySQL 5.7? MySQL 5.6 supports numeric, date and time, string (character and byte) types, and spatial data types. Although this is a broad set of supported types, these primitive data types can limit your flexibil

aws.amazon.com

해당 링크 함수들로 대체가 되더라도

DB서버 부하분산에 불리한 점과, 추후 DBMS 변경시 용이하도록 가급적 JSON처리는 자바단에서 구현해달라고 개발자에게 변경 요청함.