MySQL Architectural Terminology

Aug 12, 2009 Author: MYSQL Expert

When you use MySQL, you’re actually using at least two programs, because MySQL operates using a client/server architecture.The first program is the MySQL server, mysqld.
The server runs on the machine where your databases are stored. It listens for client requests coming in over the network and accesses database contents according to those requests to provide clients with the information they ask for.The other programs are
client programs; they connect to the database server and issue queries to tell it what information they want.
Most MySQL distributions include the database server and several client programs. (If
you use RPM packages on Linux, there are separate server and client RPM packages, so you should install both.)
You use the clients according to the purposes you want to achieve. The one most commonly used is mysql, an interactive client that lets you issue
queries and see the results.Two administrative clients are mysqldump, a backup program
that dumps table contents into a file, and mysqladmin, which enables you to check on the
status of the server and performs other administrative tasks such as telling the server to
shut down. MySQL distributions include other clients as well. If you have application
requirements for which none of the standard clients is suited, MySQL also provides a
client-programming library so that you can write your own programs.
The library is usable directly from C programs. If you prefer a language other than C, interfaces are available for several other languages—Perl, PHP, Python, Java, and Ruby, to name a few.
The client programs I discuss in this book all are used from the command line. If you’d
like to try tools that use a graphical user interface (GUI) and provide point-and-click
capabilities, visit
MySQL’s client/server architecture has certain benefits:
The server provides concurrency control so that two users cannot modify the same
record at the same time. All client requests go through the server, so the server sorts
out who gets to do what, and when. If multiple clients want to access the same
table at the same time, they don’t all have to find and negotiate with each other.
They just send their requests to the server and let it take care of determining the
order in which the requests are performed.
n You don’t have to be logged in on the machine where your database is located.
MySQL understands how to work in a networked environment, so you can run a
client program from wherever you happen to be, and the client can connect to the
server over the network. Distance isn’t a factor; you can access the server from anywhere
in the world. If the server is located on a computer in Australia, you can take
your laptop computer on a trip to Iceland and still access your database. Does that
mean anyone can get at your data, just by connecting to the Internet? No. MySQL
includes a flexible security system, so you can allow access only to people who
should have it.And you can make sure that those people are able to do only what
they should. Perhaps Sally in the billing office should be able to read and update
(modify) records, but Phil at the service desk should be able only to look at them.
You can set each person’s privileges accordingly. If you do want to run a selfcontained
system, set the access privileges so that clients can connect only from the
host on which the server is running.
In addition to the usual mysqld server that is used in a client/server setting, MySQL
makes the server available as a library, libmysqld, that you can link into programs to produce
standalone MySQL-based applications.This is called the “embedded server library”
because it’s embedded into individual applications. Use of the embedded server contrasts
with the client/server approach in that no network is required.This makes it easier to
create and package applications that can be distributed on their own with fewer assumptions
about their external operational environment. On the other hand, it should be used
only in situations where the embedded application is the only one that needs access to
the databases managed by the server.

The Difference Between “MySQL” and “mysql”

To avoid confusion, I should point out that “MySQL” refers to the entire MySQL RDBMS and “mysql” is the name of a particular client program.They sound the same if you pronounce them, but they’re distinguished here by capitalization and typeface differences.
Speaking of pronunciation, MySQL is pronounced “my-ess-queue-ell.”We know this because the MySQL Reference Manual says so. On the other hand, depending on who you ask, SQL is pronounced “ess-queue-ell” or “sequel.”This example assumes the pronunciation “ess-queue-ell,” which is why it uses constructs such as “an SQL query” rather than “a SQL query.”

views 4291
  1. Add New Comment