Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Client-Server Model

Similar presentations


Presentation on theme: "The Client-Server Model"— Presentation transcript:

1 The Client-Server Model
Chapter 42 The Client-Server Model

2 Learning objectives In this chapter you will learn:
that the client-server model is one where a high-specification server provides resources to any number of lower-specification clients how an application programming interface provides a common way for programs to work together across networks what CRUD and REST are and how they are used what JSON and XML are and how they are used what thick and thin client computing is and how they compare.

3 Overview The client-server model works on the basic principle of sender and receiver. To initiate any communication and sharing of resources, the client must make a request to the server. In turn the server responds to that request and then provides the service that is being requested. It is a common principle used on networks and on the Internet.

4 Application processing interface (API)
An API defines the way in which programs can work together. They are usually made up of standardised subroutines that can be customised to provide an interface between one program and another. When using web services, an API can also define the protocols that will be used. One of these is the websocket protocol, which creates a connection between a client and a server.

5 CRUD Many users access databases through a network or over the Internet. In these situations, there are conventions and styles that are used to ensure that data is stored, managed and represented correctly in the database. The four main processes required with databases can be defined by the acronym CRUD: Create Retrieve Update Delete All databases will conform to the CRUD principle regardless of how they are built.

6 CRUD and SQL The CRUD principle applies to relational databases and there is a direct link between CRUD and SQL as follows: CRUD SQL Create INSERT Retrieve SELECT Update UPDATE Delete DELETE

7 CRUD and REST REST stands for Representational State Transfer.
It is a design methodology for networked database applications. It uses the hypertext transfer protocol (HTTP) to carry out each of the four CRUD operations on a networked database. CRUD HTTP Create POST Retrieve GET Update PUT Delete DELETE

8 REST implementation on a database
The client makes a request to the server from the browser of the local machine. The service requested is the database identified by its Uniform Resource Locator (URL), which uniquely identifies the resource on the server and contains the database query. The API is run from the server and accessed by the browser to coordinate processes between client and server applications. HTML files are used to ensure data is displayed in the correct format on the client side. Requests and data are transferred using HTTP. JSON (JavaScript Online Notation) or XML (Extensible Markup Language) are used to return the results of the query.

9 JSON JSON is a method for formatting data objects that are being transferred across servers and web applications. For example: {"customers":[     {"firstName":"Alan", "lastName":"Brown"},      {"firstName":"Asif", "lastName":"Javid"},     {"firstName":"Mary", "lastName":"Smith"} ]}

10 XML XML is an alternative method for formatting data objects that are being transferred across servers and web applications. Example: <customers>     <customer>         <firstName>Alan</firstName> <lastName>Brown</lastName>     </customer>     <customer>         <firstName>Asif</firstName> <lastName>Javid</lastName>     </customer>    <customer>         <firstName>Mary</firstName> <lastName>Smith</lastName>     </customer> </customers>

11 JSON vs XML JSON XML Human readable
Very easy to read as it is based on defining objects and values. Slightly less easy to read as data is contained within markup tags. Compact code Less code is created than XML. Requires more code then JSON. Speed of parsing Quicker than XML as data is clearly defined as object and value. Slower than JSON as the data has to be extracted from the tags. Ease of creation Easier to create as the syntax of the coding is easier. Similar to programming so therefore more knowledge is required. Flexibility and Extendibility Works with a limited range of data types, which may not be sufficient for all applications. Provides complete freedom over what data types are created and therefore allows greater flexibility.

12 Thin vs thick computing
A thin client is a computer that depends heavily on a more powerful server to fulfil most of its requirements and processing. A thick client is a fully specified computer like the ones most people have at home. They do not need servers to carry out their processing most of the time. The decision on whether to configure a network using a thin or thick client model depends largely on what tasks users are completing and what resources they need.

13 Thin client advantages/ disadvantages
Easy and cheaper to set up new clients as fewer resources are needed. Clients are dependent on the server so if it goes down, all clients are affected. The server can be configured to distribute all the hardware and software resources needed. Can slow down with heavy use. Hardware and software changes only need to be implemented on the server. May require greater bandwidth to cope with client request. Easier for the network manager to control clients. High-specification servers are expensive. Greater security as clients have fewer access rights.

14 Thick client advantages/disadvantages
Reduced pressure on the server, leading to more uptime. Reduced security if clients can download software or access the internet remotely. Clients can store programs and data locally, giving them more control. More difficult to manage and update as new hardware and software need installing on each client machine. Can be difficult to ensure data integrity where many clients are working on local data. Data is more likely to be lost or deleted on the client side. Fewer servers and lower bandwidth can be used. Suitable for tablets and mobile phones that require more of the processing and storage to be done on the server side.


Download ppt "The Client-Server Model"

Similar presentations


Ads by Google