MySQL Use Case: When to Use MySQL

Table of Contents

Introduction

"NOSQL" solutions like CouchDB, MongoDB, and Redis are popular new choices for storing data. Learn when to choose MySQL over these new options, including what use cases are most appropriate for MySQL, and when it will be a "best fit" for your project needs.

Scenario 1: Customer Data

In this scenario, the user is an e-commerce seller who needs to store and manage customer data. This data includes the customer's contact information (mailing address, email address, etc.) as well as information about their past purchases. This database will be used to send the customer personalized product recommendations and special offers.

MySQL is the best choice for this user for several reasons:

  • The data is relational. For example, there is a "one-to-many" relationship between each customer record and all of the products they have purchased. And each product has a "one-to-many" connection to all of the customers which have purchased it in the past.
  • The data is highly structured and standardized, so there is no need for a flexible data model.
  • The data needs to be stored permanently.
  • The queries will not need to include any elaborate JOIN statements which might reduce performance.

Scenario 2: Blogging Platform

In this scenario, the user wants to either use an existing blogging platform, or build one on his/her own. The user will want to store blog posts, allow users to register, and allow users to comment on posts.

MySQL has been the standard foundation layer for blogging platforms since the early days of the internet. Its durability, reliability, and ease of use make it a good choice for new programmers. And its ubiquity makes it the default database for existing blogging platforms including WordPress, Drupal, and Joomla.

MySQL is an appropriate choice for a blogging platform because:

  • The data is relational. For example, there is a "one-to-many" relationship between users and comments, posts and comments, the post date and blog posts, and more.
  • The data is highly structured and standardized, so there is no need for a flexible data model.
  • The data needs to be stored permanently.
  • The queries will not need to include any elaborate JOIN statements which might reduce performance.

Scenario 3: Payroll

In this scenario, the user is managing a sales force, and needs a database to store and manage their payroll, billing, and time card information. Sales associates will be using the database to record their sales data and hourly activity (time card). Every pay period, this information will be pulled from the database to generate paychecks for the employees.

This system needs to be reliable, secure, and provide guaranteed 24/7 uptime. Sales associates are located around the world, and are updating their time card information constantly. Data loss and downtime is unacceptable, as it directly impacts the employees' paychecks.

MySQL is the clear choice for this user:

  • MySQL is a secure, mature technology with robust performance. MySQL also offers several built-in options for creating high availability clusters, failover services, and automatic backups.
  • The data is relational. For example, there is a "many-to-many" connection between sales associates and customer records. Time cards have a "one-to-many" relationship between employee, hourly record, and the activity performed.
  • The data is highly structured and standardized, so there is no need for a flexible data model.
  • The data needs to be stored permanently.
  • The queries will not need to include any elaborate JOIN statements which might reduce performance.