简体   繁体   English

在无服务器应用程序架构中处理大负载大小

[英]handling large payload size in serverless app architecture

I have a serverless web app that is hosted on AWS.我有一个托管在 AWS 上的无服务器 web 应用程序。

Backend:后端:

1- Codebuild that fetch data from mysql DB and put it into dynamoDB 1- 从 mysql 数据库获取数据并将其放入 dynamoDB 的代码构建

2- API Gateway to send request to the Lambda that fetch all items in the dynamoDB 2- API 网关发送请求到 Lambda 获取 dynamoDB 中的所有项目

Front end:前端:

1- Angular JS code that send end flag(LastEvaluatedKey ) via API request to lambda 1- Angular 通过 API 请求向 lambda 发送结束标志(LastEvaluatedKey)的 JS 代码

2- Angular UI component primeng that show response in a table, the page takes large time to load. 2- Angular 在表格中显示响应的 UI 组件 primeng,页面加载时间较长。

The data in dynamo DB is pretty HUGE , and I'm doing a pagination on Lambda side to bring 100 record each time until it is completed. dynamo DB 中的数据非常巨大,我正在 Lambda 端进行分页,每次都带来 100 条记录,直到完成。

issue : on UI side, it takes large time to bring the full data, how can I enhance this to provide more user friendly experience?问题:在 UI 方面,获取完整数据需要很长时间,我该如何增强它以提供更友好的用户体验?

So your table is 6.7MB and you are doing a full table Scan which will require you to read the entire dataset, resulting in 7 Scan requests, each holding 1MB of data before filters are applied.所以你的表是 6.7MB,你正在做一个全表Scan ,这将需要你读取整个数据集,导致 7 个Scan请求,每个请求在应用过滤器之前持有 1MB 的数据。

As you've come to know, this approach is not scalable, as the performance of your query will degrade over time as data grows (the exact issue NoSQL was created to combat).正如您所知,这种方法不可扩展,因为随着数据的增长,您的查询性能会随着时间的推移而降低(创建确切的问题 NoSQL 是为了解决这个问题)。

My advice to you is to create a schema that allows you to use more efficient queries such as GetItem or Query where you only target the specific data tou require rather than the entire table.我对您的建议是创建一个模式,让您可以使用更高效的查询,例如GetItemQuery ,您只针对您需要的特定数据而不是整个表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无服务器图像处理程序请求大文件大小时出现 502 错误 - 502 error when Serverless image handler requests a large file size 增加 EventGrid 的事件大小,以防止 413 Payload Too Large - Increase EventGrid's event size, to prevent 413 Payload Too Large Azure 应用服务(Linux Nginx)文件上传错误413(Payload Too Large) - Azure App service (Linux Nginx) file upload error 413 (Payload Too Large) AWS 无服务器图像处理程序错误处理 - AWS Serverless Image Handler Error Handling 无服务器堆栈的 AWS 多区域高可用性架构 - AWS Multi region high availability architecture for serverless stack Google BigQuery 负载大小限制为 10485760 字节 - Google BigQuery Payload size limit of 10485760 bytes CORS 关于在无服务器框架中使用 REACT 应用程序的问题 - CORS question on using a REACT app with Serverless Framework “errorMessage”:在 AWS 无服务器上部署时“server.app.use 不是一个函数” - "errorMessage": "server.app.use is not a function" while deploying on AWS serverless NextJs:Serverless Function 超过最大大小限制 50mb - NextJs: The Serverless Function exceeds the maximum size limit of 50mb 大规模简单聊天 web 应用程序的架构 - Architecture of a simple chat web app at scale
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM