~jan-kneschke/mysql-proxy/packet-tracking-assertions

« back to all changes in this revision

Viewing changes to doc/architecture.txt

  • Committer: Kay Roepke
  • Date: 2009-01-20 12:04:47 UTC
  • Revision ID: kay@mysql.com-20090120120447-fkoxq5ovwf9iyk4v
add the wrapper script/makefile fu to start mysql-proxy without having to set the environment variables

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
@mainpage
3
 
 
4
 
The MySQL Proxy is a simple program which sits between a mysql client and a mysql server and
5
 
can inspect, transform and act on the data sent through it.
6
 
 
7
 
You can use it for:
8
 
@li load balancing
9
 
@li fail over
10
 
@li query tracking
11
 
@li query analysis
12
 
@li ... and much more
13
 
 
14
 
Internally the MySQL Proxy is a stack of:
15
 
 
16
 
@dotfile architecture-overview.dot
17
 
 
18
 
It is based on a @subpage page-core that exposes the phases of the
19
 
@subpage protocol to a @ref page-plugins.
20
 
 
21
 
@dot
22
 
digraph {
23
 
connect -> auth;
24
 
auth -> command;
25
 
command -> disconnect;
26
 
command -> command;
27
 
connect -> disconnect;
28
 
auth -> disconnect;
29
 
}
30
 
 
31
 
@enddot
32
 
 
33
 
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:
34
 
 
35
 
@msc
36
 
        Client, Proxy, Server;
37
 
 
38
 
        Client -> Proxy [ label = "accept()" ];
39
 
        Proxy -> Proxy [ label = "script: connect_server()" ];
40
 
        Proxy -> Server [ label = "connect()" ];
41
 
        ...;
42
 
        Server -> Proxy [ label = "recv(auth-challenge)" ];
43
 
        Proxy -> Proxy [ label = "script: read_handshake()" ];
44
 
        Proxy -> Client [ label = "send(auth-challenge)" ];
45
 
        Client -> Proxy [ label = "recv(auth-response)" ];
46
 
        Proxy -> Proxy [ label = "script: read_auth()" ];
47
 
        Server -> Proxy [ label = "send(auth-response)" ];
48
 
        Server -> Proxy [ label = "recv(auth-result)" ];
49
 
        Proxy -> Proxy [ label = "script: read_auth_result()" ];
50
 
        Proxy -> Client [ label = "send(auth-result)" ];
51
 
        ...;
52
 
        
53
 
@endmsc
54
 
 
55
 
While the @ref page-core is scalable to a larger number of connections, the plugin/scripting
56
 
layer hides the complexity from the end-users and simplifies the customization. 
57
 
 
58
 
@section section-stack-of-libs Chassis, libraries and Plugins
59
 
 
60
 
It is built as a stack of libraries:
61
 
 
62
 
The @subpage page-chassis provides the common functions that all commandline and daemon applications
63
 
need: 
64
 
@li commandline and configfiles
65
 
@li logging
66
 
@li daemon/service support
67
 
@li plugin loading
68
 
 
69
 
The MySQL Procotol libraries which can encode and decode:
70
 
@li client protocol
71
 
@li binlog protocol
72
 
@li myisam files
73
 
@li frm files
74
 
@li masterinfo files
75
 
 
76
 
The @ref page-core and the @subpage page-plugins.
77
 
 
78
 
@dotfile architecture.dot
79
 
 
80
 
*/