2023-09-24 14:02:33 +01:00
|
|
|
🌫 18 Setembro 2023 - #ASCN
|
2023-09-24 12:52:33 +01:00
|
|
|
|
2023-09-25 23:59:20 +01:00
|
|
|
- ## Why distributed systems?
|
2023-09-24 12:52:33 +01:00
|
|
|
- Modularity, decoupling different concerns.
|
|
|
|
- Performance.
|
|
|
|
- Dependability
|
2023-09-25 23:59:20 +01:00
|
|
|
- ## How to distribute?
|
|
|
|
- ### 1. Monolythic system
|
2023-09-24 13:07:33 +01:00
|
|
|
- Architecture: [[Monolithic system.excalidraw]]
|
|
|
|
- Multiple services for multiple targets in the same server
|
2023-09-25 23:59:20 +01:00
|
|
|
- ## 2. Distributed systems
|
|
|
|
id:: 65120d55-6bed-47db-bd53-cc4f627c33dc
|
2023-09-24 13:07:33 +01:00
|
|
|
- Main distribution concerns:
|
2023-09-25 23:59:20 +01:00
|
|
|
1. Replication
|
|
|
|
2. Partitioning
|
|
|
|
3. Service-orientation
|
2023-09-24 13:07:33 +01:00
|
|
|
- All of these address scaling out a service/application.
|
|
|
|
- Not mutually exclusive, can be combined.
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 2.1 Replication
|
2023-09-24 13:12:33 +01:00
|
|
|
- Architecture: [[Replication.excalidraw]]
|
|
|
|
- Multiple copies of the same data and functionality
|
|
|
|
- Addresses resilience and scale-out
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 2.2 Partitioning
|
2023-09-24 13:12:33 +01:00
|
|
|
- Architecture: [[Partitioning.excalidraw]]
|
|
|
|
- A server is split horizontally (Sharding).
|
|
|
|
- Addresses scale-out.
|
|
|
|
- Can be applied to computation, data, ...
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 2.3 SOA - Service-Oriented Architecture
|
2023-09-24 13:17:33 +01:00
|
|
|
- Architecture: [[SOA.excalidraw]]
|
|
|
|
- Addresses scale-out and modularity.
|
|
|
|
- Example: micro-services.
|
2023-09-25 23:59:20 +01:00
|
|
|
- #### 2.3.1 Microservices
|
2023-09-24 13:22:33 +01:00
|
|
|
- Each service implements specific functionality.
|
|
|
|
- Services can scale independently.
|
|
|
|
- Decomposition may be troublesome: how micro is micro?
|
|
|
|
- Consistency.
|
2023-09-25 23:59:20 +01:00
|
|
|
- Complex deployment and testing
|
|
|
|
- ## Distributed architectures
|
|
|
|
- ### 1. Client-server
|
2023-09-24 13:27:33 +01:00
|
|
|
- Architecture: [[client-server.excalidraw]]
|
|
|
|
- Functionality and data are in the server.
|
|
|
|
- A stub runs embedded in the client.
|
|
|
|
- The stub is part of the server software package
|
2023-09-24 13:32:33 +01:00
|
|
|
- E.g., the Web (“protocol” is HTTP)
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 2. Proxy Server
|
2023-09-24 13:32:33 +01:00
|
|
|
- Architecture: [[proxy.excalidraw]]
|
|
|
|
- Multiple servers can be used transparently.
|
|
|
|
- The proxy is a performance and availability bottleneck.
|
|
|
|
- E.g. MongoDB
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 3. Master Server
|
2023-09-24 13:42:33 +01:00
|
|
|
- Architecture: [[master.excalidraw]]
|
|
|
|
- Scale out!
|
|
|
|
- E.g. HDFS
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 4. Server Group
|
2023-09-24 13:47:33 +01:00
|
|
|
- Architecture: [[server-group.excalidraw]]
|
2023-09-24 13:42:33 +01:00
|
|
|
- All servers can process requests.
|
|
|
|
- Coordination may be necessary.
|
|
|
|
- Resiliency!
|
|
|
|
- E.g. ZooKeeper
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 5. Bus
|
2023-09-24 13:52:33 +01:00
|
|
|
- Architecture: [[bus.excalidraw]]
|
2023-09-24 13:47:33 +01:00
|
|
|
- The bus routes messages.
|
|
|
|
- Participants publish and consume messages to/from the bus.
|
|
|
|
- Decouples producers from consumers.
|
|
|
|
- **Flexibility!**
|
|
|
|
- E.g. Kafka
|
2023-09-25 23:59:20 +01:00
|
|
|
- ### 6. Multi-tier
|
2023-09-24 13:57:33 +01:00
|
|
|
- Architecture: [[multi-tier.excalidraw]]
|
|
|
|
- Each server acts as a client of the next tier.
|
|
|
|
- Allows independent deployment and scaling of different functionality.
|
|
|
|
- E.g. AS + DBMS:
|
|
|
|
- “protocol A” == Web (e.g.)
|
|
|
|
- “Stub B” == Database Driver!
|
|
|
|
- “protocol B” uses SQL
|
2023-09-25 23:59:20 +01:00
|
|
|
- #### 6.1 State in multi-tier
|
2023-09-24 14:02:33 +01:00
|
|
|
- Persistent state is harder to replicate and shard.
|
|
|
|
- Computation is easier to replicate and shard.
|
|
|
|
- No state in upper tiers:
|
|
|
|
- Web browser
|
|
|
|
- Transient / cached state in middle tiers:
|
|
|
|
- Application server
|
|
|
|
- Persistent state at lower tiers:
|
2023-09-25 23:59:20 +01:00
|
|
|
- Database
|