[DRIVERS-2018] Language specific examples for AWS Lambda Created: 05/Jan/22 Updated: 22/Feb/23 Resolved: 22/Feb/23 |
|
| Status: | Closed |
| Project: | Drivers |
| Component/s: | Docs Examples |
| Fix Version/s: | None |
| Type: | Epic | Priority: | Major - P3 |
| Reporter: | Bernie Hackett | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 1 |
| Labels: | size-medium | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Changes: | Needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quarter: | FY23Q2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Downstream Changes Summary: | Write language specific versions of the existing Javascript example for AWS Lambda and test that the examples work. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Engineering Lead: | |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Product Manager: | |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Program Manager: | |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Cost Threshold %: | 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Compliance: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
We field a lot of complaints about the behavior of drivers when using AWS Lambda. Lambda is a stateless function as a service provider. Drivers maintain a ton of state. A Lambda application has to be written a specific way to ensure an instance of MongoClient is reused on each invocation of a lambda function. Happily, our docs team wrote a guide: https://docs.atlas.mongodb.com/best-practices-connecting-from-aws-lambda/ Sadly the guide only provides Javascript examples. It also only covers AWS Lambda, not Azure Functions, which are getting popular for .NET developers and are likely to get popular for other languages. This ticket proposes writing language specific versions of the existing Javascript example for AWS Lambda and test that the examples work. There will be a dependent ticket in the DOCS project to add these new examples to the existing docs. |
| Comments |
| Comment by Oleg Pudeyev (Inactive) [ 25/Apr/22 ] | ||
|
Any find or insert operation should work, for example using Ruby syntax:
alek.antoniewicz@mongodb.com I expect drivers that do no i/o in constructor to behave in the described manner. | ||
| Comment by Bernie Hackett [ 25/Apr/22 ] | ||
|
oleg.pudeyev@mongodb.com can you make a proposal to fix that in the smallest way possible? | ||
| Comment by Oleg Pudeyev (Inactive) [ 25/Apr/22 ] | ||
|
These examples as requested print the configured database name which will be done regardless of whether the connection to deployment succeeds. In other words, someone can type up the code in these examples, run it, it will run successfully but their client wouldn't have connected to the deployment and hence no actual operations would work once they try to execute any. | ||
| Comment by PM Bot [ 18/Jan/22 ] | ||
|
If you are not logged in, you can view the tickets in this epic by following this link. | ||
| Comment by Jonathan DeStefano [ 06/Jan/22 ] | ||
|
Thanks for the heads up, great idea. I scheduled some time for us to discuss as a group and flesh this out a bit more. | ||
| Comment by Bernie Hackett [ 05/Jan/22 ] | ||
|
We should also suggest that users of function as a service providers use Atlas Serverless. Drivers work in load balancer mode for Atlas Serverless, eliminating almost all of SDAM (though not connection pooling). | ||
| Comment by Drew DiPalma (Inactive) [ 05/Jan/22 ] | ||
|
Cloudflare Workers do not support the MongoDB drivers and I don't believe Cloudflare is planning to support them in the near future. We recently partnered with Cloudflare to show how you can use a Realm SDK as Joe notes (see here and here) and the Data API would also be an option.
Generally, we may also want to note that the Data API is a good option for serverless as it will take care of connection pooling and some users will prefer REST vs. Driver. | ||
| Comment by Rita Martins Rodrigues (Inactive) [ 05/Jan/22 ] | ||
|
Thank you Joe. jonathan.destefano let's discuss how we should collaborate on this one. | ||
| Comment by Joe Drumgoole (Inactive) [ 05/Jan/22 ] | ||
|
cc jonathan.destefano r.rodrigues
We should decide who can pick up this work between dev rel and docs. We have content for CloudFlare : https://www.mongodb.com/developer/how-to/cloudflare-worker-rest-api-realm/
| ||
| Comment by Bernie Hackett [ 05/Jan/22 ] | ||
|
FYI will.shulman |