I've done most of my web development using PHP/MySQL/Solr on the backend and Javascript/jQuery/Backbone on the frontend.
I've already written some Node apps, but using MySQL instead of Mongodb/Couchdb which many Node tutorials/books uses. Would you start using Mongo/Couch instead of MySQL because most people developing Node is using it? MySQL seems to work fine for me and I'm unclear of the advantages of switching to Mongo/Couch.
Right now I am starting a site where the "frontend" app server is PHP/MySQL, and the number crunching server is in Node. My reason for sticking to PHP to serve the "frontned" is because I'm extremely comfortable developing in my PHP framework.
Reason for choosing Node is because there will be alot of simultaneous tasks with idle/wait times in the order of seconds. And this has to be highly scalable.
Things that will be stored in the database are like the usual stuff you would store in a MySQL table
Even though Node. js works well with MySQL database, the perfect combination is a NoSQL like MongoDB wherein the schema need not be well-structured. MongoDB represents the data as a collection of documents rather than tables related by foreign keys.
If you have relational data MySQL is a superior choice to MongoDB. For simple stuff MongoDB is fine, but when trying to tie a lot of relational data together MongoDB is a nightmare.
There are many web servers built with nodejs that will then use MongoDB for storing data. MongoDB offers an API library that runs within a Nodejs application to give you programmatic access to MongoDB so you can create databases and then add, query, update or delete data from the MongoDB database.
It won't really be a MEAN stack anymore, seeing as "M" stands for MongoDB, but you can indeed use native MySQL drivers or ORM wrappers.
Some of the things you need to consider -
Conclusion: Paraphrasing from NoSQL
The real thing to point out is that if you are being held back from making something super awesome because you can’t choose a database, you are doing it wrong. If you know mysql, just used it. Optimize when you actually need to. Use it like a k/v store, use it like a rdbms, but for god sake, build your killer app! None of this will matter to most apps. Facebook still uses MySQL, a lot. Wikipedia uses MySQL, a lot. FriendFeed uses MySQL, a lot. NoSQL is a great tool, but it’s certainly not going to be your competitive edge, it’s not going to make your app hot, and most of all, your users won’t give a shit about any of this.
What am I going to build my next app on? Probably Postgres. Will I use NoSQL? Maybe. I might also use Hadoop and Hive. I might keep everything in flat files. Maybe I’ll start hacking on Maglev. I’ll use whatever is best for the job. If I need reporting, I won’t be using any NoSQL. If I need caching, I’ll probably use Tokyo Tyrant. If I need ACIDity, I won’t use NoSQL. If I need a ton of counters, I’ll use Redis. If I need transactions, I’ll use Postgres. If I have a ton of a single type of documents, I’ll probably use Mongo. If I need to write 1 billion objects a day, I’d probably use Voldemort. If I need full text search, I’d probably use Solr. If I need full text search of volatile data, I’d probably use Sphinx.
Too Funny & too relavent to NOT Post Again - MongoDb is Web Scale
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With