MongoDB vs MySQL

From WikiVS, the open comparison website
(Redirected from MySQL vs MongoDB)
Jump to: navigation, search


[edit] MySQL is a relational database with fixed schema

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

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

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

[edit] GUI Administration Tools for PHP

[edit] MySQL

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

[edit] MongoDB

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

[edit] Leadership

[edit] MySQL

[edit] MongoDB

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

[edit] Scaling

[edit] MySQL

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

[edit] MongoDB

  • Typical: replication and sharding

[edit] Index Systems

[edit] MySQL

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

[edit] MongoDB

  • B-Tree (default)
  • Geospatial 2D

[edit] Resource Utilization

[edit] MySQL

  • 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

[edit] MongoDB

  • 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

[edit] Terminology

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

[edit] Related Videos

Personal tools