Server Side & Client Side Processing (OCR A Level Computer Science)
Revision Note
Written by: Becci Peters
Reviewed by: James Woodhouse
Server Side Processing
Server side processing involves running code and carrying out operations on the server instead of on the client's device or browser
Web development often involves utilising server side programming languages like PHP, Python, Ruby, or Java to handle incoming requests, process data, interact with databases, and generate dynamic content
Server side processing with PHP
PHP (Hypertext Preprocessor) is a server side scripting language specifically designed for web development. PHP focuses mainly on completing tasks on the server. Here are a few examples of server side processing with PHP:
Data retrieval & manipulation
When working with PHP, you can retrieve and manipulate data. PHP is capable of interacting with databases, processing data, and generating dynamic content
Server operations
PHP can perform server side operations that are not accessible to the client
PHP is capable of performing server operations such as retrieving and displaying information from a database
Form processing
PHP can handle form submissions, process the submitted data, and perform necessary validations or database operations on the server side
Benefits & drawbacks of server side processing
|
|
---|---|
Improved security measures can be implemented through server side processing, ensuring the secure management of sensitive data, implementing access control measures, and guarding against common web vulnerabilities. | When multiple requests are made to a server, complex processing tasks can consume server resources and cause a decrease in overall server performance. This is known as increased server load. |
Server side processing uses the resources of the server to perform advanced calculations, manipulate data, and interact with databases. | Using server side processing may cause latency because it involves communication with the server, which could lead to slower response times in comparison to client side processing. |
Server side processing ensures consistent behaviour across different devices and browsers, as the processing logic is centralised on the server. | Server side processing relies on the availability and reliability of the server infrastructure. Downtime or performance issues can affect the functioning of the web application. |
Server side processing can be easily scaled by adding more servers or optimising the server infrastructure to handle increasing traffic and user demands. | Server side processing typically requires a roundtrip to the server for each user action, limiting real-time interactivity and responsiveness. |
| Server side processing may require more complex development and setup compared to client side processing, potentially increasing development time and effort. |
Client Side Processing
Client side processing involves carrying out code or processing tasks on the user's device, usually within the web browser, instead of on the server
This feature enables users to have interactive and dynamic experiences without constantly requesting data from the server
Client side processing is primarily done using JavaScript, whereas server side processing is commonly carried out using PHP
Client side processing with JavaScript
JavaScript is a powerful scripting language that operates mainly on the client side. It provides developers with the ability to modify web content, manage user interactions, and update the webpage dynamically without requiring server requests. Here are a few examples of client side processing with JavaScript:
Form validation
With JavaScript, it's possible to validate user input in real time, which means that users can receive instant feedback without the need for a server roundtrip
E.g. when completing an online form, check that all required fields are filled out correctly and make sure the input meets the necessary format and length before sending the form to the server. If any areas are blank and need input (e.g. email address) the user will be notified before the form can be submitted
DOM manipulation
With JavaScript, developers can modify the Document Object Model (DOM) to make dynamic changes to a web page's content and structure
This involves tasks such as adding or removing elements, updating text, modifying styles, and managing events to develop interactive user interfaces e.g. turning on dark mode
AJAX requests
Communication with the server happens asynchronously and retrieves data in the background
This allows for dynamically updating content without requiring a full-page reload
Benefits & drawbacks of client side processing
|
|
---|---|
Enhanced user experience is made possible through client side processing, creating interactive and dynamic user experiences. This eliminates the need for frequent server requests and page reloads. | There is a potential security risk with client side code as it can be seen by users, which may lead to sensitive information and operations being exposed or tampered with. |
By offloading processing tasks to the client side, the server load is reduced, resulting in improved scalability and resource utilisation. | The compatibility of devices and browsers may vary, which can lead to issues with the client side code that depends on their capabilities and support. |
User input can be instantly validated and feedback can be provided in real-time. This not only improves the user experience but also reduces the need for server roundtrips. | Client side processing can hurt page load time, particularly when dealing with large or complex operations that require substantial processing power. |
With the use of JavaScript, web pages can have their content updated dynamically, resulting in a more seamless and engaging browsing experience. | Client side processing is heavily dependent on JavaScript. If the user's browser does not support or has disabled JavaScript, the functionality may become inaccessible or break. |
Web applications can operate without an active internet connection by using client side technologies to provide offline functionality. | The accessibility of client side code to users can put intellectual property at risk, as it allows for easier viewing, copying, and modification of the code. |
Choosing Server Side or Client Side Processing
The choice between client side and server side processing depends on the specific requirements of a task:
Client side processing is better for tasks that require immediate user feedback, real-time interactions, dynamic user interfaces, or data manipulation within the browser. JavaScript is the primary language for such scenarios
Server side processing is better for tasks that involve accessing databases, handling sensitive data, complex business logic, or server specific operations. PHP and other server side languages are commonly used in these cases
Worked Example
Big Brains has produced a website that allows students to access revision videos. They want to limit access to those students with a school email account (i.e. one ending .sch.uk). When students sign up JavaScript is used to check that the email address they have entered is from a school account. The address is rechecked when it reaches the server before login details are sent to the address.
Explain why checking the email address with JavaScript and again when it reaches the server is important.
3 marks
How to answer this question:
You need to know the following from above about client side processing:
Reduced Server Load: Offloading processing tasks to the client side reduces the burden on servers, improving scalability and resource utilisation
Dependency on JavaScript: Client side processing heavily relies on JavaScript, and if JavaScript is disabled or not supported by the user's browser, the functionality may break or become inaccessible
You need to apply this knowledge to the scenario in the question
Answer:
Example answer that gets full marks:
The JavaScript check is carried out client side meaning the address can be checked and stopped before reaching the server reducing the unnecessary load on the server.
Acceptable answers you could have given instead:
JavaScript can be amended and circumvented therefore address must be checked at the server to ensure this has not happened.
Last updated:
You've read 0 of your 10 free revision notes
Unlock more, it's free!
Did this page help you?