When & Where Do You Use Mongo And Nodejs

shauntir

Well-Known Member
Joined
Sep 11, 2013
Messages
457
Reaction score
0
Location
Durban
Mongo and Nodejs seems to be the new ruby on rails high.

I've taken the time to learn and read more about these. The "MEAN" stack.

What I would like to know is, have you developed a successful product/project using Mongo as a datastore. Have you also had success with Nodejs?

If so, what was your use case and is the app still successful? Has enhancements and maintenance been easier or more difficult when compared to a tradtional stack?
 
Use case? When you want to write a highly scalable network applications, where performance is key. Mongo is not a relational database and as such should not be used or man handled to act like one.

I have had very good success with nodejs our main app is written with it, we have some nodejs worker processors and some scala ones.

Your app is only as successful as your idea or your marketing it has nothing to do with the platform/language you wrote it in.

Updates are a breeze, test case everything up to specific versions of modules if need be, ensure they past tests, deploy.
 
Yes, I gather that it is used for scalable network apps. I also agree that mongo should not be used like a relational db.

For too many blog posts, I have seen people wanting to use mongo where relational should be used.

Also, I'm only asking this from a purely technical standpoint when I refer to "successful". It interests me to see how people use technologies and what their specific use case is.

In your case, what type of application have you built? If you're allowed to say :)
 
Without going into to much detail, our application is a SaaS system. Purely dealing with finance related items. We chose nodejs as we wanted something very light weight and very fast. There was a learning curve and many nights where i wanted to kick my laptop in the screen, but at the end it turned out rather nice.
 
i use couchdb which is similar to mongo on my devscore website when i want to keep data in a non relational format.

it's useful so far for allowing me to aggregate data that's not the same shape

Also looked at couch db and was impressed with it.

So, if I get this correct, you're using both a relational db and couch db? Does your relational model also keep the data in couch?
 
Also looked at couch db and was impressed with it.

So, if I get this correct, you're using both a relational db and couch db? Does your relational model also keep the data in couch?

yep i am using both.
no my relational model doesn't keep data in couch.
i use standard sql via entity framework for my data.
so the site runs off of sql as standard.

but for reporting, and keeping track of whats happening on my site i use a couchdb instance.

i have a document "object" i call an activity.
an activity is a json structure that has a datetime, a name, a description, a type, a few other things and then it also has a payload. my payload is another json object, and its shape depends on whatever activity it is you're doing.

so when you perform a review, i might save the actual review object as my payload.
or when you perform a search, i might save the search queries (the words, the dropdown values etc) as the payload.
or when you view a particular tag, i might save the userID and the tagID as the payload.
the point is just this allows me to save anything really, along with the date and time it happened.

if i did this in sql, i would have to store these as blobs or something. which sucks ass coz you can't query it.

using couch i can write a query on the activity itself, so maybe view all activities on this date, or on this hour, or whatever.
or i can query all activities where the datetime is this, and the type is "search" and the payload.searchwords is something else.
i can query the payload directly.

also, querying your reporting db might have a negative performance impact, whereas couch i'm making async http posts or gets so sql isn't affected at all and all the other users on the site won't feel it.

you "use" couch through json.
because my couchdb is a hosted instance, i interact with it via async http calls.
its not the same as the way i interact with entityframework.

entity framework uses c# classes, whereas i do have one class for my activity table, but i tend to use a lot of dynamic objects when querying the payloads.
 
Last edited:
they prolly said "its fast, we know its fast, it was written to be fast, google says its fast, voxer says its fast, so does twitter and walmart and so its fast"

No that would be your response.
 
Load testing, IO speeds against our hardware, response times, latency between page loads (we wrote our own test bench app). And we used this https://loader.io/

So you built your own node app that simulates your expected operating conditions. Nifty. I assume this was evaluated against existing infrastructure? Mind sharing what platform you where using before and the performance gains you saw from node?
 
So you built your own node app that simulates your expected operating conditions. Nifty. I assume this was evaluated against existing infrastructure? Mind sharing what platform you where using before and the performance gains you saw from node?

Our web server is

36 gig ram
24 logical processors
SSD drives

Our simulation app randomly spiked the connections and calls per sec, and then reduced randomly. We had it in asp.net and saw a significant increase in page loads, and round trips, IO hits.
 
pretty much.. to be fair nodejs is a language that can be as slow or as fast as you write.. it's suited to some operations but not others..

io bound great.. cpu bound isn't bad but there might be something better. but the only times i have ever seen it slow is when something or someone has blocked the event loop

i just love coding the front and back in the exact same language..

end of the day it's just a tool. it's good for certain things and not good at others.
 
pretty much.. to be fair nodejs is a language that can be as slow or as fast as you write.. it's suited to some operations but not others..

io bound great.. cpu bound isn't bad but there might be something better. but the only times i have ever seen it slow is when something or someone has blocked the event loop

i just love coding the front and back in the exact same language..

end of the day it's just a tool. it's good for certain things and not good at others.

You can code your app as the same in the front and the back with node.
 
Top
Sign up to the MyBroadband newsletter
X