Lambda connecting to on-prem oracle

0

What would be a good connection pooling strategy for Lambda connecting to on-prem Oracle? Assume the network connectivity has been established. Should I use provisioned concurrency?

4개 답변
0

If your intention is to reduce the number of concurrent lambda invocations to a certain number so you don't open more than a fixed number of connections to your on-prem Oracle database, then you may want to look at reserved concurrency - https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html

Provisioned concurrency helps reduce cold start times because the lambda service keeps that many lambda functions initialized and ready to act on an event, so you don't pay the cold start penalty.

profile pictureAWS
전문가
답변함 2년 전
  • I don't want every Lambda that inits to open a new connection to database. Like in a typical non-serverless applications you maintain a pool of connections to database and avoid opening a connection prior to issuing the query (or transaction) - much like what RDS Proxy offers. One option I can think of is using provisioned concurrency - since we have a warm pool each one can have one open session but its still inefficient.

0

Have you considered using Database Resident Connection Pool (DRCP) on Oracle Database? It provides a connection pool in the database server. You can see the detailed information by the following document. https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/managing-processes.html#GUID-BB76E57C-3F16-4C85-AEF6-BA14FC1B4777

AWS
답변함 2년 전
  • Yes, someone from aws team recommended this. Have not had a chance to experiment but Thank you for sharing.

0

You can't really have a connection pool inside Lambda as each Lambda instance is isolated for the others. RDS proxy is an external component that we use to create a connection pool, but it does not support Oracle or on-premises databases.

If you want to actually have a connection pool, you will need to create your own proxy layer, similar to RDS proxy, that Lambda functions connect to, and it connects to the database.

Another option is to limit the number of Lambda function instances so that you do not have too many connections. This is not really a connection pool, but it will protect the database from to many connections. The way to limit number of instances is using Reserved Concurrency. The functions will create the DB connection at Init time and will maintain it open for the life time of the function.

profile pictureAWS
전문가
Uri
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠