Service =
an activity that
is useful/helpful to
many users
A service is
provide by
making a request
to a well-known location
Example:
Emergency service to
requesturgent help
The emergency service is
requested through
telephone at
the well-known number:
911
How to provide a service
(using by human analogy)
How toprovide the 911 (emergency) service:
We staff
a call center with
service providers
that work
24/7
(= 24 hours a day and 7 days a week):
A call to
911 is
routed to
a service provider
in the 911 center:
Your call/request will
be serviced by
a service provider when
your request is
received:
Providing a service on the
Internet
How to
provide a
service on the
Internet:
Run a
server program on
a computer
(e.g.:
holland.mathcs.emory.edu)
The server program must
run24/7
(i.e.: always !!!)
A user that want
to use the
service run a
(special) client program that
can make a request to the
server program:
The server program
will process the
request and
send a
response back
to the client program:
The response will
contain the
result of the
request made by the
client program
Client/Server Programming paradigm
in database programming
Architecture to provide
database service:
Explanation:
On a specifical machine
(in our case:
holland.mathcs.emory.edu),
we run the
MySQL server
that:
provides the
database service for
users
(students)
Users (students !) execute
a client program
(cs377-sql)
that:
Sendrequest (= queries) to
the mySQL server running on
holland.mathcs.emory.edu
And receive (and display) the
reply (= query result)
from the mySQL server
Detailed interaction:
First,
the client program
establish a
network connection
to
the mySQL server
on holland.mathcs.emory.edu:
Then the
client program sends an
SQL command
to the mySQL server
for execution:
This is the request !!!!
In response, the
mySQL server sends
back the
result set (tuples)
to the client:
This is the reply !!!!
How to see the mySQL server on holland
How to see the
mySQL "server" that is
running on holland:
1. ssh -X holland
2. Run: ps -e | grep mysql // program is called mysqld
The first number is the "process ID (PID)" of the mySQL daemon
3. Run: ps -q PID -l