[TIL] 1228 Document DB
Today I Learnt
화창한 날씨! 근데 집안은 춥다... 왜 그럴까
갑자기 만들어야하는 페이지가 생겼다.
[ ] 원래 만들던 인스타그램 api
[ v] 회사이름 및 이메일 검색 기능
[ ^ ] document db
[ ] AWS ramda
크리스마스 코딩 때 코드 리뷰받은 것과 다른 사람 이 짠 코드를 보면서 지금까지 내가 계속해오던 것들과는 다르게 좀 더 예외처리도 꼼꼼히 해보고 , variable name 들도 이쁘게 바꿔보고 가독성 있는 코드를 짜 봤다.
확실히 개발자 이벤트를 가면 이런 점이 좋은것같다.
처음 해보는 해커톤이었지만 이렇게도 배워가면서 새로운 것들을 배울 수 있으니 좋구나~
document DB
document DB는 mongodb와도 competiable 하고 비용이 제일 적게? 드는것같다.
하지만 documentDB 에대한 정보는 확실히 dynamo나 mongodb보다 현저히 적은것같다.
https://www.youtube.com/watch?v=dlRu2uF2fqI
1. cloud watch 로 설정해서 돈얼마나쓰고있는지 확인하샘 ( 50% 75%)
2. 대충 한시간에 80원? 한달에 60불정도 (제일작은거)
무료로 사용할수없어서 mongodb 나 dynamo db에 비해서 자료가없는건가?
https://calculator.aws/#/createCalculator/DocumentDB
AWS Pricing Calculator
calculator.aws
3. monitoring 으로 여러가지볼수있으니깐 잘쓰샘
4. 7일까지 정지할수잇음 -> 금요일날 정지하고 월욜날 다시 시작할수있음 (주말에안쓸꺼면)
설정하는방법은 공식 페이지에 잘나와있음.
https://docs.aws.amazon.com/documentdb/latest/developerguide/get-started-guide.html
Get Started with Amazon DocumentDB - Amazon DocumentDB
Get Started with Amazon DocumentDB There are many ways to connect and get started with Amazon DocumentDB. We created this guide because we found this way to be the quickest, simplest and easiest way for users to get started using our powerful document data
docs.aws.amazon.com
1. Cluster설정
2. 몽고디비 연겨하는것처럼 연결
당연히 한방에안됌.
MongoParseError: Password contains unescaped characters
비밀번호에 특수문자있을경우:
mongodb://bang618:${encodeURIComponent('your password')}@docdb-2021-12-28-13-48-30.cluster-crygjry5ittt.ap-northeast-2.docdb.amazonaws.com:27017/?ssl=true&ssl_ca_certs=rds-combined-ca-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false
그리고나면 또나오는 새로운 에러
MongoParseError: option ssl_ca_certs is not supported
아... 이건뭐야?
찾아봣더니
Amazon DocumentDB (with MongoDB compatibility) clusters are deployed within an Amazon Virtual Private Cloud (Amazon VPC). They can be accessed directly by Amazon EC2 instances or other AWS services that are deployed in the same Amazon VPC. Additionally, Amazon DocumentDB can be accessed by EC2 instances or other AWS services in different VPCs in the same AWS Region or other Regions via VPC peering.
However, suppose that your use case requires that you (or your application) access your Amazon DocumentDB resources from outside the cluster's VPC. In that case, you can use SSH tunneling (also known as port forwarding) to access your Amazon DocumentDB resources.
It is beyond the scope of this topic to discuss SSH tunneling in depth. For more information about SSH tunneling, see the following:
뭐라구요? AWS VPC밖에서 사용할려면 EC2를 뚫어서 SSH 터널을써야된다고여? 아 머리아퍼...
아 잠시만 내일 다시확인해보고...
'IT > TIL(Today I Learnt)' 카테고리의 다른 글
[TIL] 0111 Happy coding (0) | 2022.02.07 |
---|---|
[TIL] 1229 항해4기 (2) | 2021.12.30 |
[TIL] 1225 메리크리스마스 (0) | 2021.12.27 |
[TIL] 1214. (1) | 2021.12.14 |
[TIL] 2109 (0) | 2021.12.12 |