-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathmysql_replica_architecture.d2
executable file
·85 lines (71 loc) · 2.23 KB
/
mysql_replica_architecture.d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env d2
#
# vim:ts=2:sts=2:sw=2:et:filetype=d2
#
# Author: Hari Sekhon
# Date: 2024-08-25 05:00:23 +0200 (Sun, 25 Aug 2024)
#
# https///github.com/HariSekhon/Diagrams-as-Code
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# M y S Q L R e p l i c a A r c h i t e c t u r e
# ============================================================================ #
direction: right
title: {
label: MySQL Replica Architecture
near: top-center
shape: text
style.font-size: 40
style.underline: true
}
classes: {
users: {
label: Users
icon: https://icons.terrastruct.com/essentials%2F359-users.svg
# icon: https://diagrams.mingrammer.com/img/resources/onprem/client/users.png
shape: image
}
mysql: {
icon: https://diagrams.mingrammer.com/img/resources/onprem/database/mysql.png
shape: image
}
servers: {
icon: https://icons.terrastruct.com/tech%2Fservers.svg
shape: image
}
}
# ============================================================================ #
# N o d e s
# ============================================================================ #
webservers: {
label: Web Servers
class: servers
}
mysql_master: Master\n(read/write) {
class: mysql
}
mysql_replica1: Read Replica 1 {
class: mysql
}
mysql_replica2: Read Replica 2 {
class: mysql
}
mysql_replica3: Read Replica 3 {
class: mysql
}
# ============================================================================ #
# F l o w
# ============================================================================ #
mysql_master -> mysql_replica1: replication {style.animated: true}
mysql_master -> mysql_replica2: replication {style.animated: true}
mysql_master -> mysql_replica3: replication {style.animated: true}
webservers -> mysql_replica1: reads
webservers -> mysql_replica2: reads
webservers -> mysql_replica3: reads
webservers -> mysql_master: writes {style.animated: true}