Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-752

Connecting to mongo replica set from AWS Lambda function using node.

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.1.8
    • Component/s: Lambda, MongoDB 3.2
    • Labels:

      For some reason, probably because of filling connection pool, it takes 700-1000 ms to connect to mongodb replica set. While it's not a very big problem for general purpose node application (still problem though), when you can connect once and then re-use MongoClient instance, in Amazon Lambda environment it doesn't make any sense.

      I'd say, this effectively prevents us from using MongoDB with amazon Lambda, which is kind of sad. And I'm not the only person who has this problem so far:
      http://stackoverflow.com/questions/31728414/mongodb-connections-from-aws-lambda

      The proposed in the thread way to work around this problem doesn't look like right thing to do. Also, we use python driver as well, and it doesn't seem to have anything like that. In fact, it takes up to 70 milliseconds to connect to replica set deployed on Amazon EC2 instance from my local machine.

      Any thoughts?

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            sunrize531@gmail.com Ivan Filimonov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: