comparison Sphinx/source/faq/scalability.rst @ 752:9b8fb1b37638

added notes about concurrency
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 15 Aug 2021 13:36:07 +0200
parents b2b1ba11faaa
children 4e9dc26a5cb9
comparison
equal deleted inserted replaced
751:37512473ffe9 752:9b8fb1b37638
308 * If a higher-level application **modifies metadata and/or 308 * If a higher-level application **modifies metadata and/or
309 attachments** in the presence of multiple writers, Orthanc provides 309 attachments** in the presence of multiple writers, Orthanc provides
310 a :ref:`revision mechanism <revisions>` to prevent concurrent 310 a :ref:`revision mechanism <revisions>` to prevent concurrent
311 updates. 311 updates.
312 312
313 * Each Orthanc instance maintains its own list of jobs; therefore, the 313 * Thanks to this support of concurrent accesses, it is possible to put
314 ``/jobs`` route will return only the jobs of the responding Orthanc. 314 a **load balancer** on the top of the REST API of Orthanc. All the
315 315 DICOM resources (patients, studies, series and instances) are indeed
316 shared by all the instances of Orthanc connected to the same
317 underlying database. As an application, this might be of great help
318 if multiple viewers must connect to Orthanc. In `Kubernetes
319 <https://kubernetes.io/>`__, concurrent accesses also make it
320 possible to manage a set of replicas of Orthanc (e.g. as `deployment
321 <https://kubernetes.io/docs/concepts/workloads/controllers/deployment/>`__).
322
323 There are however some caveats if using a load balancer or
324 Kubernetes replicas, notably:
325
326 - Each Orthanc instance maintains its own list of jobs. Therefore,
327 the ``/jobs`` route will return only the jobs of the responding
328 Orthanc.
329
330 - The ``/modalities`` or the ``/peers`` are also private to each
331 instance of Orthanc in the cluster, as soon as the respective
332 options ``DicomModalitiesInDatabase`` and
333 ``OrthancPeersInDatabase`` are set to ``true``.
334
335 If you need to use such primitives in your application, you have
336 three possibilities: (1) Introduce a distinguished Orthanc server
337 that is responsible to take care of all the jobs (including
338 modalities and peers), (2) create an :ref:`Orthanc plugin <plugins>`
339 (e.g. using :ref:`Python <python-plugin>`) that queries all the
340 Orthanc in the cluster and that aggregates all of their answers,
341 or (3) do the same using a higher-level framework (such as Node.js).
342
316 343
317 Latency 344 Latency
318 ^^^^^^^ 345 ^^^^^^^
319 346
320 For some queries to the database, Orthanc performs several small SQL 347 For some queries to the database, Orthanc performs several small SQL