8. scalability

Scalability Overview

  • Scalability is central to managing increasing web demands and complexities.

  • Focuses on the subset of the internet utilizing the HTTP protocol, known as the web.

Scaling the Web (Page 2)

  • The evolution of the modern web revolves around scalability.

  • Scalability addresses the ability to handle increased demands as complexity grows.

Web Applications (Page 3)

  • Web applications categorized as:

    • Traditional websites accessed via a browser.

    • Mobile applications using an HTTP backend.

    • M2M (machine-to-machine) applications where back-end systems communicate over web APIs.

Web Application Architecture (Page 4)

  • Utilizes a model-view-controller (MVC) architecture:

    • Model: Back-end data.

    • Controller: Application logic connecting model and view.

    • View: Graphical User Interface (GUI) for user interactions.

  • M2M applications do not include a GUI.

Data Transfer over HTTP (Page 5)

  • Common techniques for data transfer include:

    • HTML: Hypertext markup language generated by back-end servers.

    • SOAP: Simple Object Access Protocol, an XML-based communication protocol.

    • JSON: Lightweight text-based notation for data exchange.

    • REST: Architectural style combining request method & URI, often using JSON or SOAP for responses.

The Scale Cube (Page 6)

  • Web applications can scale in three primary ways indicated by the Scale Cube.

Examples of the Scale Cube (Page 7)

  • Using a banking application:

    • X-axis scaling: Duplication of the entire application across multiple servers for load balancing.

    • Z-axis scaling: Dedicated servers for different geographical customers with replicated applications.

    • Y-axis scaling: Decomposition of the application into microservices based on functionalities.

Microservices (Page 8)

  • Advantages of microservices:

    • Allows individual scaling of each microservice using X- and Z-axis scaling.

    • Enables updates to the codebase of each microservice without affecting others, maintaining API compatibility.

Web Application Deployment (Page 9)

  • Web applications may be hosted:

    • On-premises or via third-party data centers.

  • Transitioned from physical servers to virtual machine clusters, then to container swarms for increased efficiency.

  • Containers align well with microservices architecture.

Containers (Page 10)

  • Containers virtualize the OS instead of hardware:

    • More efficient and portable compared to traditional virtual machines (VMs).

  • Often deployed alongside VMs for optimal performance.

Containers vs. Virtual Machines (Page 11)

  • Containers:

    • Package applications and dependencies, run as isolated processes.

    • Use less space (typically tens of MBs) and boot faster.

  • Virtual Machines:

    • Simulate physical hardware with a hypervisor.

    • Require more resources (GBs) and take longer to boot.

Visual Representation (Page 12)

  • Diagram comparison between containers and virtual machines illustrating architecture.

Containers and Microservices (Page 13)

  • Microservices are often containerized for scalability.

  • Kubernetes used for orchestrating, managing, and monitoring containers dynamically based on demand.

Load Balancing (Page 14)

  • Distributes request loads among multiple servers to avoid overflow.

  • Involves algorithms and dedicated hardware for optimal distribution.

Anycast (Page 15)

  • A load balancing method sharing a single IP address among multiple hosts:

    • Unicast: One-to-one communication.

    • Multicast: One-to-many communication.

    • Broadcast: One-to-all communication.

Anycast Explained (Page 16)

  • Anycast routes a request to the nearest (fewest hops) host sharing the IP address, facilitating efficient request handling.

Appropriate Use of Anycast (Page 18)

  • Ideal for stateless connections:

    • Suitable for DNS, streaming services, and static content requests (e.g., images, stylesheets).

Content Delivery Networks (CDN) (Page 19)

  • CDNs cache static content in geographically distributed locations to improve load times for end-users.

  • Major CDN providers include Cloudflare, Google Cloud, and Microsoft Azure.

  • Use of load balancing and anycasting techniques in optimizations.

Advantages of a CDN (Page 20)

  • Latency Reduction: Serves requests from geographically closest data centers.

  • Reliability: Ensures failover capabilities and redundancy across data centers.

  • Security: Offers protection against DDoS attacks by distributing request loads.

Disadvantages of a CDN (Page 21)

  • Potential privacy concerns for end-users, facilitating tracking and analytics by corporate entities.