What Is MySQ1
What Is MySQ1
MySQL is a fast, easy to use relational database. It is currently the most popular
open-source database. It is very commonly used in conjunction with PHP scripts to
create powerful and dynamic server-side applications.
MySQL is used for many small and big businesses. It is developed, marketed and
supported by MySQL AB, a Swedish company. It is written in C and C++.
Reasons of popularity
MySQL is becoming so popular because of these following reasons:
o MySQL is an open-source database so you don't have to pay a single penny
to use it.
o MySQL is a very powerful program so it can handle a large set of functionality
of the most expensive and powerful database packages.
o MySQL is customizable because it is an open source database and the open-
source GPL license facilitates programmers to modify the SQL software
according to their own specific environment.
o MySQL is quicker than other databases so it can work well even with the large
data set.
o MySQL supports many operating systems with many languages like PHP,
PERL, C, C++, JAVA, etc.
o MySQL uses a standard form of the well-known SQL data language.
o MySQL is very friendly with PHP, the most popular language for web
development.
o MySQL supports large databases, up to 50 million rows or more in a table.
The default file size limit for a table is 4GB, but you can increase this (if your
operating system can handle it) to a theoretical limit of 8 million terabytes
(TB).
MySQL Features
o Relational Database Management System (RDBMS): MySQL is a
relational database management system.
o Easy to use: MySQL is easy to use. You have to get only the basic
knowledge of SQL. You can build and interact with MySQL with only a few
simple SQL statements.
o It is secure: MySQL consist of a solid data security layer that protects
sensitive data from intruders. Passwords are encrypted in MySQL.
o Client/ Server Architecture: MySQL follows a client /server architecture.
There is a database server (MySQL) and arbitrarily many clients (application
programs), which communicate with the server; that is, they query data, save
changes, etc.
o Free to download: MySQL is free to use and you can download it from
MySQL official website.
o It is scalable: MySQL can handle almost any amount of data, up to as much
as 50 million rows or more. The default file size limit is about 4 GB. However,
you can increase this number to a theoretical limit of 8 TB of data.
Compatibale on many operating systems: MySQL is compatible to run on
many operating systems, like Novell NetWare, Windows* Linux*, many
varieties of UNIX* (such as Sun* Solaris*, AIX, and DEC* UNIX), OS/2,
FreeBSD*, and others. MySQL also provides a facility that the clients can run
on the same computer as the server or on another computer (communication
via a local network or the Internet).
o Allows roll-back: MySQL allows transactions to be rolled back, commit and
crash recovery.
o High Performance: MySQL is faster, more reliable and cheaper because of
its unique storage engine architecture.
o High Flexibility: MySQL supports a large number of embedded applications
which makes MySQL very flexible.
o High Productivity: MySQL uses Triggers, Stored procedures and views
which allows the developer to give a higher productivity.
Disadvantages / Drawback of MySQL:
Following are the few disadvantages of MySQL:
o MySQL version less than 5.0 doesn't support ROLE, COMMIT and stored
procedure.
o MySQL does not support a very large database size as efficiently.
o MySQL doesn't handle transactions very efficiently and it is prone to data
corruption.
o MySQL is accused that it doesn't have a good developing and debugging tool compared to
paid databases.
o MySQL doesn't support SQL check constraints.
MySQL provides various storage engines for its tables as below:
MyISAM
InnoDB
MERGE
MEMORY (HEAP)
ARCHIVE
CSV
FEDERATED
Each storage engine has its own advantages and disadvantages. It is crucial to understand each
storage engine features and choose the most appropriate one for your tables to maximize the
performance of the database. In the following sections, we will discuss each storage engine and
its features so that you can decide which one to use.
MyISAM
MyISAM extends the former ISAM storage engine. The MyISAM tables are optimized for
compression and speed. MyISAM tables are also portable between platforms and operating
systems.
The size of MyISAM table can be up to 256TB, which is huge. In addition, MyISAM tables can
be compressed into read-only tables to save spaces. At startup, MySQL checks MyISAM tables
for corruption and even repairs them in a case of errors. The MyISAM tables are not transaction-
safe.
Before MySQL version 5.5, MyISAM is the default storage engine when you create a table
without specifying the storage engine explicitly. From version 5.5, MySQL uses InnoDB as the
default storage engine.
InnoDB
The InnoDB tables fully support ACID-compliant and transactions. They are also optimal for
performance. InnoDB table supports foreign keys, commit, rollback, roll-forward operations.
The size of an InnoDB table can be up to 64TB.
Like MyISAM, the InnoDB tables are portable between different platforms and operating
systems. MySQL also checks and repairs InnoDB tables, if necessary, at startup.
MERGE
A MERGE table is a virtual table that combines multiple MyISAM tables that have a similar
structure into one table. The MERGE storage engine is also known as the MRG_MyISAM
engine. The MERGE table does not have its own indexes; it uses indexes of the component
tables instead.
Using MERGE table, you can speed up performance when joining multiple tables. MySQL only
allows you to perform SELECT, DELETE, UPDATE and INSERT operations on the MERGE
tables. If you use DROP TABLE statement on a MERGE table, only MERGE specification is
removed. The underlying tables will not be affected.
Memory
The memory tables are stored in memory and use hash indexes so that they are faster than
MyISAM tables. The lifetime of the data of the memory tables depends on the uptime of the
database server. The memory storage engine is formerly known as HEAP.
Archive
The archive storage engine allows you to store a large number of records, which for archiving
purpose, into a compressed format to save disk space. The archive storage engine compresses a
record when it is inserted and decompress it using the zlib library as it is read.
The archive tables only allow INSERT and SELECT statements. The ARCHIVE tables do not
support indexes, so it is required a full table scanning for reading rows.
CSV
The CSV storage engine stores data in comma-separated values (CSV) file format. A CSV table
brings a convenient way to migrate data into non-SQL applications such as spreadsheet software.
CSV table does not support NULL data type. In addition, the read operation requires a full table
scan.
FEDERATED
The FEDERATED storage engine allows you to manage data from a remote MySQL server
without using the cluster or replication technology. The local federated table stores no data.
When you query data from a local federated table, the data is pulled automatically from the
remote federated tables.