PostgreSQL
MongoDB
Our great sponsors
PostgreSQL | MongoDB | |
---|---|---|
57 | 11 | |
11,907 | 9,953 | |
- | 0.3% | |
8.0 | 9.1 | |
2 days ago | 2 days ago | |
JavaScript | TypeScript | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PostgreSQL
-
Neon Is Generally Available: Serverless Postgres
pg doesn't do too well with serverless, dead connections are left in the pool (or something)
https://github.com/brianc/node-postgres/issues/2112
-
NodeJS Security Best Practices
If you don't want to use ORM then there are some other packages as well! For PostgreSQL we have node-postgres
-
Building Secure Neon-Infused Web Apps with Auth0, Express, and EJS
Interface with PostgreSQL database
-
Drizzle is just as unready for prime-time as Prisma, what else is there?
(Instead of the following with pg.)
-
Nile, Serverless Postgres for Modern SaaS
So far every JS framework that uses https://node-postgres.com works great and so no reason to think Drizzle wouldn't.
-
We migrated to SQL. Our biggest learning? Don't use Prisma
One thing that keeps coming up is that SQL equals low productivity. I don't think this is true. I think the culprit is that most developers are using to heavily abstracting SQL using ORMs like Prisma that hides the database and SQL logic.
Since building a SQL generator (https://aihelperbot.com) as a side project, I have become much more proficient in SQL and even though I am also locked into Prisma, I use the `queryRaw` all the time to execute raw SQL queries. You can understand the code without knowing Prisma API. It is more performant. For more complex SQL queries, I use the SQL generator for initial suggestions and adapt if needed.
For the next projects I build I want to use the minimal Postgres client (https://github.com/brianc/node-postgres) combined with a lightweight migration library.
-
Using AI I have departed from ORM and embraced SQL
For newer projects I use the small Postgres client. Initially my leap into SQL was lead by AI but as I refreshed and relearned SQL, I now use a mixture of AI and self-written SQL queries. Something like this is just easier to have AI do the grunt work and then adjustment as needed.
-
Credentials Leak with Knex
This was a known issue for pg developers, and they managed to fix it a long time ago (at the pg level), but the knowledge of this problem didn't reach Knex maintainers.
-
Why SQL is right for Infrastructure Management
Integrate the database into your application itself with a postgres client library allowing your applications to make infrastructure changes (like provisioning sharded resources for a client that wants isolation, or using a more accurate forecasting model to pre-allocate more resources before the storm hits).
-
What is your development stack for 2023?
node-postgres (raw sql, without ORM)
MongoDB
-
How does one set up MongoDB using "vanilla" JS?
The MongoDB JavaScript driver uses and requires node.js, which is what 99.9% of server-side JavaScript implementations use.
-
The Case for C# and .NET
Mongo Drivers
If you look at how major backend projects structure their code, it's almost always object-oriented TypeScript.
I submit for the record:
- Apollo Client: https://github.com/apollographql/apollo-client/blob/main/src...
- Storybook: https://github.com/storybookjs/storybook/blob/next/lib/chann...
- Nest: https://github.com/nestjs/nest/blob/master/packages/core/nes...
- MongoDB Driver: https://github.com/mongodb/node-mongodb-native/blob/main/src...
- Prisma: https://github.com/prisma/prisma/blob/main/packages/engine-c...
-
Save Transcripts to MongoDB with a Node.js Webhook
The MongoDB Node.js Driver, to save data to MongoDB;
-
Error filtering not working
The error probably is a MongoServerError, not MongoError, see https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/errors.md
-
Intro to MongoDB and Mongoose - How Every Web Developer Can Become FullStack With Node.js
The most basic way to interact with MongoDB is using the Official MongoDB Node.js Driver, in this guide we will use Mongoose an object modeling tool.
- Mongo Atlas Upgrading M0 M2 M5 shared instances to v5.0 (Mid Feb)
-
Define MongoDB _id-Type as String
Now when you use the collection, you'll get better type support for for all the collection methods. Note that I had to make the _id required on the schema. If you make it optional, you still get a type error. The node driver team is working on this and other issues related to the type of _id in this PR: https://github.com/mongodb/node-mongodb-native/pull/3077
-
Connect to MongoDB Atlas from SvelteKit
To communicate with MongoDB database we will need Node driver mongodb. So install it.
-
Totally stuck with listIndexes calls. Our volunteer social project building community migrated from Mlab to Mongo DB's Atlas in Nov and all our sites died. I've tried everything i can think to get the platform back up. Can anyone help or offer advice?
Could this _ensureIndex be the problem? I think that may be calling into listIndexes here: https://github.com/mongodb/node-mongodb-native/blob/2b18411d2f57e06d11262d5a308c56a9f561789e/lib/operations/db_ops.js#L305. IIRC, ensureIndex is deprecated, and you should use createIndex instead. I'm not familiar with meteor, so I'm not exactly sure what that code looks like, but the README shows how to access the underlying MongoDB driver directly: https://github.com/meteor/meteor/tree/devel/packages/mongo#direct-access-to-npm-mongodb-api. Hope that helps!
What are some alternatives?
Prisma - Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
MySQL - A pure node.js JavaScript Client implementing the MySQL protocol.
Redis - 🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
TypeORM - ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
Aerospike - Node.js client for the Aerospike database
LevelUP - A wrapper for abstract-leveldown compliant stores, for Node.js and browsers.
slonik - A Node.js PostgreSQL client with runtime and build time type safety, and composable SQL.
nano