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?
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.
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.
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.
NoSQL databases are widely used in real-time web applications and big data, because their main advantages are high scalability and high availability.
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.
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