5
Subversion is conceptually divided into a number of separable layers.
7
Assuming that the programmatic interface of each layer is well-defined,
8
it is easy to customize the different parts of the system. Contributors
9
can write new client apps, new network protocols, new server processes,
10
new server features, and new storage back-ends.
12
The following diagram illustrates the "layered" architecture, and where
13
each particular interface lies.
17
+--------------------+
18
| commandline or GUI |
20
+----------+--------------------+----------+ <=== Client interface
25
+-------+--------+ +--------------+--+----------+ <=== Network interface
26
| Working Copy | | Remote | | Local |
27
| Management lib | | Repos Access | | Repos |
28
+----------------+ +--------------+ | Access |
44
+----------+-------------+--------------+----------+ <=== Filesystem interface
46
| Subversion Filesystem |
48
+--------------------------------------------------+
56
* Client Layer:: Client-side overview.
57
* Network Layer:: Network overview.
58
* Filesystem Layer:: Server-side overview.
61
@c ------------------------------------------------------------------
65
The Subversion client, which may be either command-line or GUI, draws on
68
The working copy library, @file{libsvn_wc}, provides an API for
69
managing the client's working copy of a project. This includes
70
operations like renaming or removal of files, patching files,
71
extracting local diffs, and routines for maintaining administrative
72
files in the @file{.svn/} directory.
74
The repository_access library, @file{libsvn_ra}, provides an API for
75
exchanging information with a Subversion repository. This includes
76
the ability to read files, write new revisions of files, and ask the
77
repository to compare a working copy against its latest revision.
78
Note that there are two implementations of this interface: one
79
designed to talk to a repository over a network, and one designed to
80
work with a repository on local disk. Any number of interface
81
implementations can exist.
83
The client library, @file{libsvn_client} provides general client
84
functions such as @code{update()} and @code{commit()}, which may
85
involve one or both of the other two client libraries.
86
@file{libsvn_client} should, in theory, provide an API that allows
87
anyone to write a Subversion client application.
89
For details, @xref{Client}.
91
@c ------------------------------------------------------------------
93
@section Network Layer
95
The network layer's job is to move the repository API requests over a
98
On the client side, a network library (@file{libneon}) translates
99
these requests into a set of HTTP WebDAV/DeltaV requests. The
100
information is sent over TCP/IP to an Apache server. Apache is used
101
for the following reasons:
105
it is time-tested and extremely stable;
107
it has built-in load-balancing;
109
it has built-in proxy and firewall support;
111
it has authentication and encryption features;
113
it allows client-side caching;
115
it has an extensible module system
118
Our rationale is that any attempt to write a dedicated "Subversion
119
server" (with a "Subversion protocol") would inevitably end up
120
evolving towards Apache's already-existing feature set. (However,
121
Subversion's layered architecture certainly doesn't @emph{prevent}
122
anyone from writing a totally new network access implementation.)
124
An Apache module (@file{mod_dav_svn}) translates the DAV requests into
125
API calls against a particular repository.
127
For details, @xref{Protocol}.
129
@c ------------------------------------------------------------------
130
@node Filesystem Layer
131
@section Filesystem Layer
133
When the requests reach a particular repository, they are interpreted
134
by the @dfn{Subversion Filesystem library}, @file{libsvn_fs}. The
135
Subversion Filesystem is a custom Unix-like filesystem, with a twist:
136
writes are revisioned and atomic, and no data is ever deleted! This
137
filesystem is currently implemented on top of a normal filesystem,
138
using Berkeley DB files.
140
For a more detailed explanation: @xref{Server}.