5.8.3 Computing arrangements
The alerts cluster was co-located with, but distinct from, DPCI. Our cluster was built around a large, PostgreSQL Relational Database Management System (RDBMS). A dedicated, 32-core server held the primary copies of the databases and an identical machine held a secondary, read-only copy of each database, kept current by synchronous replication. These replica databases were originally installed as protection against data loss. They also served to increase performance by spreading the query load across two servers. Each database server had 176 TB of bulk-data space, arranged as a RAID 6. The alerts computers were interconnected, and connected to DPCI, by an Infiniband network.
The alerts pipeline was divided into: a batch application for ingestion of data, and primary data-reduction; a batch application for filtering of candidate alerts; a web application for human assessment of candidates surviving automatic filtering; and further web applications for publishing selected alerts. The data reduction application, which handled the greatest volume of data in each run, was assigned its own 64-core server. An identical server was held in readiness to take over should the first one fail. In practice, this reserve server was used for testing, for exploration of new algorithms, and occasionally for large-scale rearrangements of the main database. Each data-reduction server had 22 TB of data space to receive new data from DPCI. This held roughly six months of data and allowed reprocessing to correct errors or improve results over the span of the mission.
The other applications ran in virtual machines hosted on a pair of smaller servers. There was also a disc-server for back-ups of the main databases, with a capacity of 284 TB.
The main data-reduction application was written in Java, for performance and to conform to DPAC standards. The web applications were written in Python, using the Django framework, for ease of development. The batch-filtering application was also written in Python.
The most notable feature of the computing design was that the bulk of the data was stored in the PostgreSQL database. Compare this with the more common arrangement where only metadata are stored in the RDBMS, while the bulk is stored in flat files. Ingesting both the full input data-set, and the results of processing, reduced significantly the amount of code needed to simply move data, and allowed extreme flexibility in writing the applications that consumed, analysed and displayed the results. However, it was challenging to obtain sufficient throughput from the relational architecture. Many design choices in the database and applications were forced by the need to process a day’s data in six hours or less.
In mid-February 2021, the PostgreSQL system occupied 110 TB of its storage (with some unknown and variable fraction of this reclaimable for new data), almost all of which space was taken up in ingesting and recording the transit data. This was exceptionally large for a database that was extended daily and in which roughly 5 per cent of the contents were scanned for daily processing.
The data-set was far too large to fit comfortably into a single table for each record type, and was therefore partitioned by position of the sources into level-5 () HEALPix pixels; there were 12 288 tables for each record type that dealt with individual transits or sources. This partitioning was much coarser than the level-12 mesh used elsewhere by DPAC to group Gaia sources into catalogues. The level-5 mesh was chosen because it was the closest match to the width of the Gaia field of view. Empirically, it was most efficient to query historic transit-data for a whole HEALPix pixel, selecting transits only for those sources that had received new data in the current run, than to make one query per source with new data. The level-5 mesh minimized simultaneously the number of these expensive queries and the number of rows touched by a query that related to sources outside the current scan.
The queries to ingest and to raise data could not be straightforward in such a highly-stressed system; they had to be highly tuned for performance. This precluded the use of generic, object-relational-mapping libraries to generate queries. Instead, the application code formed its queries directly. In order to achieve performance, much parallelism was needed, and the number of threads accessing the data had to be chosen carefully. We knew from pre-mission tests that the application was not the bottleneck and could be given sufficient threads of execution to saturate the database engine. Later experiments showed that the database performance, for this application, was limited by CPU power on the database server, not by I/O capacity; the complexity of the queries dominated. Therefore, the ideal arrangement was to have one application thread accessing the database per CPU core on the database server: 32 such threads in our system. The data-reduction servers had 64 CPU cores and to use these we ran two second-level threads per HEALPix pixel to consume the raised data from the memory of the data-reduction server. By 2023 it became clear that we had stretched ourselves beyond the practical limit of the size of database that could be hosted on our single RDBMS-server. There was no budget to replace or upgrade the hardware. In May 2023, we decided to partition the database to separate the photometry data between ‘ancient history’ and recent measurements. We assigned segments 0 to 4 to ancient history (25 July 2014 – 23 April 2018, or 3.75 years of ancient history), giving us 23 April 2018 – 20 January 2020, or 21 months of history for which we had guaranteed Cycle 4 sourceIds. In May 2023, we enacted the plan and moved all rows with transitID 90528256246478800 to new HEALPix tables named hpXXXXX_ancienthistory, while rows with transitID 90528256246478800 were left in the existing HEALPix tables. We started the refactoring on 18 May 2023 and completed it almost three months later, on 8 August 2023. An improvement in our processing timescales came about by scanning smaller tables for sufficient recent history to trigger our detectors. For vetting, eyeballing and publishing, the ancient history tables were accessed.