<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">THE DEVELOPMENT OF A NEW CONDITIONS DATABASE PROTOTYPE FOR ATLAS RUN3 WITHIN THE CREST PROJECT</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Evgeny</forename><surname>Alexandrov</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">Joint Institute for Nuclear Research</orgName>
								<address>
									<addrLine>Joliot-Curie 6</addrLine>
									<postCode>141980</postCode>
									<settlement>Dubna, Moscow region</settlement>
									<country key="RU">Russia</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Andrea</forename><surname>Formica</surname></persName>
							<affiliation key="aff1">
								<orgName type="institution" key="instit1">Université Paris-Saclay</orgName>
								<orgName type="institution" key="instit2">CEA/Saclay IRFU</orgName>
								<address>
									<postCode>91191</postCode>
									<settlement>Gif-sur-Yvette</settlement>
								</address>
							</affiliation>
							<affiliation key="aff2">
								<orgName type="institution">IRFU/CEA</orgName>
								<address>
									<country key="FR">France</country>
								</address>
							</affiliation>
						</author>
						<author role="corresp">
							<persName><forename type="first">Mikhail</forename><surname>Mineev</surname></persName>
							<email>amineev@jinr.ru</email>
							<affiliation key="aff0">
								<orgName type="institution">Joint Institute for Nuclear Research</orgName>
								<address>
									<addrLine>Joliot-Curie 6</addrLine>
									<postCode>141980</postCode>
									<settlement>Dubna, Moscow region</settlement>
									<country key="RU">Russia</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Shaun</forename><surname>Roe</surname></persName>
							<affiliation key="aff3">
								<orgName type="institution">CERN</orgName>
								<address>
									<postCode>CH -1211</postCode>
									<settlement>Geneva 23</settlement>
									<country key="CH">Switzerland</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">THE DEVELOPMENT OF A NEW CONDITIONS DATABASE PROTOTYPE FOR ATLAS RUN3 WITHIN THE CREST PROJECT</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">CA1A586B16C7FCB9EAF1AEFA69A4691A</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T16:32+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>ATLAS</term>
					<term>conditions database</term>
					<term>CREST</term>
					<term>REST</term>
					<term>JSON</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>The CREST project for a new conditions database prototype for Run3 (intended to be used for production in Run4) is focused on improvement of Athena based access, metadata management and, in particular, global tag management. The project addresses evolution of the data storage design and conditions data access optimization, enhancing the caching capabilities of the system in the context of physics data processing inside the ATLAS distributed computing infrastructure. The CREST architecture is designed as a client server model, with the storage backend implemented in a relational database. The data access was realized with a pure REST API with JSON support. The new C++ client access library provides an HTTP query interface. A tool to convert the existing conditions data (stored in Oracle and accessible via the COOL API) into the new CREST system using a custom JSON format has also been implemented. Preliminary data migration has been done to allow testing data retrieval from Athena and the process of validation of the server and client functionalities is in progress.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>1.Introduction</head><p>This article presents a description of the CREST project <ref type="bibr" target="#b0">[1]</ref>. This project is a new database prototype for Conditions data with REST interface (CREST) for the ATLAS detector <ref type="bibr" target="#b1">[2]</ref> at the Large Hadron Collider (LHC) at CERN. Conditions data are non-event data, used to describe the detectors status, and constitute an essential ingredient for the processing of physics data, in order to reconstruct events optimally and exploit the full detector's potential.</p><p>Conditions data consist of time varying quantities like detector calibration and alignment data, electrical and environmental measurements (such as voltages, currents, pressures), temperatures, run and data acquisition configuration information, LHC beam information, trigger configuration and detector status data.</p><p>During LHC Run-1 and Run-2, ATLAS Conditions data were managed by the COOL/CORAL system (by CERN-IT). COOL is a C++ API based on CORAL client for access to the Relational (Oracle) DB <ref type="bibr" target="#b2">[3]</ref>. This COOL based DB realization has its own high level functionalities. All detector sub-systems have their own "COOL databases" (Schemas) and store payload data in dedicated tables (Folders). Payload data are stored according to Interval Of Validity (IOV). Each IOV is defined by a since time and an until time. COOL has two Folder types. The first one is single-versioned Folders: IOVs can be appended here (no overwrite, no Tag defined). The second one is multi-versioned Folders: IOVs can be stored in arbitrary way and are grouped in Tags (thus allowing the payload to be overwritten). A Global Tag is a collection of multiple Folder Tags. Payloads are retrieved by providing IOV boundaries (and related Tag name).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.1">Motivation for a new database</head><p>The new condition database project was started for several reasons. COOL DB caching is not well optimized since queries defined using different IOV boundaries may return the same payload data: this affects some workflows of the data processing. COOL DB structure is complicated: conditions data are spread over 30 Schemas and 10k Folders (about 1TB per data taking period). Every system change corresponds to new set of Folders. Long term COOL maintenance and evolution are problematic: COOL API (as well as CORAL) will be not supported by CERN IT Division after the beginning of Run3. COOL has no native support for the Global tags management.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.2">Condition REST (CREST) data model</head><p>The data model in CREST consists of five tables which contain metadata and payload data. It is originally inspired by the CMS conditions DB <ref type="bibr" target="#b3">[4]</ref>. Conditions data are stored in the PAYLOAD table <ref type="table">.</ref> Values are consumed as an aggregated set (typically a header and some parameters container(s). Conditions meta-data are organized in three tables (plus one used essentially for mapping between tags and global tags) (see Figure <ref type="figure" target="#fig_0">1</ref>). IOV in CREST contains the time information, which is stored in one time column (time can be represented as a timestamp, a run number etc.) and it is valid by default until the next entry in time. An IOV points to one payload via an sha256 hash key. TAG in CREST is a label used to identify a specific set of IOVs. An additional table for tag metadata information was created to ease the migration of existing COOL data. GLOBAL TAG is a label used to identify a consistent set of TAGs, involved in a given data flow (e.g. a reprocessing campaign, a MC production etc). The same TAG can be associated to many GLOBAL TAGs. The IOVs are retrieved separately from the PAYLOADS. This is a different behavior with respect to COOL, which loads everything (IOV+PAYLOAD) at the same time. This presents multiple advantages: first of all, the PAYLOAD access can be cached so it becomes faster, but also the IOVs can be checked very quickly, as they are de facto metadata of the PAYLOAD.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">CREST Project Structure</head><p>The CREST project consists of several components: the CREST Server, the C++ Client library, the CREST Command Line Client and COOL to CREST Converter.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">CREST Server</head><p>Like Frontier, the CREST DB server exposes functionalities via REST <ref type="bibr" target="#b4">[5]</ref>. In the case of CREST, the API is described using OpenAPI specifications <ref type="bibr" target="#b5">[6]</ref>. SQL is not involved in the dialogue between client and server, instead the internal resources are accessible via URLs. All HTTP verbs can be used: POST/PUT (to create/update resources), GET and DELETE. The request and response bodies are formatted in JSON. The header of the requests can be used for formatting the output, deal with caching related parameters etc. The prototype implementation is based on standard Java technologies (JEE, Spring) and specifications (JAX-RS <ref type="bibr" target="#b6">[7]</ref>, JPA), see Figure <ref type="figure" target="#fig_1">2</ref>. The CREST server can be deployed in the same Tomcat server as Frontier or as a standalone service (using standard Java web servers like undertow, jetty, …).</p><p>The client library (in Python) and server stubs (in Java JAX-RS) are generated via OpenApi. <ref type="bibr" target="#b7">[8]</ref> by the Swagger <ref type="bibr" target="#b8">[9]</ref> Codegen library. The first server version was implemented as a collaborative development within the ATLAS and CMS database teams. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">C++ CREST Client library (CrestApi library)</head><p>To simplify the CREST Server access to the C++ developers and the Athena framework, a C++ client library (CrestApi) was written. CrestApi library is a request library to the CREST Server (or to the local file storage). It allows to store, read (and update) the data on the CREST Server.</p><p>The data transferring mechanism (low level request methods) can be changed in the CrestApi library. The library prototype was created using the Boost Asio library. Now it uses the CURL [10] library.</p><p>The CrestApi library is written in C++, and the data exchanged with the server are in JSON format. The library uses the following external libraries: NLohmann JSON library <ref type="bibr" target="#b9">[11]</ref>, CURL, Boost Named Parameters library <ref type="bibr" target="#b10">[12]</ref>.</p><p>CREST Server API functions have many parameters, most of them are optional. CrestApi library uses the Boost Named Parameter Library to work with them. It allows to skip unused optional parameters when the method is called. Methods using the named parameters are in the CrestClientExt class (an extension of the standard CrestClient library).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">CREST Command Line Client (CrestCmd)</head><p>The CREST command line client (CrestCmd) is an access tool to the data stored on the CREST server written to simplify the development of the other CREST project components. CrestCmd can be used for quick interactions with the CREST server, mainly with the goal to provide management functionalities and browsing capabilities to users. CrestCmd works with the main CREST data types such as tags, tag meta infos, global tags, global tag maps and an IOVs together with payloads. Each CrestCmd command has a built-in help.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.4">COOL to CREST Converter</head><p>The CREST Converter is a command line tool to convert the existing data from COOL DB to CREST. After the CREST deployment, the converter will also be used as a tool for the existing user data conversion from COOL to CREST format. The CREST converter is based on the AtlCoolCopy/AtlCoolMerge tools and accepts the same parameters. If a connection with the CREST server fails, the CREST converter writes the data to disk in a format which allows later uploading to server. A cron job running the CREST converter will provide a background data transfer from COOL to CREST.</p><p>The essential differences between COOL and CREST data models require careful handling during the data conversion process. Each COOL IOV has two parameters defining the time interval: start and end time, CREST IOVs have the start time only. COOL folder has list of channels. The CREST data model does not know about channels. The information about the channels is stored inside the tag meta data.</p><p>COOL has no native API for global tag support. As a solution it is possible to add a special API for CREST implementation of the IDatabase interface of COOL. Now the algorithm to get the conditions data for a given global tag is organized as a chain: the logs from QTests are parsed to get a tag list, the tag list saved as a JSON file, then the data conversion for these tags starts.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 .</head><label>1</label><figDesc>Figure 1. CREST data model scheme</figDesc><graphic coords="3,70.90,70.90,466.30,238.79" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 2 .</head><label>2</label><figDesc>Figure 2. CREST Database Architecture</figDesc><graphic coords="4,89.18,70.90,416.87,151.90" type="bitmap" /></figure>
		</body>
		<back>
			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Conclusion</head><p>The CREST project server prototype and its main components are implemented. The CREST C++ client library (CrestApi) was written and included in the official ATLAS software offline release (Athena). The conversion tool prototype to fill the CREST DB with the real data was realized and used to start filling CREST DB using COOL data; this allows for the creation and subsequent debugging of CREST-based applications for new users. The data conversion and data testing are running to optimize the CREST DB with the concrete conditions data.</p></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Conditions evolution of an experiment in mid-life, without the crisis</title>
		<author>
			<persName><forename type="first">L</forename><surname>Rinaldi</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">ATLAS) // EPJ Web Conf</title>
				<imprint>
			<date type="published" when="2019">2019</date>
			<biblScope unit="volume">214</biblScope>
			<biblScope unit="page">4052</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">The ATLAS Experiment at the CERN Large Hadron Collider</title>
		<idno type="DOI">10.1088/1748-0221/3/08/S08003</idno>
	</analytic>
	<monogr>
		<title level="j">JINST</title>
		<imprint>
			<biblScope unit="volume">3</biblScope>
			<biblScope unit="page">S08003</biblScope>
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">LCG Persistency Framework (CORAL,COOL, POOL): status and outlook in 2012</title>
		<author>
			<persName><forename type="first">R</forename><surname>Trentadue</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Phys. Conf. Ser</title>
		<imprint>
			<biblScope unit="volume">396</biblScope>
			<biblScope unit="page">53067</biblScope>
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Functional tests of a prototype for the CMS-ATLAS common non-event data handling framework</title>
		<author>
			<persName><forename type="first">Roland</forename><surname>Sipos</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Phys. Conf. Ser</title>
		<imprint>
			<biblScope unit="volume">898</biblScope>
			<biblScope unit="page">42047</biblScope>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">A JEE RESTful service to access conditions data in ATLAS</title>
		<author>
			<persName><forename type="first">A</forename><surname>Formica</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><forename type="middle">J</forename><surname>Gallas</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Phys. Conf. Series</title>
		<imprint>
			<biblScope unit="volume">664</biblScope>
			<biblScope unit="page">42016</biblScope>
			<date type="published" when="2015">2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<ptr target="https://github.com/OAI/OpenAPI-Specification" />
		<title level="m">OAI/OpenAPI Specification</title>
				<imprint>
			<date type="published" when="2021-08-17">17.08.2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<title/>
		<author>
			<persName><forename type="first">Jax-Rs</forename><surname>Java</surname></persName>
		</author>
		<ptr target="https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services" />
		<imprint>
			<date type="published" when="2021-08-17">17.08.2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<monogr>
		<title/>
		<author>
			<persName><surname>Openapi</surname></persName>
		</author>
		<ptr target="https://www.openapis.org" />
		<imprint>
			<date type="published" when="2021-08-17">17.08.2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<monogr>
		<title/>
		<author>
			<persName><surname>Swagger</surname></persName>
		</author>
		<ptr target="http://swagger.io" />
		<imprint>
			<date type="published" when="2021-08-17">17.08.2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<monogr>
		<title level="m" type="main">JSON for Modern C++ -JSON for Modern C++</title>
		<ptr target="https://json.nlohmann.me" />
		<imprint>
			<date type="published" when="2021-08-17">17.08.2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<monogr>
		<ptr target="https://www.boost.org/doc/libs/1_67_0/libs/parameter/doc/html/index.html" />
		<title level="m">The Boost Parameter Library</title>
				<imprint>
			<date type="published" when="2021-08-17">17.08.2021</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
