当您已经有了应用程序端池时

当您已经有了应用程序端池时

本文介绍了当您已经有了应用程序端池时,您还需要 AWS RDS 代理吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为这个问题的后续

当您已经有了应用程序端池时,您还需要 AWS RDS 代理吗?

Do you still need an AWS RDS proxy when you already have an application side pooling in place?

我有一个 Springboot 应用程序,它使用默认的 HikariDataSource 来管理数据库连接池.我们计划使用的数据库驱动程序是 MariaDB Connector/J,因为它可以处理 Aurora 故障转移,而且它也是 AWS 在其 文档.该应用程序具有相当稳定的小负载,没有太多尖峰.但是,它应该是高度可用的.

I have a Springboot application which uses the default HikariDataSource to manage the db connection pool. For the database driver we plan to use is MariaDB Connector/J because it can handle aurora failover and it's also the one recommended by AWS in its documentation. The application has fairly stable small load, not much spikes. But, it should be highly available.

然而,我们也发现了 RDS 代理,它也管理数据库连接池和故障转移.

However, we also found RDS proxy which also manages db connection pooling and failover.

我想使用 RDS 代理,以便减轻管理数据库连接池和处理应用程序故障转移的负担.但是,似乎我无法关闭 Springboot 中的应用程序端池(默认情况下在那里).而且我还需要一个驱动程序来连接到数据库,所以我不妨使用连接器/J.使用我拥有的这些堆栈/工具,RDS 代理是否过多且多余?

I want to use RDS Proxy so that I can ease the burden of managing the db connection pool and handling of failover from the application. But, it seems like I could not turn off the application-side pooling in Springboot (it's in there by default). And I also need a driver to connect to the database so I might as well use the Connector/J. With these stack/tools I have, is an RDS proxy an too much and redundant?

推荐答案

正如您所指出的,AWS 正在发布一个 JDBC 驱动程序,它也知道如何进行更快的故障转移.例如,它知道如何在故障转移后找到正确的数据库实例,这样您就不必担心 缓存的 DNS 信息.如果您对驱动程序的故障转移功能感到满意,那么 RDS 代理也无济于事.

As you point out, AWS is releasing a JDBC driver that also knows how to do faster failover. For example, it knows how to find the right DB instance after a failover, so that you don't have to worry about cached DNS information. If you're happy with the failover functionality of the driver, then RDS Proxy doesn't help.

但是,RDS 代理仍然可以在您的场景中增加价值.例如,假设您需要水平扩展应用程序.应用程序的每个实例都有自己的连接池,如果添加足够多的实例,则会超过数据库的最大连接数设置.RDS 代理通过处理来自您的应用程序和 多路复用 它们连接到数据库.RDS 代理本身会尊重您的数据库的最大连接数设置.

However, RDS Proxy still adds value in your scenario. For example, let's say that you need to scale your application horizontally. Each instance of your application has its own connection pool, and if you add enough instances then you will exceed the max connections setting of the database. RDS Proxy helps in this scenario by handling the connections from your application, and multiplexing them to connections to the database. RDS Proxy itself will respect the max connections setting of your database.

这篇关于当您已经有了应用程序端池时,您还需要 AWS RDS 代理吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 20:09