Similarly, with Mongoose, you can limit your surface area of lower level API access, but unlock a lot of potential gains and good DX. Plus, for the most part you don't need to have the power C gives you to implement websockets. The Python example would be much easier and faster for you as a developer to implement with higher productivity.Ĭ might be more efficient, but it'll come at a huge cost in productivity/speed of development/bugs/crashes.
Best mongodb client for nodejs 2018 full#
Sometimes it boosts productivity 1000x+ because you never really need to have full access to the underlying API anyway.Ī good way to think about it is you technically create a realtime chat app both in C and in Python. But that doesn't necessarily mean it is bad. The general rule of thumb with abstractions (the way I understand) is that with every abstraction you lose some low-level operation power.
Best mongodb client for nodejs 2018 driver#
Mongoose is an abstraction over the native MongoDB driver (the npm package I mentioned above). You need to reduce your surface area of bugs and screw-ups you can make in your code.
More power means more surface area to get things wrong. Now remember, the MongoDB driver is responsible for connecting and abstracting the low level communication request/responses from you – but this only gets you so far as a developer.īecause MongoDB is a schemaless database, it gives you way more power than you need as a beginner. MongoDB driver is available as an npm package here. MongoDB server listens on a TCP socket (usually), and your Node.js process can connect to it using a TCP connection.īut on the top of TCP, MongoDB also has its own protocol for understanding what exactly the client (our Node.js process) wants the database to do.įor this communication, instead of learning the messages we have to send on the TCP layer, we abstract that away with the help of a "driver" software, called MongoDB driver in this case.
This article is one of the part codedamn's backend learning path, where we start from backend basics and cover them in detail. In this article, we'll review some of the best practices to follow when you're setting up MongoDB and Mongoose with Node.js. And it has a great community and ecosystem. MongoDB is undoubtedly one of the most popular NoSQL database choices today.