comparison Sphinx/source/plugins/postgresql.rst @ 643:411e82bb3a9f

documenting revisions and multiple writers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Apr 2021 15:47:14 +0200
parents 5c0dfc863884
children 8b8df1be0cf9
comparison
equal deleted inserted replaced
642:a76d83a00c68 643:411e82bb3a9f
10 default storage area (on the filesystem) and the default SQLite index 10 default storage area (on the filesystem) and the default SQLite index
11 by a PostgreSQL database. 11 by a PostgreSQL database.
12 12
13 For general information, check out the `official homepage of the 13 For general information, check out the `official homepage of the
14 plugins <https://www.orthanc-server.com/static.php?page=postgresql>`__. 14 plugins <https://www.orthanc-server.com/static.php?page=postgresql>`__.
15
16 For information about scalability, make sure to read the section about
17 :ref:`multiple writers in large-scale deployments <multiple-writers>`.
15 18
16 19
17 20
18 Compilation 21 Compilation
19 ----------- 22 -----------
119 "Host" : "localhost", 122 "Host" : "localhost",
120 "Port" : 5432, 123 "Port" : 5432,
121 "Database" : "orthanc", 124 "Database" : "orthanc",
122 "Username" : "orthanc", 125 "Username" : "orthanc",
123 "Password" : "orthanc", 126 "Password" : "orthanc",
124 "EnableSsl" : false // New in version 3.0 127 "EnableSsl" : false, // New in release 3.0
128 "MaximumConnectionRetries" : 10, // New in release 3.0
129 "ConnectionRetryInterval" : 5, // New in release 3.0
130 "IndexConnectionsCount" : 1 // New in release 4.0
125 }, 131 },
126 "Plugins" : [ 132 "Plugins" : [
127 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", 133 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so",
128 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" 134 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so"
129 ] 135 ]
208 214
209 Several advanced options are available as well to fine-tune the 215 Several advanced options are available as well to fine-tune the
210 configuration of the PostgreSQL plugins. They are documented below. 216 configuration of the PostgreSQL plugins. They are documented below.
211 217
212 218
219 .. _postgresql-multiple-writers:
220
221 Multiple writers or connections
222 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223
224 Starting with Orthanc 1.9.2 and PostgreSQL 4.0, it is possible to use
225 :ref:`multiple writers or connections in large-scale deployments
226 <multiple-writers>`. Here is the list of configuration that control
227 this behavior:
228
229 * ``Lock`` must be set to ``false`` (cf. :ref:`below <postgresql-lock>`)
230
231 * ``MaximumConnectionRetries`` governs how many times Orthanc tries to
232 connect to the database, as well as how many times Orthanc replays
233 transactions to deal with collisions between multiple writers.
234
235 * ``IndexConnectionsCount`` controls the number of connections from
236 the index plugin to the PostgreSQL database. It is set to ``1`` by
237 default, which corresponds to the old behavior of Orthanc <= 1.9.1.
238
239 * ``ConnectionRetryInterval`` is only used when opening one database
240 connection to PostgreSQL.
241
242 * The PostgreSQL plugin supports the :ref:`revision mechanism
243 <revisions>` to protect metadata and attachments from concurrent
244 modifications.
245
246
247
213 .. _postgresql-lock: 248 .. _postgresql-lock:
214 249
215 Locking 250 Locking
216 ^^^^^^^ 251 ^^^^^^^
217 252
220 By default, the plugins lock the database (using `PostgreSQL advisory 255 By default, the plugins lock the database (using `PostgreSQL advisory
221 locks 256 locks
222 <https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS>`__) 257 <https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS>`__)
223 to prevent other instances of Orthanc from using the same PostgreSQL 258 to prevent other instances of Orthanc from using the same PostgreSQL
224 database. If you want several instances of Orthanc to share the same 259 database. If you want several instances of Orthanc to share the same
260 database or if you need multiple connections to the PostgreSQL
225 database, set the ``Lock`` option to ``false`` in the configuration 261 database, set the ``Lock`` option to ``false`` in the configuration
226 file:: 262 file::
227 263
228 { 264 {
229 "Name" : "MyOrthanc", 265 "Name" : "MyOrthanc",