Skip to content

docs: add design doc for replication fanout (NOT FOR MERGE) - #8002

Draft
BorysTheDev wants to merge 1 commit into
mainfrom
replication_fanout
Draft

docs: add design doc for replication fanout (NOT FOR MERGE)#8002
BorysTheDev wants to merge 1 commit into
mainfrom
replication_fanout

Conversation

@BorysTheDev

Copy link
Copy Markdown
Contributor

This is a design doc for #7993.

Comment on lines +50 to +57
Every replica has its own connection, output queue, acknowledgement state, and progress. The
snapshot data and journal records are produced once per source shard, then distributed to those
independent flows.

## Batching requests

At most one batch can create or send a snapshot. A request belongs either to the current batch or
to the next batch:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an introduction what a batch is

Comment on lines +38 to +45
+--------------------------------------------+
|
Serving node fanout
+----------------+ |
| snapshot maker |-------------------------------------------+-------+-------+
+----------------+ | | |
v v v
R1 R2 R3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current souce code you can have easy fan out only when you hide the three replicas behind a common interface

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The complexity question is: do we need batching or can we just handle everything one by one

@BorysTheDev

BorysTheDev commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Configuration: 4 GiB of random data, one proactor per instance, continuous 1 KiB SET and GET load, and a 1-second fanout collection window. It is AI fast implementation, I believe we can get better numbers

Replicas Without fanout With fanout Result
1 4.13 s 4.04 s 2.2% faster
2 6.24 s 6.75 s 8.2% slower
3 9.47 s 7.76 s 18.1% faster (1.22×)
4 13.40 s 9.53 s 28.9% faster (1.41×)
5 19.20 s 12.20 s 36.5% faster (1.57×)

Fanout starts to improve full-sync time at three replicas with this collection-window setting.

@BorysTheDev

Copy link
Copy Markdown
Contributor Author

Configuration: requested data size 100.00 GiB, one master, 1–10 replicas, 10 proactors per Dragonfly process, 10 random-command client threads, a 1-second fanout collection window, and io_uring (default; locked-memory limit: 185.64 GiB).

Replicas Without fanout With fanout Result Random-command ops: without / with
1 18.45 s 27.53 s 49.2% slower 120,832 / 162,033
2 38.67 s 42.07 s 8.8% slower 77,784 / 161,154
3 58.12 s 57.51 s 1.1% faster (1.01×) 54,405 / 175,896
4 78.49 s 72.19 s 8.0% faster (1.09×) 44,277 / 175,022
5 98.33 s 87.91 s 10.6% faster (1.12×) 30,765 / 176,952
6 124.22 s 109.55 s 11.8% faster (1.13×) 30,081 / 180,141
7 176.31 s 135.60 s 23.1% faster (1.30×) 53,739 / 219,585
8 188.15 s 140.20 s 25.5% faster (1.34×) 26,607 / 194,528
9 215.81 s 154.74 s 28.3% faster (1.39×) 46,265 / 183,715
10 234.58 s 170.61 s 27.3% faster (1.37×) 29,240 / 150,439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants