%% date:: [[2023-04-25]], [[2023-05-09]] parent:: %% # [[Distributed computing]] Distributed computing is the practice of modularizing application processes into single [[Principle of Atomicity]] instances that work together to serve an application. ## Benefits of distributed computing - Simplicity - Redundancy - Management and control: scaling up and down as necessary - Reduced cost: each component can be scaled dynamically and independently - Performance: distributing load across multiple components means that each single component has to be able to handle less. ## Evolution of distributed computing ![[container_evolution.svg]] [^01] ### Hardware servers The traditional deployment involves physical servers, each of which hosted multiple apps. These apps shared physical resources such as CPU, memory, and storage. The main disadvantage of this approach was that it introduced a single point of failure: it both exacerbated the effect of an outage (if one server went down, all the apps on it went down) and increased the likelihood of the outage (due to contention of resources). Hardware servers are also more expensive to provision and maintain. ### [[Server Virtualization|Virtualized servers]] Virtualized servers built on the hardware server model by compartmentalizing apps. Instead of all the apps running directly on the hardware, they run on virtual servers. The virtual servers all share the physical resources of the hardware server, but this division allows some [[Separation of Concerns|separation of concern]] and redundancy. Each virtual server could also be assigned an amount of the resources it could use, so there was a lower likelihood of running out of resources for the system as a whole. [[Java]] applications were created in this era, and run on the same premise. Java applications allowed engineers to virtually separate [[Respect Levels of Abstraction|levels of abstraction]] with the introduction of the [[JVM]]. Virtualization improves scalability because it introduced images or templates for application components that could be deployed in other servers. The main disadvantage of this approach was that while it protected the system against contention of resources, it was still a rigid system that could not flex with demand. It also did not ultimately protect against outages at the level of the underlying physical server. Physical limits, or issues in the operating system, could still cause an outage in the entire application. ### [[Containerization|Containerized servers]] Containers are an extension to the concept of virtual servers, but take atomicity further by being on a lower level of abstraction. They typically hold functions that are more discrete and atomic, whereas virtual servers tended to hold a larger group of functions. Containers are decoupled from the underlying infrastructure and thus are portable across different operating systems. ## Evolutions of distributed computing ### [[Kubernetes]] Both virtual servers and containerized servers were created in an attempt to further modularize application components. Clusters, however, add to this by going in the opposite direction. Instead of going towards an even smaller element than containers, clusters instead add a management layer to the system. A cluster groups machines (called pods) that host one or more containers and imposes controls over the entire stack. These controllers are called [[Container Orchestration Engines]]. ### [[Blockchain|Blockchains]] The Blockchain is a form of distributed computing in that the creation of a coin, the processing required to create a transaction block, and the storage can be done by different machines. The information on the ledger itself is also distributed, as it is independently verified and stored. ### [[Serverless computing]] and [[Event-driven architecture|Event-based architecture]] ### [[Microservices]] ### [[Federation]] ## Problems in distributed computing - [[Consensus]] - Scalability - Management -