4 ms·
It still isn't tho, this will work for testing, maybe, but each lambda will be it's own connection and that will exhaust db resources real fast, you're supposed
by avereveard 3y ago
It still isn't tho, this will work for testing, maybe, but each lambda will be it's own connection and that will exhaust db resources real fast, you're supposed to have a pooling proxy between lambdas and RDS.
- scarface_74 3y agoI asked ChatGPT the same question again and then followed up with: “Is there a more efficient way to connect to the database” It then went off the rails. It gave me generic answers about using connection pooling that your language framework provides. Of course that doesn’t help with each Lambda being invoked separately. I then asked “But each Lambda runs based on its own vm” It then correctly said that while each Lambda invocation would have its own pool and couldn’t be shared, it could be shared with multiple connections during one invocation. Which is technically correct. But not the answer I was looking for. In all fairness, it’s the same type of answers I would expect from a junior to mid developer with limited experience with AWS. I would hire a person who could answer that well.
- deleted 3y ago[deleted]
- BoorishBears 3y agoAny time you ask ChatGPT a technical question on something you're not familiar with it should be three parts: - What are the considerations? - Implement it with the considerations - Did we forget anything? It understands the need for a proxy from step 1: https://chat.openai.com/share/7ca37130-a771-457c-8742-a5f941973fb8 https://chat.openai.com/share/7ca37130-a771-457c-8742-a5f941...
- re5i5tor 3y agoYes! Excellent approach, capturing.
- re5i5tor 3y agoI do short quote-posts on my blog and wrote this one up.
- scarface_74 3y agoThat technique didn’t work when I asked it to create a Python script to return all IAM roles with a certain set of policies attached. It still missed using a paginator to handle the list_roles call returning more than 50 roles. Once I pointed it out, it did add pagination support.
- BoorishBears 3y agoI try not to cheat and hint at specific issues (since that relies on prior knowledge) I'd be surprised if even after the last prompt it wouldn't notice that. Saying "Did we miss anything" leaves it open it to re-evaluate both the implementation and the original considerations Edit: There's some non-determinism involved, but GPT-4 caught the pagination from planning stage here: https://chat.openai.com/share/3c356d4f-15d4-4f6e-bd29-af6a0b0095fd https://chat.openai.com/share/3c356d4f-15d4-4f6e-bd29-af6a0b...
- scarface_74 3y agoFunny enough, even in my original question, it put pagination as a consideration. But it still didn’t include it.
- Aeolun 3y agoDepends, if every lambda creates a single connection you can get to pretty high numbers before it becomes an issue.
- CSDude 3y agoAnd it's in the docs, RDS Proxy, launched in 2020, before GPT training cut-off https://aws.amazon.com/about-aws/whats-new/2020/06/amazon-rds-proxy-generally-available/ https://aws.amazon.com/about-aws/whats-new/2020/06/amazon-rd...
- avereveard 3y agoCut off date shouldn't matter for RAG