Saas MongoDB + Node.js Architecture - node.js

guys!
Sorry if there's another question like mine. I just searched a lot but couldn't find an answer.
Let's say I'm willing to create an business management app for schools, and let's say I really need one database for each user.
I'm now using Express + MongoDB + Angular. I just stuck at this question.
How should I build it? I mean, is there any MongoDB driver that allow, I don't know, something like 200 concurrent connections in differente databases? If yes, is there enough documentation for it?
Thank you very much.

Related

How do I make NodeJS applications scalable

I am designing a chat application in NodeJS using express, mongo db, socket io. What points should I keep in focus while designing the architecture for this application. The target audience for this app is going to be more then 50K users concurrently using it.
I have previously in my career designed apps that were used by 2k end users at max. But this is something new for me. I did a lot of research on it and came up with the following points.
1- Start using queuing services like RabbitMQ
2- Increase your server space/ram as the usage increases.
Can someone please point me in the write direction a book on NodeJS architecture patterns and scalability. A guide, a walk through any sort of help is highly appreciated.
Here some tips:
You should take a look at the Cluster module you can also use wrk for HTTP benchmark.
Make sure you use caching.
If you are using Docker you should use the swarm mode.
Use Amazon Elastic https://aws.amazon.com/ec2/

PostgreSQL + Node Integration

Need some advice regarding the following situation:
There is an existing PostgreSQL database that I would like to draw information from (with full authorization of course). How can I query the entries in that database using NodeJS? I know sequelize can offer what I'm looking for, but I'm a bit confused as to how to approach this. I've heard that I would have to migrate the data first in order to then query it. What's the best way to go about doing this? Thanks.
For reference, I've taken a look at this link (https://github.com/sequelize/sequelize/issues/3791) but haven't gotten what I'd hoped out of it.
You can query without migration for existing database, this package should help https://www.npmjs.com/package/pg

How to change a MongoDB schema on request

I'm about to develop an application in MEANJS. Now I think it would be a nice thing to change the mongodb connection, at least the schema, programatically.
The reason why I'm thinking about this is, so I can have seperate and different data, by driving the same application code.
I read the API documentation for mongoose, but didn't find anything about this.
Has anyone done this or something similar, or has a better suggestion?
Thanks in advance.
Markus

Notify User to New Data

I'm using mongodb with mongoose and node.js with express.
I'm building a communication platform where users can post suggestions for certain other users to view and respond. If two users are using at once, is there a way for there to be live real time updates of new suggestions. I know I can use websockets for this, but I was wondering what standard practice is without websockets. If someone could point me in the right direction that would be great. I've only been coding for 6 months, so I'm still learning! Thank you.
socket.io
it uses websocket when possible. If browser does not support it.long polling is used
But you write the same code once for all situations. it handles them for you

Store Node.js IM App conversations in MongoDB properly

I'm Developing (yet another) Node,js + Express + Socket.IO Facebook/like Instant Messaging app.
The server-side is mostly complete, but I was looking for a proper way to store and retrieve conversations and I thought I could give MongoDB a try.
I've never worked before with noSQL databases before, so I would like some suggestions on how to deal, mainly, with the writing the proper way.
I was thinking in creating entries containing the user chatting and the chatlines with a timestamp, something simple.
Any thoughts?
Though this does not exactly address the app you are looking to build, 10gen (to company that supports mongodb) has released a video of a presentation walking through the creation of an IRC chat server. This is a very long and very extensive presentation and should cover most of the material that will be relevant for you in building your app. Definitely seems to me like the best resource for you to get started with.
http://www.10gen.com/presentations/mongonyc-2012-building-mongodb-power-chat-server
Hope this helps!

Resources