MongoDB vs MySQL

From WikiVS, the open comparison website
(Redirected from MySQL vs MongoDB)
Jump to: navigation, search
MySQL MongoDB
MySQL
VS
MongoDB
http://www.mysql.com/ http://mongodb.org

MySQL is a relational database with fixed schema[edit]

  • Internal structure proprietary to the storage engine and exposed through an SQL interpreter
  • Best-practice to normalize to Third Normal Form or better

MongoDB is a non-relational NoSQL schemaless database[edit]

  • Internal BSON structure (binary JSON-like format) exposed through a JavaScript interface
  • Best-practice to de-normalize data

GUI Administration Tools for PHP[edit]

MySQL[edit]

  • phpMyAdmin 30mb, hundreds of files, lots of configuration settings

MongoDB[edit]

  • phpMoAdmin 90kb, single self-configuring file, Fast AJAX interface

Leadership[edit]

MySQL[edit]

MongoDB[edit]

  • 10gen CEO: Dwight Merriman (cofounder of DoubleClick and many other successful startups)

Scaling[edit]

MySQL[edit]

  • Typical: replication and clustering
  • Other options: sharding and federated databases

MongoDB[edit]

  • Typical: replication and sharding


Index Systems[edit]

MySQL[edit]

  • B-Tree (default)
  • Hash (Memory tables and NDB only)

MongoDB[edit]

  • B-Tree (default)
  • Geospatial 2D

Resource Utilization[edit]

MySQL[edit]

  • Disk Space, MyISAM: Marginally larger than the data plus indexes
  • Disk Space, InnoDB: Somewhat larger than the data plus indexes
  • RAM: Allocates as much RAM as available; even more with memory tables. Improper MySQL configuration can leave the OS without any available RAM.
  • CPU: Allocates a reasonable amount of CPU, relative to the task

MongoDB[edit]

  • Disk Space: between 2x and 10x data size, minimum active-database size of 50mb
  • RAM: Allocates a reasonable amount of RAM
  • CPU: Marginal, relative to the task

Terminology[edit]

  • MySQL table = Mongo collection
  • MySQL row or record = Mongo document or object
  • MySQL column = Mongo node of a document object

Related Videos[edit]