Wiki source code of XWiki Runtime Architecture

Last modified by Eleni Cojocariu on 2026/11/25 15:15

Show last authors
1 XWiki is a Java web application, so an instance is never a single program: it is a Java runtime, a servlet container serving the application, a relational database holding the content, and a directory on disk holding what the database does not. The [[installation methods>>doc:documentation.xs.admin.installation.methods.WebHome]] differ mainly in how many of those you assemble yourself.
2
3 == The pieces ==
4
5 |=Piece|=Why XWiki needs it|=What it has to be
6 |Java runtime|XWiki is compiled Java, so nothing runs without one.|A Java Runtime Environment in a [[supported version>>dev:Community.SupportStrategy.JavaSupportStrategy.WebHome]]. A ##JDK## is not needed.
7 |Servlet container|It listens on the network, serves the web application and hands it each request.|Any container implementing Servlet 6.0 ({{version before="19.0.0RC1"}}Servlet 5.0{{/version}}). Tomcat and Jetty are the [[supported ones>>dev:Community.SupportStrategy.ServletContainerSupportStrategy.WebHome]].
8 |XWiki web application|The wiki itself, deployed as the ##.war## package the container unpacks.|One of the [[distributions>>doc:documentation.xs.admin.installation.methods.WebHome]] below, or the ##.war## from the [[Download page>>doc:Download.WebHome]].
9 |Relational database|It holds the Pages, their history and the objects attached to them.|Any database with a JDBC 4.2 driver, among the [[supported ones>>dev:Community.SupportStrategy.DatabaseSupportStrategy]]. HSQLDB is meant for evaluation rather than production.
10 |[[Permanent directory>>doc:documentation.xs.admin.installation.directories.permanent-directory.WebHome]]|It holds what is not in the database and still has to survive a restart and an upgrade.|A directory outside the application, so that an upgrade replaces the application without touching the data.
11
12 The version each of them has to be is in the [[prerequisites>>doc:documentation.xs.admin.installation.prerequisites.WebHome]].
13
14 {{plantuml}}
15 @startuml
16 title An XWiki instance
17
18 actor "Reader" as reader
19
20 node "Server" as server {
21 node "Java runtime" as jre {
22 component "Servlet container" as container {
23 component "XWiki web application" as xwiki
24 }
25 }
26 folder "Permanent directory" as perm
27 }
28
29 database "Relational database" as db
30
31 reader --> container : HTTP
32 xwiki --> db : JDBC
33 xwiki --> perm : files
34 @enduml
35 {{/plantuml}}
36
37 == The distributions assemble the same pieces ==
38
39 Picking an [[installation method>>doc:documentation.xs.admin.installation.methods.WebHome]] is deciding how much of that stack is yours to install and configure:
40
41 * The [[standalone (demo) distribution>>doc:documentation.xs.admin.installation.methods.install-standalone-demo-distribution.WebHome]] ships Jetty and HSQLDB inside the archive, so only the Java runtime is yours.
42 * The [[Docker image>>https://hub.docker.com/_/xwiki/]] ships the runtime and the container; you point it at a database and at persistent storage.
43 * The [[Debian packages>>Documentation.AdminGuide.InstallationViaAPT]] let the package manager pull in the runtime, the container and the database.
44 * The [[##.war## package>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.WebHome]] leaves all of them to you, which is what makes it the method for a deployment you want to control.
45
46 == Where an instance's state lives ==
47
48 The data is in two places, and a [[backup>>doc:documentation.xs.admin.backup.backup-instance.WebHome]] that takes only one of them is incomplete:
49
50 * The **relational database** holds the Pages and their history, the objects attached to them, and the metadata of every attachment.
51 * The **[[permanent directory>>doc:documentation.xs.admin.installation.directories.permanent-directory.WebHome]]** holds the attachment content, which is on the filesystem unless you [[switch to the database store>>doc:documentation.xs.admin.attachments.store.switch-database.WebHome]], the installed extensions, the Solr search data and the statuses of the background jobs. [[Sub-Directories in the Permanent Directory>>doc:documentation.xs.admin.installation.directories.permanent-directory.sub-directories.WebHome]] lists all of it.
52
53 The [[temporary directory>>doc:documentation.xs.admin.installation.directories.temporary-directory.WebHome]] is not part of that: XWiki empties it at every startup.
54
55 Whatever the store, the fields holding page references, page titles and the short string properties of an object are limited to **768 characters**, which is the longest value MySQL can index.

Get Connected