Elffuss BraidHub

kikocis/EDC public

main · 4.0 KiBRenderedRawPermalink
1# Data plane module
2
3## Overview
4
5This module covers the Data Plane Framework (DPF), which is the entity in charge of performing the actual data transfer
6between consumer and provider. This DPF is developed in such a way that it can support a myriad of deployment
7topologies.
8
9## Scope
10
11The Data Plane Framework is designed to only work with:
12
13- finite data transfers,
14- small payload, latent non-finite transfers such as events.
15
16High-volume or latency-sensitive streaming (non-finite) data transfers should be handled by other implementations that
17delegate to specialized third-party infrastructure such as Kafka.
18
19## Principles
20
21### Minimal state
22
23All state pertaining to a transfer process are maintained by the Control Plane as part of the `TransferProcess`. The
24only state that is maintained by the DPF is if a transfer process has been completed. This requires the Control Plane to
25issue retries in the event of failure.
26
27### No transformation
28
29The DPF is not an ETL tool. It does not contain any facilities for data transformations or processing. This is expected
30to be handled by the Control Plane as part of the provisioning state.
31
32### Do not reinvent the wheel
33
34The DPF relies on existing data transfer technology such as S3, Azure Object Storage, FTP, etc. As a rule of thumb: the
35DPF should not contain any wire protocol implementations.
36
37### Flexible Deployment
38
39It must be possible to:
40
41- deploy the DPF to a K8S cluster,
42- deploy the DPF remotely from the Control Plane,
43- deploy the DPF in the same process as the Control Plane for demo and testing purposes,
44
45### Extensible
46
47The DPF is built using the EDC modularity and extensibility system.
48
49## Design
50
51### Data Plane Manager
52
53The DataPlaneManager (DPM) enqueues `DataFlowRequest`, which may originate from an ingress such as an HTTP endpoint. The
54queue implementation will be a bounded, in-memory data structure that provides support for backpressure when the system
55is overloaded. However, since the queue is in-memory, the client control plane submitting the request will be
56responsible for re-submitting a request in the event of failure.
57
58The DPM implementation has a configurable number of workers that dequeue requests for processing (data transfer). This
59processing operation will complete asynchronously. When a result is returned, an entry for the process indicating
60success or failure is made using extensible storage. This allows the Control Plane to query the DPF for the status (
61COMPLETED or ERROR) of a process. No other state is maintained by the DPF.
62
63The DPM also contains transfer methods that take a `DataSource` and `DataSink`, respectively, These can be used to
64provide an ad-hoc transfer source or destination. For example, user code may dequeue a message to memory and send it to
65a destination using an `InputStreamDataSource` that wraps the in-memory message. Similarly, user code may wish to
66transfer data from a source to a provided `OutputStreamDataSink`.
67
68### Pipeline Service
69
70When a DPM worker dequeues a request, it will delegate to the `transfer` method of the `PipelineService`.
71
72The implementation of this service is straightforward: it connects a sink with its source, both of which are
73instantiated by extensible factories. This design allows for scalable, _n_-way data transfers since all data are
74directly streamed from its origin to the terminus.
75
76### Pull Streaming
77
78The DPF design is based on a pull streaming model, i.e. a `DataSink` pulls data from a `DataSource`. This allows the
79sink to control the rate of transfer and potentially parallelize operation. Moreover, optimizations can be made such as
80copy-in-place when the source and sink are the same infrastructure such as object storage hosted by a single cloud
81provider.
82
83Implementations may support random data access for parallel transfers of large files. For example, both AWS S3 and Azure
84Object Storage have facilities for ranged gets.
85
86`DataSink` implementations will provide the ability to configure parallel transfers, e.g. controlling the number of
87threads to perform ranged gets.