|
| 1 | +--- |
| 2 | +author: [Felicitas Pojtinger] |
| 3 | +date: "2022-10-07" |
| 4 | +subject: "Uni Distributed Systems Notes" |
| 5 | +keywords: [distributed-systems, hdm-stuttgart] |
| 6 | +subtitle: "Notes for the distributed systems course at HdM Stuttgart" |
| 7 | +lang: "en" |
| 8 | +--- |
| 9 | + |
| 10 | +# Uni Distributed Systems Notes |
| 11 | + |
| 12 | +## Introduction |
| 13 | + |
| 14 | +### Contributing |
| 15 | + |
| 16 | +These study materials are heavily based on [professor Kriha's "Verteilte Systeme" lecture at HdM Stuttgart](https://www.hdm-stuttgart.de/vorlesung_detail?vorlid=5212233) and prior work of fellow students. |
| 17 | + |
| 18 | +**Found an error or have a suggestion?** Please open an issue on GitHub ([github.com/pojntfx/uni-distributedsystems-notes](https://github.com/pojntfx/uni-distributedsystems-notes)): |
| 19 | + |
| 20 | +{ width=150px } |
| 21 | + |
| 22 | +If you like the study materials, a GitHub star is always appreciated :) |
| 23 | + |
| 24 | +### License |
| 25 | + |
| 26 | +{ width=128px } |
| 27 | + |
| 28 | +Uni Distributed Systems Notes (c) 2022 Felicitas Pojtinger and contributors |
| 29 | + |
| 30 | +SPDX-License-Identifier: AGPL-3.0 |
| 31 | +\newpage |
| 32 | + |
| 33 | +## Overview |
| 34 | + |
| 35 | +### Goals |
| 36 | + |
| 37 | +- Basic concepts |
| 38 | +- Different programming models |
| 39 | +- Theoretical foundation of computability |
| 40 | +- Design of distributed systems |
| 41 | +- Hardware and failure constraints |
| 42 | +- How to build middleware in distributed systems |
| 43 | + |
| 44 | +### Definition of Distributed Systems |
| 45 | + |
| 46 | +> Independent agents repeatedly interacting in a way that a coherent behavior ("system") **emerges**. Events happen concurrently and parallel. |
| 47 | +
|
| 48 | +Why emerges? You haven't watched the movie if you looked at every frame! |
| 49 | + |
| 50 | +### Emergence |
| 51 | + |
| 52 | +- **Strong**: We cannot predict what will emerge (game of life) |
| 53 | +- **Weak**: Things are combined by simple principles but the result suprises (flock of birds) |
| 54 | +- **Evolutionary**: Complex but robust (egg to human) |
| 55 | +- **Constructed**: Complex but often not robust (distributed systems; emergent Failure Modes: Cascading failures in constructed emergence) |
| 56 | + |
| 57 | +### Emergent Failure Modes |
| 58 | + |
| 59 | +See Laura Nolan (black swans) on YouTube! |
| 60 | + |
| 61 | +### Why are Distributed Systems difficult to understand? |
| 62 | + |
| 63 | +> See the slides for details on these first principles. |
| 64 | +
|
| 65 | +- Emergence |
| 66 | +- We have a single machine view |
| 67 | +- Errors are the fabric |
| 68 | +- There is no free lunch |
| 69 | +- Is total end-to-end system engineering |
| 70 | + |
| 71 | +### Why Distribute? |
| 72 | + |
| 73 | +- **Robustness/Resilience**: Avoid single points of failures with replication |
| 74 | +- **Performance**: Split processing into independent parts |
| 75 | +- **Scalability/Throughput**: Allow millions of requests/sec |
| 76 | +- **Security**: Create different security domains |
| 77 | +- **Price per Request**: Use cheaper horizontal scaling or free resources |
| 78 | + |
| 79 | +### Scale and Distributions: Power Laws |
| 80 | + |
| 81 | +There is a tendency that the big ones (e.g. Google) will become even bigger! |
| 82 | + |
| 83 | +### Characteristics of Distributed Systems |
| 84 | + |
| 85 | +- Influence of distribution topology and remoteness |
| 86 | +- Emergent behaviors, concurrent events |
| 87 | +- Few analytics solutions, few model-based approaches |
| 88 | +- Heterogeneous components |
| 89 | +- No global time |
| 90 | +- A strong need for security |
| 91 | +- Concurrency, parallelism and replication |
| 92 | +- Failure models define everything! |
| 93 | + |
| 94 | +### The Eight Fallacies of Distributes Computing |
| 95 | + |
| 96 | +1. The network is reliable |
| 97 | +2. Latency is zero |
| 98 | +3. Bandwidth is infinite |
| 99 | +4. The network is secure |
| 100 | +5. Topology doesn't change |
| 101 | +6. There is one administrator |
| 102 | +7. Transport cost is zero |
| 103 | +8. The network is homogeneous |
| 104 | + |
| 105 | +### Programming Languages and Distributes Systems |
| 106 | + |
| 107 | +**Message Camp** |
| 108 | + |
| 109 | +- Simple CRUD interface. Message content is interface. |
| 110 | +- Coarse grained messages (documents) |
| 111 | +- Programmers deal with remoteness directly |
| 112 | +- Events based or REST architectures |
| 113 | + |
| 114 | +**Transparency Camp** |
| 115 | + |
| 116 | +- Hide remoteness from programmer |
| 117 | +- Create type-safe interfaces and calls |
| 118 | +- Hide security, storage and transactions behind frameworks (.NET, EJB etc.) |
| 119 | +- Think distributed systems as a programming model |
| 120 | + |
| 121 | +### History of Distributed Systems |
| 122 | + |
| 123 | +- 50s-80s: Basic papers on time, consensus, computability etc. |
| 124 | +- 90s: Connecting intranet applications (CORBA, COM), programming models dominate |
| 125 | +- 2000s: P2P, large social sites emerge, message passing, batch processing, eventual consistency & RAM replaces disk |
| 126 | +- 2010s: Warehouse scale, fan out architecutres, realtime stream processing, flash memory, network performance, microservices & serverless, applications that run on the network adapter etc. |
| 127 | + |
| 128 | +### Metcalfe's Law (Network Effects) |
| 129 | + |
| 130 | +- The usefulness of a network grows by the square of the number of users (one single fax machine is useless - if there are two fax machines it becomes important!) |
| 131 | +- There can be only one! |
| 132 | + |
| 133 | +### Security in Distributed Systems |
| 134 | + |
| 135 | +> "The company end where I don't have control over the cryptography" |
| 136 | +
|
| 137 | +### Theoretial Foundations of Distributed Systems |
| 138 | + |
| 139 | +- No global time (logical clocks, vector clocks) |
| 140 | +- FLP theorem of asynchronous systems |
| 141 | +- The problem of failure detection and timeout |
| 142 | +- Concurrency and deadlocks |
| 143 | +- CAP theorem: Consistency, availability and partitioning: Choose only two! |
| 144 | +- End-to-end argument: Where in the application do we put the logic? |
| 145 | +- Consensus, leader selection etc. |
| 146 | + |
| 147 | +### Distributed System Design |
| 148 | + |
| 149 | +- Common Problems (performance, fail-over, maintenance, policies, security integration) |
| 150 | +- Information Architecture (define and qualify the information fragments and flows) |
| 151 | +- Distribution Architecture (create a map of all participating systems and their quality of service) |
| 152 | + |
| 153 | +### Compnents of Distributed Operating Systems |
| 154 | + |
| 155 | +From top to bottom: |
| 156 | + |
| 157 | +**First layer** |
| 158 | + |
| 159 | +- Data Analysis and Request Processing Applications |
| 160 | + |
| 161 | +**Second layer** |
| 162 | + |
| 163 | +- APIs |
| 164 | + |
| 165 | +**Third layer** |
| 166 | + |
| 167 | +- Scheduler |
| 168 | +- Queue |
| 169 | +- Log service |
| 170 | +- Notification services |
| 171 | +- Locking services |
| 172 | + |
| 173 | +- Fragment handler |
| 174 | +- Memory cache |
| 175 | +- Key/value store |
| 176 | +- Distributed file system |
| 177 | + |
| 178 | +- Load balancer |
| 179 | +- IP service realocator |
| 180 | +- Membership service |
| 181 | +- Failure detector |
| 182 | + |
| 183 | +**Fourth layer** |
| 184 | + |
| 185 | +- Map reduce |
| 186 | +- Consistent hashing |
| 187 | +- Consensus algorithms |
| 188 | +- Optimistic replies |
| 189 | + |
| 190 | +**Fifth layer** |
| 191 | + |
| 192 | +- Failure models |
| 193 | + |
| 194 | +### The Transparency Dogma |
| 195 | + |
| 196 | +Middleware is supposed to hide remoteness and concurency by hiding distribution behind local programming language constructs. |
| 197 | + |
| 198 | +### Distribution Transparencies |
| 199 | + |
| 200 | +- **Access**: Mask differences in languages and data representtation |
| 201 | +- **Failure**: Mask failures to enable fault tolerance |
| 202 | +- **Scalability**: Intelligent load-balancing of requests |
| 203 | +- **Redundancy**: Transparent replication of data |
| 204 | +- **Location**: Use logical, not physical names to access services |
| 205 | +- **Migration**: Hide the true liocation of a service |
| 206 | +- **Persistence** |
| 207 | +- **Sharding** |
| 208 | +- **Transactions** |
| 209 | +- **Security** |
| 210 | +- **Monitoring** |
| 211 | + |
| 212 | +### Classification |
| 213 | + |
| 214 | +- Sockets |
| 215 | +- RPC |
| 216 | +- Object Request Brokers (CORBA, RMI) |
| 217 | +- Message Oriented Middleware |
| 218 | +- Web-Services |
| 219 | +- Frameworks |
| 220 | +- P2P |
| 221 | +- Agent based (Jini) |
| 222 | +- Tuple-Spaces |
| 223 | +- Warehouse-Computing Architectures |
| 224 | + |
| 225 | +### RPC type Middleware |
| 226 | + |
| 227 | +- E.g. Sun-RPC, Apache Thrift, gRPC |
| 228 | +- Main idea: Allow function calls across languages with concurrent and parallel processing of requests |
| 229 | +- Has generators to create specific glue code |
| 230 | +- Directories, file systems etc. can be built on it |
| 231 | + |
| 232 | +### Distributed Objects |
| 233 | + |
| 234 | +**CORBA** |
| 235 | + |
| 236 | +- Object request broker |
| 237 | +- Multi-language support |
| 238 | +- Has an IDL |
| 239 | +- Wire protocol: IIOP, GIOP |
| 240 | + |
| 241 | +**RMI** |
| 242 | + |
| 243 | +- Java only |
| 244 | +- Lightweight method call semantics |
| 245 | +- Java implementations |
| 246 | +- Wire protocol: IIOP, GIOP |
| 247 | + |
| 248 | +### Distributed Computing Frameworks |
| 249 | + |
| 250 | +- Objects are to granular |
| 251 | +- Seperation of concerns and contet |
| 252 | +- EJB, COM+ etc. |
0 commit comments