Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use NoSQL instead of MySQL?

I'm using PHP to develop web applications. I've used MySQL as my RDMS. For many things an RDMS works, and many problems can be solved by normalization, among other things. But some situations just don't work well with an RDMS, so other solutions such as NoSQL have been devised.

What isn't clear to me is what situations would NoSQL be a better fit. How do some of the different NoSQL options differ, what situations one might be better than another, and which are compatible with PHP 5.3 or above (API wise)?

So I'm looking for a list of NoSQL server software I can use (such as MySQL as an RDMS) and why I would use one over the other (any Hybrids?). Also specific examples of problems that are solved by using NoSQL instead of an RDMS.

Finally, I want to know if a NoSQL server would work better in this situation:

A table of data where each row can have different columns/fields. One row might have 5 columns, another might have 5 completely different columns, and another might have 10. But out of all these rows, there is a single primary auto-incremented numerical ID. Millions of "rows".

(Just with the above I'm assuming that NoSQL is perfect as it's a collection of objects, not rows in a table. Not sure about A.I primary key).

In an RDMS you might create the columns that are most used, then use PHP's serialize/unserialize to store other columns.. But this is very inefficient and complicates things when you have to run reports on columns that exist in this "serialized array", such as a SUM on all rows of a column called "birthday_pledge" (with each row where that is used).

In my situation every "column", other than the primary key, is custom and user defined. But I need to be able to run reports (sums, filters, searches) on these "columns". So if NoSQL isn't the solution, the only thing I can think of doing is creating custom tables for the user (that can get complicated though).

I also want to point out that scalability (multiple database servers, redundancy, and failover) is very important.

like image 202
Luke Avatar asked Nov 13 '22 16:11

Luke


1 Answers

http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis

This article compare most populars nosql database system and theire pro/con.

Hope it can help.

PS : In my idea what you are looking for is couchdb or mongodb but I can be wrong.

like image 168
Manuel Leduc Avatar answered Dec 10 '22 07:12

Manuel Leduc