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年前2828ビュー
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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン