Q38 — AWS SAA-C03 第3章

第 38/65 题 | ← 返回第3章

Q168.一家公司在 AWS 上托管无服务器应用程序.该应用程序使用 Amazon API Gateway. AWS Lambda 和 Amazon RDS for PostgreSQL 数据库.该公司注意到,在高峰流量或不可预测的流量期间,由于数据库连接超时而导致的应用程序错误有所增加.公司需要一种解决方案,能够以最少的代码更改量来减少应用程序故障.解决方案架构师应该怎么做才能满足这些要求?

正确答案: B. 在 RDS 数据库实例上启用 RDS 代理.

解析

To meet the requirement of reducing application failures resulting from database connection timeouts during peak traffic periods or unpredictable traffic for a serverless application using Amazon API Gateway, AWS Lambda, and an Amazon RDS for PostgreSQL database with the least amount of change to the code, a solutions architect should enable RDS Proxy on the RDS DB instance. Therefore, option B is the correct answer.Option A suggests reducing the Lambda concurrency rate, which may reduce the overall load on the system but could also negatively impact performance during normal operation.Option C suggests resizing the RDS DB instance class to accept more connections, which can work but requires manual configuration and may not be cost-effective.Option D suggests migrating the database to Amazon DynamoDB with on-demand scaling, which could work, but this would require significant changes to the application architecture and database schema.Enabling RDS Proxy on the RDS DB instance provides a fully managed solution that helps to reduce application errors resulting from database connection timeouts. RDS Proxy manages the pooling and reuse of database connections, helping to reduce overhead. This approach requires minimal changes to the application code, while providing a scalable, secure, and reliable solution for managing database connections.对于使用Amazon API Gateway、AWS Lambda和Amazon RDS for PostgreSQL数据库的无服务器应用程序,为了减少由于高峰流量期间数据库连接超时或不可预测的流量而导致的应用程序故障,并且对代码的更改最少,解决方案架构师应该在RDS DB实例上启用RDS Proxy。因此,选项B是正确答案。选项A建议降低Lambda并发率,这可能会降低系统的总体负载,但也可能对正常操作期间的性能产生负面影响。选项C建议调整RDS DB实例类的大小以接受更多的连接,这可以工作,但需要手动配置,并且可能不具有成本效益。选项D建议通过按需扩展将数据库迁移到Amazon DynamoDB,这是可行的,但这需要对应用程序体系结构和数据库模式进行重大更改。在RDS DB实例上启用RDS Proxy提供了一个完全托管的解决方案,有助于减少数据库连接超时导致的应用程序错误。RDS Proxy管理数据库连接的池化和重用,有助于减少开销。这种方法只需要对应用程序代码进行最小的更改,同时为管理数据库连接提供了可伸缩、安全和可靠的解决方案。