0

Let's say that when a user logs into a webapp, he sees a list of information.

Let's say that list of information is served by one of two dynos (via heroku), but that the list of information originates from a single mongo database (i.e., the nodejs dynos are just passing the mongo information to a user when he logs into the webapp).

Question: Suppose I want to make it possible for a user to both modify and add to that list of information.

At a scale of 1,000-10,000 users, is the following strategy suitable:

  1. User modifies/adds to data; HTTP POST sent to one of the two nodejs dynos with the updated data.
  2. Dyno (whichever one it may be) takes modification/addition of data and makes a direct query into the mongo database to update the data.
  3. Dyno sends confirmation back to the client that the update was successful.

Is this OK? Would I have to likely add more dynos (heroku)? I'm basically worried that if a bunch of users are trying to access a single database at once, it will be slow, or I'm somehow risking corrupting the entire database at the 1,000-10,000 person scale. Is this fear reasonable?

  • From a strictly practical point of view, the only correct answer to a question like this is "build a quick prototype and try to break it." Leaving this as a comment since someone with MEAN experience can probably pick out part(s) are likely to be bottlenecks. – Ixrec Apr 5 '15 at 13:23
  • However, I doubt the "single mongodb database" will be the problem, since most databases these days can be spread across multiple machines for scaling purposes. I randomly stumbled across this DBA SE question which might help. – Ixrec Apr 5 '15 at 13:25
  • 1
    Keep in mind that 1000 users won't be accessing your system (i.e. POSTing) simultaneously, unless there are millions of users. – Robert Harvey Apr 5 '15 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.