forked from Qihoo360/Atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchitecture.txt
More file actions
80 lines (61 loc) · 2.08 KB
/
architecture.txt
File metadata and controls
80 lines (61 loc) · 2.08 KB
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
/**
@mainpage
The MySQL Proxy is a simple program which sits between a mysql client and a mysql server and
can inspect, transform and act on the data sent through it.
You can use it for:
@li load balancing
@li fail over
@li query tracking
@li query analysis
@li ... and much more
Internally the MySQL Proxy is a stack of:
@dotfile architecture-overview.dot
It is based on a @subpage page-core that exposes the phases of the
@subpage protocol to a @ref page-plugins.
@dot
digraph {
connect -> auth;
auth -> command;
command -> disconnect;
command -> command;
connect -> disconnect;
auth -> disconnect;
}
@enddot
Each of the phases of the life-cycle lead to several more protocol-states. For example the auth phase is made up of at least 3 packets:
@msc
Client, Proxy, Server;
Client -> Proxy [ label = "accept()" ];
Proxy -> Proxy [ label = "script: connect_server()" ];
Proxy -> Server [ label = "connect()" ];
...;
Server -> Proxy [ label = "recv(auth-challenge)" ];
Proxy -> Proxy [ label = "script: read_handshake()" ];
Proxy -> Client [ label = "send(auth-challenge)" ];
Client -> Proxy [ label = "recv(auth-response)" ];
Proxy -> Proxy [ label = "script: read_auth()" ];
Server -> Proxy [ label = "send(auth-response)" ];
Server -> Proxy [ label = "recv(auth-result)" ];
Proxy -> Proxy [ label = "script: read_auth_result()" ];
Proxy -> Client [ label = "send(auth-result)" ];
...;
@endmsc
While the @ref page-core is scalable to a larger number of connections, the plugin/scripting
layer hides the complexity from the end-users and simplifies the customization.
@section section-stack-of-libs Chassis, libraries and Plugins
It is built as a stack of libraries:
The @subpage page-chassis provides the common functions that all commandline and daemon applications
need:
@li commandline and configfiles
@li logging
@li daemon/service support
@li plugin loading
The MySQL Procotol libraries which can encode and decode:
@li client protocol
@li binlog protocol
@li myisam files
@li frm files
@li masterinfo files
The @ref page-core and the @subpage page-plugins.
@dotfile architecture.dot
*/