Cloud arquitecture for web system

0

Hi, we have a system developed in python, the system is for answer questions about pdf legal text files using chatgpt api, works like this: User logins (mysql for validate and store user data), then the user make querys in natural language (we use chatgpt api, FAISS for vector embeddings), the system reads text pdf files stored in S3, and chatgpt answers in text and cite the corresponding pdf files with a link; for now we have all in a single ec2 instance (is for about 20 concurrent users), but what is the best aproach to publish this system?, please consider cost, availability and eficient.

Thanks C.

質問済み 23日前268ビュー
2回答
1

Hi,

You don't specify if you use a specific Python application framework like Flask.

So, here is an AWS-proposed architecture for a Flask-based application: https://github.com/aws-samples/three-tier-web-application-flask

Enter image description here

It is quite thorough with muliple AZs, Load Balancer, etc.

Best,

Didier

profile pictureAWS
エキスパート
回答済み 22日前
  • It looks very complete, we will discuss with developer, we are consider app runner for this too. Thanks for your answer.

0

If the usage level is fairly constant and you want to keep it on EC2 then right-size the instance type so you're only paying for the compute that you need. And consider a reserved instance to reduce costs over the longer-term.

If usage level varies the consider putting the EC2 instances into an auto-scaling group that grows and shrinks as required.

Although as EC2 can take a while to provision on-the-fly, you may want to containerise the application to mitigate this, and improve the user experience.

As your code is already written in Python it could be a good candidate for Lambda function, and implement the whole thing using a fan-out architecture. Caution here that a Lambda function has a maximum run time of 15 minutes, so each discrete invocation of the function would have to be less than this (if it's longer you could consider a Step Function, although it's probably better off on EC2 or containers in that case).

profile picture
エキスパート
Steve_M
回答済み 22日前

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

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

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

関連するコンテンツ