Sei sulla pagina 1di 5

Client/Server Architecture

In client/server architecture the service is divided into at least two pieces. One piece, running
on a local user machine, is called the client. The other, running on potentially another
machine, is called the server. Traditionally the server provides the computational power or a
database engine. The client concentrates on the presentation layer or GUI.
Data is sent over a network from the client to the server. The client and server may be
involved in a protocol where commands and Meta information are sent along with the data.
Since the client and server may be of different hardware architectures marshalling the data is
important. Some environments provide secure, encrypted channels and then send all data over
these channels while other environments encrypt the message and send the data over the non
encrypted channel. Some data may be digitally signed with a MD5 checksum.
The logic in the application may reside at either client or server but traditionally the
application logic resides at the client, making the client ``fat''.
The client server architecture allows for the data to be at one server location while the access
of the data to be distributed on many clients. In addition, a larger computer can be used at the
server location to meet system response requirements. Many different clients that follow the
conventions of the server can reuse this architecture.
Typical client/server services use messaging or remote procedure calls for underlying
communication paradigms.

Definition: A network architecture in which each computer or process on the network is


either a client or a server. Servers are powerful computers or processes dedicated to
managing disk drives (file servers), printers (print servers), or network traffic (network
servers). Clients are PCs or workstations on which users run applications. Clients rely on
servers for resources, such as files, devices, and even processing power.
Another type of network architecture is known as a peer-to-peer architecture because each
node has equivalent responsibilities. Both client/server and peer-to-peer architectures are
widely used, and each has unique advantages and disadvantages.

One-tier architecture: A one-tier application is simply a program that doesn't


need to access the network while running. Most simple desktop applications, like word
processors or compilers, fall into this category. One-tier architecture has a huge
advantage: simplicity. One-tier applications don't need to handle any network
protocols, so their code is simpler. Such code also benefits from being part of an
independent operation. It doesn't need to guarantee synchronization with faraway data.
Moreover, a one-tier application can have a major performance advantage. The user's
requests don't need to cross the network, wait their turn at the server, and then return.
This has the added effect of not weighing down your network with extra traffic, and
not weighing down your server with extra work.
We all know software packages like MS Access, MS Excel, QuickBooks, and
Peachtree just to name a few. They all have the same in common that they access files
directly. This means that the file you want to work with must be accessible from a
local or shared drive. This is the simplest of all the architectures, but also the least
secure. Since users have direct access to the files, they could accidentally move,
modify, or even worse, delete the file by accident or on purpose.
There is also usually an issue when multiple users access the same file at the same
time: In many cases only one can edit the file while others only have read-only access.
So 1-tier architecture is simple and cheap, but usually unsecured and data can easily
be lost if you are not careful.

Two-tier architecture: Actually has three parts: a client, a server, and a protocol. The
protocol bridges the gap between the client and server tiers. The two-tier design is very
effective for network programming as well as for GUI programs, in which you can allocate
functionality to the host. Traditionally, GUI code lives on the client host, and the so-called
business logic lives on the server host. This allows user feedback and validation to occur on
the client, where turnaround is quick; in the process, precious network and server resources
are preserved. Similarly, logic lives on the server, where it is secure, and can make use of
server-side resources. In a two-tier app will need to store data on a server.
When the client starts it establishes a connection to the server and communicates as needed
with the server while running the client. The client computer usually cant see the database
directly and can only access the data by starting the client. This means that the data on the
server is much more secure. Now users are unable to change or delete data unless they have
specific user rights to do so.
The client-server solution also allows multiple users to access the database at the same time
as long as they are accessing data in different parts of the database. One other huge benefit is
that the server is processing data that allows the client to work on the presentation and
business logic only. This mean that the client and the server is sharing the workload and by
scaling the server to be more powerful than the client, you are usually able to load many
clients to the server allowing more users to work on the system at the same time.

Three-tier architecture: Often, a two-tier app will need to store data on a server.
Usually, the information is stored on the filesystem; however, data integrity issues
arise when multiple clients simultaneously ask the server to perform tasks. Since file
systems generally have rudimentary concurrency controls .The most common solution
is to add a third program, or database.
Databases specialize in storing, retrieving, and indexing data. Just as two-tier
architecture separates GUI and business logic, three-tier architecture allows you to
separate business logic and data access. You can also provide highly optimized data

indices and retrieval methods, and provide for replication, backup, redundancy, and
load-balancing procedures specific to your data's needs. Separating code into client
and server code increases the scalability of your application; so does placing data on a
dedicated process, host, or series of hosts.
Sometimes an application may be tiered in at least three distinct pieces. One piece is the
presentation or graphical user interface (GUI). Another piece is the logic, functions,
procedures, and objects that materialize this particular application. Well another piece is the
data management most often materialized by a database.
The three tiered architecture allows for one central server location for all the business logic
and one central server location for all of the data leading to reuse, consistency, and uniformity
of applications in this environment.
The presentation layer supports the GUI. Sometimes this is called a GUI-lite application.
There may be many different kinds of GUI.
The middle section materializes the application. Though this is called the application logic it
is really much larger than just logic formulas and includes all function and procedures that
make the application an application for a particular domain. Many of the elements in this area
are tailored for the application needs. Sometimes this layer is called the business rules or
logic.
The last layer is the data. This is most often materialized by a database. This layer does not
have to be limited to a database. Alternatively, a large computational server could act as a
mathematical engine.
The three tiered layering is popular because it forces clean lines between the three layers. The
``thin'' client can easily be moved to other architectures. The application logic can be used by
other applications in the system. The database layer allows for plug and play of many
different database vendors.

As more users access the system a three-tier solution is more scalable than the other solutions
because you can add as many middle tiers (running on each own server) as needed to ensure
good performance (N-tier or multiple-tier).
Security is also the best in the three-tier architecture because the middle layer protects the
database tier. There is one major drawback to the N-tier architecture and that is that the
additional tiers increase the complexity and cost of the installation.
The differences:

Benefits

1-Tier
Very simple

2-Tier
Good security

Inexpensive

More scalable

Multi-Tier
Exceptional security
Fastest execution
Thin client

No server needed

Faster execution
Very scalable

Issues

Poor security

More costly

Very costly

Multi user issues

More complex

Very complex

Thick client
Users

Usually 1 (or a few)

2-100

50-2000 (+)

Potrebbero piacerti anche