PostgreSQL; in db file storage, scalability, backups


I was looking at Orthanc PACS and had some questions about other people’s experiences using PostgreSQL setup.

  1. Have you used in-database storage plugin. What did that do to memory consumption of Postgres for your given number of studies/files?

  2. What are the PACS size limitation when using PostgreSQL file storage. Looking at the orthanc schema it looks like text data type is used to store tag values. Then looking at postgres documentation,, it looks like the limitations are 4 billion records when entry exceeds 2KB. So a single image with pixel data tag will reduce 4 billion record count by 1, and an RT Structure Set with, say 1000 contours where each contour decimal string entry > 2K will reduce count by 1000. Is that correct?

  3. In your experience when storing files in DB, is hot backup possible? That is Orthanc continues to recieve/send files while Postgres backup is happening?

  4. Is there a description of filesystem layout? For example I see the DICOM files I sent in various folders, but there are extra smaller files that don’t appear to be DICOM (dcmdump complains for example). What are those?

Thank you very much.


  1. I let other people answer, as this is a sysadmin question.

  2. There are 2 distinct plugins for PostgreSQL: the “index” plugin and the “file storage” plugin. You are not obliged to use both of them simultaneously. On large-scale scenarios, my advise is to use the PostgreSQL index, together with the default filesystem file storage pointing to a NAS drive with proper backup strategies.

The PostgreSQL index only stores a small subset of the most common DICOM tags, aka. the “Main DICOM tags” whose list can be found in the following file:

As can be seen, pixel data and structure sets are not part of the “Main DICOM tags”, and are thus not stored in the PostgreSQL index.

  1. I let other people answer, as this is a sysadmin question.

  2. The filesystem structure is explained in the FAQ of the Orthanc Book:

If you don’t use user-defined attachments, Orthanc stores two types of files as attachments in its storage area:

  • DICOM files.
  • JSON summaries of the DICOM files.


Thank you for your answers Sébastien.