#MongoDB vs #MySQL
Who Uses These Databases?
MySQL: MySQL has been maturing since 1995 and has grown a large following. Some organizations that use MySQL include Pinterest, Twitter, YouTube, Netflix, Spotify, US Navy, NASA, Walmart, and Paypal.
MongoDB: MongoDB was released in 2009 and is used by many organizations including Klout, Citrix, Twitter, T-Mobile, Zendesk, Sony, Hootsuite, SurveyMonkey, MuleSoft, Foursquare, and InVision
Are Indexes Needed?
Both MySQL and MongoDB use indexes to allow them to find data quickly.
MySQL: With MySQL, if an index is not defined, the database engine must scan the entire table to find all relevant rows.
MongoDB: In MongoDB, if an index is not found, every document within a collection must be scanned to select the documents that provide a match to the query statement.
What About Database Structure?
MySQL: MySQL stores its data in tables and uses the structured query language (SQL) to access the data. MySQL uses #schemas to define the database structure, requiring that all rows within a table have the same structure with values being represented by a specific data type.
MongoDB: In MongoDB, data is stored in JSON-like documents that can have varied structures. To improve query speed, MongoDB can store related data together, which is accessed using the MongoDB query language. MongoDB is schema-free, allowing you to create documents without having to define the structure of the document first. These documents can be easily changed by adding or deleting fields.