Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is 'column-adding' (schema modification) a key advantage of a NoSQL (mongodb) database over a RDBMS like MySQL [closed]

I recently went to a tech talk sponsored by 10gen on NoSQL/MongoDB. I'm not a DBA superguru or anything, and the speaker made an interesting point intended to illustrate one of the strengths of using a NoSQL database.

The example was this: Craigslist is using MySQL. They have a huge table with millions, maybe hundreds of millions of records. They need to modify the schema of this table by adding a column to it. Since there are so many records in this table, actually adding the column takes 3 months

He goes further to say that with a NoSQL database, you don't have to do anything - just start saving objects to a collection with that extra property you want to record.

I get this, maybe it takes a while to modify a huge dataset with an RDBMS engine. But is this really a huge downside of an RDBMS? Was this an exaggeration? Can such an operation be sped up?

like image 980
Casey Flynn Avatar asked Jun 14 '13 21:06

Casey Flynn


People also ask

What are the advantages of NoSQL database over RDBMS?

When compared to relational databases, NoSQL databases are often more scalable and provide superior performance. In addition, the flexibility and ease of use of their data models can speed development in comparison to the relational model, especially in the cloud computing environment.

What are the advantages of MongoDB over MySQL?

MongoDB was designed with high availability and scalability in mind, and includes out-of-the-box replication and sharding. MySQL concept does not allow efficient replication and sharding but in MySQL one can access associated data using joins which minimizes duplication.

What is the advantage of MongoDB over other NoSQL databases?

Advantages of MongoDB over RDBMS MongoDB NoSQL databases and relational databases differ in many ways. Not only is MongoDB easy-to-use, but it also supports excellent scaling options. Moreover, the performance capabilities of MongoDB are unbeatable compared to other databases.

Which of the following is an advantage of NoSQL database?

NoSQL databases are widely used in real-time web applications and big data, because their main advantages are high scalability and high availability.


1 Answers

I would be highly skeptical of that 3 month time frame. I've worked with MySQL tables before with hundreds of millions of rows, and even on hardware from years ago, adding a column might take at most a few days, not months. Of course this varies by the amount of data contained in each row, but I'd still be skeptical.

Of course just extending the table using an ALTER TABLE is probably not the best way to go...it's usually much faster to create a new table from the old one (CREATE TABLE [new table] LIKE [old table]), alter the schema on the empty table, copy all the rows from the old table to the new table, (INSERT INTO [new table] SELECT [fields] FROM [old table]), then rename the new to the old.

like image 126
Josh Liptzin Avatar answered Oct 11 '22 12:10

Josh Liptzin