Lessons
  Menu

Web Development Architecture Decoded

Web development architecture is a framework that outlines the structure and organization of web applications. It encompasses various components, each playing a pivotal role in delivering a seamless user experience. Let’s delve into these components and understand their functions, followed by a practical example illustrating their interaction.

The Client (Browser)

A client in web development refers to the browser through which users interact with the web. Examples include Google Chrome, Mozilla Firefox, and Safari. The browser sends requests to the web server and renders the web pages it receives.

The Web Server

The web server is a software (and its underlying hardware) that handles incoming network requests from the web browser and serves web pages. Popular examples include Apache and Nginx. When a browser requests a page, the web server is responsible for fetching and sending the right content.

The Application Server

The application server, or app server, is where the business logic of a web application resides. It processes the logic for various functions of the web application, interfacing between the web server and the database. Examples include Apache Tomcat, Microsoft IIS, and Node.js for server-side JavaScript applications.

  • Nature (Hardware or Software): The application server is primarily software that runs on a physical or virtual server (hardware). It acts as a middleman between the web server and the database.
  • Business Logic Explained: ‘Business logic’ refers to the custom rules or algorithms that handle the exchange, manipulation, and processing of data from a user interface. It’s the part of the application that encodes the real-world business rules that determine how data is created, displayed, stored, and changed.
  • Why Not the Web Server? Web servers are optimized to serve static content and handle HTTP requests. Handling complex business logic, such as user authentication or data manipulation, requires more resources and specialized processing, which is the role of the application server. This division of responsibilities enhances efficiency, security, and scalability.

Web Development Frameworks

A web development framework is a software framework designed to support the development of web applications, including web services, web resources, and web APIs. Frameworks provide a standard way to build and deploy web applications on the World Wide Web. Examples include React.js, Angular, and Django for Python. These frameworks simplify the development process by providing reusable components, libraries, and tools.

  • Location of Execution: Web development frameworks run on both the client side (like Angular or React.js for building dynamic user interfaces) and the server side (like Django for Python or Spring for Java, handling backend logic).
  • Reusable Components, Libraries, and Tools:
    • Reusable Components: These are pre-written code blocks that can be used across different parts of an application. For example, a login authentication component.
    • Libraries: Collections of pre-written code that developers can call upon for common tasks, such as connecting to a database or parsing XML files.
    • Tools: These include integrated development environments (IDEs), debuggers, and other utilities that assist in the development process.
  • Java Frameworks: Notable frameworks for Java include Spring, Hibernate for ORM (Object-Relational Mapping), and Struts.

The Database

A database is a structured set of data held in a computer, especially one that is accessible in various ways. It stores and retrieves data as requested by the app server. Common databases used in web development include MySQL, PostgreSQL, and MongoDB for NoSQL data.

Flow Example

Let’s consider an online bookstore developed using the Spring Framework (Java-based).

  • User Request: A user accesses the store using a browser (client), requesting to view a book.
  • Web Server Processing: This request hits the web server (e.g., Nginx), which forwards it to the application server for dynamic content processing.
  • Application Server and Framework Role: The Spring Framework, running on the application server, kicks in. It processes the request, which involves executing business logic like fetching book details from the database.
  • Database Interaction: The Spring Framework communicates with the database (e.g., MySQL) to retrieve the requested book information.
  • Response Preparation and Delivery: The application server processes the data, integrates it into a web page using the Spring Framework, and sends it back to the web server, which then delivers it to the user’s browser.
  • Framework’s Role: In this flow, the Spring Framework simplifies the development of the business logic, database interaction, and the integration of the response with the web server.

AEM Architecture Overview

  1. Web Server:
    • In AEM, a web server refers to the server software responsible for accepting HTTP requests from the client (browser) and serving them web content, which can be static (like HTML files) or dynamic (like applications that interact with the user). Examples of web servers used with AEM include Apache HTTP Server and Microsoft IIS.
  2. Dispatcher as Part of the Web Server:
    • The Dispatcher is not a web server itself but a tool that integrates with the web server. It serves two primary purposes in AEM:
      • Caching: It stores (caches) copies of the content of a website, reducing the load on the AEM instance by serving cached content to users.
      • Load Balancing: It helps distribute user requests across different AEM instances, ensuring efficient handling of requests and improved performance.
  3. Application Server in AEM:
    • AEM itself acts as an application server. The application server hosts the business logic of the application and interacts with the database. It processes the requests sent by the web server, executes the business logic, and retrieves or stores data from the database.
  4. Framework in AEM – Apache Sling:
    • Apache Sling, a vital part of AEM, is a web application framework. It uses a Java Content Repository (JCR) to store and retrieve content. Sling is designed to make it easy to create content-oriented applications using a RESTful paradigm. It maps the incoming URLs to the appropriate resources in the JCR or executes the relevant Java classes to generate the response.
  5. Database in AEM – Java Content Repository (JCR):
    • The JCR in AEM is a type of NoSQL database and is used as the data storage layer. It stores all the content, including pages, components, and digital assets, in a hierarchical structure, enabling efficient content management and retrieval.

In essence, the web server and Dispatcher work in tandem where the web server handles HTTP requests and the Dispatcher enhances it by caching and load balancing. AEM, as an application server, processes these requests using the Apache Sling framework to interact with the JCR database, effectively managing and serving the content.