How to use postgres rest api in AWS

0

Hi Team, we are currently using the postgrest api (https://postgrest.org/en/stable/) in AWS EC2 instance .

Do we have any service offered by AWS. Please do let me know which service have to used ? we are planning to use it on Production not sure which service is reliable and provided by AWS.

질문됨 2년 전2823회 조회
2개 답변
0
profile picture
답변함 2년 전
0

Hi,

There are some factors I think you can consider before choose the service to be used. One of example, number of expected traffic , traffic pattern, scaleability and security. You can consider some of services combination:

In high level overview with assumption you will handle huge write and read traffic:

  • Api management (for security, canary deployment) + Load balancing (service to distribute traffic) + compute layer (to run Postgrest).
  • For Api management you can use = API Gateway
  • For Load balancing you can use = ALB
  • For compute layer you can use = EC2+auto scaling group, EKS, or Lambda. Since i read that Postgrest has docker official image also = https://hub.docker.com/r/postgrest/postgrest/.
  • For caching you can use = ElasticCache
  • For message queing you can use = SQS
  • For security protection such as to handle from SQL injection can use = AWS WAF integrated with Api gateway or ALB
  • For connection pooling you can use = RDS Proxy

Sample solution combination can be like this:

  1. Api gateway + ALB + EC2 and auto-scaling group
  2. API gateway + ALB + EKS with Karpenter
  3. Api gateway + ALB + Lambda

Please read this reference to help you decide if you want to choose serverless or kubernetes: https://aws.amazon.com/architecture/serverless/serverless-or-kubernetes/.

Then, for frequent data which required sub mili latency you can enable caching to some API endpoint Api gateway + Elastic cache. And you can also consider to push some write request into SQS for queue before handling it to Postgrest. For security you can integrate AWS WAF to protect api gateway or ALB. And finally to improve your api you can consider use RDS Proxy to help with connectoin pooling (multiplexing) management.

Please alo do due diligence of above services and feature availability in your region: https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/

Thank you hope it can give some insight for you.

profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠