-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrated mongodb driver code #112
Conversation
Hi @christkv. Thanks for the contribution! Just a heads-up that when we accept this pull request, we'll be converting it to become a new test that we'll name "nodejs-mongodb-raw." We aim for every test that does not include the "raw" suffix to use an ORM of some flavor. We have some other tests that do not use an ORM, but rather their platform's native connectivity, such as "php-raw" and "servlet-raw." This additional raw test will be a great comparison data point. |
sounds good :) On Apr 8, 2013, at 3:57 PM, bhauer notifications@github.com wrote:
|
Hi again @christkv. Would you and @bjornstar mind taking a look at issue #33 raised by @sidorares? He points out that since the queries are intended to be independent, we should either:
Running async statements on the same connection yields a sequential run of the statements anyway because each connection can process only one statement at a time internally. Note: In the JVM space, at high client concurrency within our tests (128 or 256), the value of server-side concurrency fan-out vanishes. We're already saturating the cores of the server's CPU at that level of client-side concurrency. Nevertheless, as I understand it, it is idiomatic in node.js to use async for scenarios such as running a bunch of independent queries as we are. I don't have a preference between the two above options; I would rather defer to folks with more node.js expertise. |
I don't see what's wrong with using async as a control flow library to collect the results of all the database queries. All of these tests are using connection pooling so it should be as parallel as it can get. Also thanks @christkv for doing the raw version 😸 |
@bjornstar - no, it's not parallel, at least in nodejs-mysql-raw example. Each request gets connection from pool (which is ok) and then performs N queries on that connection sequentially. They are not run in parallel despite |
I see what you're getting at. You want to have a connection for each request. Go for it. I don't think async is getting in the way of that. |
See #125 |
Mongoose is a bit slow in comparison with the driver (about 1/2 of the performance) so changed it to use the mongodb driver directly