<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Distributed Data Storage for Modern Astroparticle Physics Experiments?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alexander Kryukov</string-name>
          <email>kryukov@theory.sinp.msu.ru</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Minh-Duc Nguyen</string-name>
          <email>nguyendmitri@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Igor Bychkov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrey</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Matrosov Institute for System Dynamics and Control Theory, Siberian Branch of Russian Academy of Sciences</institution>
          ,
          <addr-line>Lermontov st. 134, Irkutsk</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Skobeltsyn Institute of Nuclear Physics, Lomonosov Moscow State University</institution>
          ,
          <addr-line>Moscow 119992</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The German-Russian Astroparticle Data Life Cycle Initiative is an international project launched in 2018. The Initiative aims to develop technologies that provide a uni ed approach to data management, as well as to demonstrate their applicability on the example of two large astrophysical experiments - KASCADE and TAIGA. One of the key points of the project is the development of a distributed storage, which, on the one hand, will allow data of several experiments to be combined into a single repository with uni ed interface, and on the other hand, will provide data to all participants of experimental groups for multi-messenger analysis. Our approach to storage design is based on the single write-multiple read (SWMR) model for accessing raw or centrally processed data for further analysis. The main feature of the distributed storage is the ability to extract data either as a collection of les or as aggregated events from di erent sources. In the last case the storage provides users with a special service that aggregates data from di erent storages into a single sample. Thanks to this feature, multimessenger methods used for more sophisticated data exploration can be applied. Users can use both Web-interface and Application Programming Interface (API) for accessing the storage. In this paper we describe the architecture of a distributed data storage for astroparticle physics and discuss the current status of our work.</p>
      </abstract>
      <kwd-group>
        <kwd>Astroparticle physics Distributed storage Open science CERNVM-FS Timeseries DB</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Currently, a number of experimental facilities in the eld of particle astrophysics
of the mega-sciences class are under construction or are already operating around
? Supported by RSF, grant no. 18-41-06003
the world. Among them there are such installations as LSST [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ], MAGIC [
        <xref ref-type="bibr" rid="ref3 ref4">3,
4</xref>
        ], CTA [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ], VERITAS [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], HESS [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], and others. These facilities collect a
tremendous volume of data. For example the annual (reduced) raw data of the
CTA project have a volume of about 4 PB. The total volume to be managed by
the CTA archive is of the order of 25 PB per year, when all data-set versions
and backup replicas are considered.
      </p>
      <p>In addition to the huge ow of data produced, an important feature of this
class of projects is the participation of many organizations and, as a result,
the distributed nature of data processing and analysis. All this presents a real
challenge to developers of the data analytics infrastructure.</p>
      <p>
        To meet a similar challenge in high energy physics, the WLCG grid was
deployed as part of the LHC project [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. This solution, on the one hand, proved
to be highly e cient, but on the other hand, it turned out to be a rather heavy
one requiring high administrative costs, highly quali ed sta and a very
homogeneous environment on which applications operate. The success of the WLCG
is based primarily on the fact that thousands of physicist users actually solve
one global problem using a highly centralized system management.
      </p>
      <p>
        Taking into account the tendency to a multi-messenger analysis [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] of data
with its potential for a more accurate exploration of the Universe and mordern
trend to open science [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ], it is very important to provide users from
geographically distributed locations with access to the data of di erent astrophysics
facilities. Today, open access to data or, more generally, open science is becoming
increasingly popular. This is due to the fact that the amount of data received in
some experiment often exceeds the capabilities of the relevant collaboration to
process and analyze these data. And only the involvement of all scientists
interested in research in this area allows for a comprehensive analysis of the data in
full.
      </p>
      <p>
        Please note that most existing collaborations have a long history and apply
methods for data processing they are accustomed to. So, our approach to the
design of data storage for astroparticle physics should be based on two main
principles. The rst principle is that there is no interference with the existing
local storage. And the second principle is the processing of user requests in a
special service outside the local storage using metadata. The interaction between
local storages and any user of the system should be provided by special adaptors
which de ne a uni ed interface for data exchange in the system. Our approach
to storage design is based on a single write-multiple read model (SWMR) for
accessing raw data or centrally processed data for further analysis. The motivation
for the solution is that both raw data and data after the initial processing (for
example, calibration) should be stored unchanged and presented to users as is
upon request. A similar approach is being discussed in the HDF5 community [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>The main ideas of the proposed approach are as follows:
{ no changes in the inner structure of local storage;
{ uni cation of access to local storage based on corresponding adapter
modules;
{ use of local data access policies;
{ search of the requested data using the only metadata on a special service;
{ aggregating the requested data into a new collection and providing the user
with access to it;
{ data transfer only at the moment of actual access to them.</p>
      <p>Based on the above principles and ideas, we propose a concept of distributed
storage for astrophysical experiments, which we call APPDS (abbreviated from
AstroParticle Physics Distributed Storage). The prototype of such distributed
storage is developed in the framework of the German-Russian Astroparticle Data
Life Cycle Initiative [17]. This initiative aims to develop a distributed data
storage system in the eld of astrophysics of particles by the example of two
experiments KASCADE [14] and TAIGA [15, 16], as well as to demonstrate its
viability, stability and e ciency.</p>
      <p>Below we discuss the architecture of the distributed data storage and brie y
report the current status of the project and the nearest plans.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Architecture of the data storage</title>
      <p>One of the main ideas of the distributed data storage architecture for the physics
of astroparticles is that we do not interfere with the work of local storages S1
... S3 (see Fig. 1). This is achieved by using special adapter programs A1 ...
A3 that allow local storages to interact with the data aggregation service. As
adapters, we use the CERNVM-FS [18] le system to export local le systems
to the aggregation service in a read-only mode. First, it provides a transparent
way for users to interact with local storages. Secondly, the actual transfer of data
will only occur when a user actually accesses these data. Additionally, reducing
network tra c can be achieved through the use of CVMFS caching properties.</p>
      <p>To retrieve the necessary les, a user forms a request through the web
interface provided by the Data Aggregation Service. When the Data Aggregation
Service receives the user request, it requests a response from the Metadata
Catalogue (MDC). After the Metadata Catalogue responds, the Data Aggregation
Service forms the corresponding resulting response and delivers it to the user.</p>
      <p>The proposed system o ers two types of search conditions for user requests:
a le-level search and an event-level search.</p>
      <p>In the case of a le-level search, the user requests a set of les, imposing
conditions on the metadata (that is, on the data about the les). An example of
such a condition is the range of dates of observation of gamma sources in the sky.
It is important to note that the user will receive in response the corresponding
set of les with the same directory structure as in the original repository. Thus,
the application software can be run without modi cation, as if the user runs the
program locally.</p>
      <p>In the case of a event-level search, the user wants to select from the les
only some events that satisfy the search conditions, for example, some energy
range of the air ow. In this case the events are selected from the les and the
aggregation service prepares a new one which contains only the necessary events.
The new le is transferred to the user. However, the directory structure will be
preserved too.</p>
      <p>The processing of user requests is performed by the metadata catalogue, the
main purpose of which is to specify, up to an event, in which les and where
the data requested by the user are contained. The MDC service is built around
TimescaleDB [20{22].</p>
      <p>The extractors E1, E2 play a key role in the architecture of APPDS. All data
stored in the local storages must pass through the extractors. The extractors take
o metadata from the data and store the metadata in MDC. The type of the
extracted metadata is de ned by the metadata description le (MDD) which is
used as input for the extractor. The MDD le is written in Kaitai Struct [23,
24] format with special marks pointing to elements of binary data which are
metadata and should be extracted.</p>
      <p>The extractor E1 takes out metadata from raw data, while the extractor E2
takes out metadata from centrally processed data (for example, from data after
calibration or calculation of the shower energy). Thus, the information needed
to process user requests is collected in the MDC service.</p>
      <p>It is important to note that all services in APPDS are built as microservices
[25] and have a well{de ned REST API [26]. Some services are running in Docker
containers [27].</p>
      <p>A more detailed description of the aggregation service and the metadata
catalogue service can be found in the papers by M-D.Nguyen [28] and I.Bychkov [29]
in these proceedings.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Status</title>
      <p>Currently a prototype of APPDS was deployed in Skobeltsyn Institute of
Nuclear Physics, Lomonosov Moscow State University. The prototype consists of
two local storages interconnected via a local network for modelling distributed
storage, an aggregation service and a metadata service based on TimescaleDB.
The next version of the system will also include KCDC [30] storage at KIT and
storage at Irkutsk State University.</p>
      <p>Most of the components of the system are written in Python. As the
rsttime example of the production use of the system, users of the KASCADE and
TAIGA/TUNKA collaborations will gain access to the data of these experiments,
as well as the Monte Carlo simulation data. It should be mentioned that the
system is developed for broad general use and is not limited to astrophysics
applications.
14. W.D.Apel and etc. The KASCADE-Grande experiment. Nuclear
Instruments and Methods in Physics Research, Section A, 620(2010), pp.202{216,
https://doi.org/10.1016/j.nima.2010.03.147
15. TAIGA. https://taiga-experiment.info/. Last accessed 24 Jan 2019
16. Budnev, N. and etc. The TAIGA experiment: From cosmic-ray to gamma-ray
astronomy in the Tunka valley. Nuclear Instruments and Methods in Physics Research.</p>
      <p>Section A, 845(2017), pp.330{333, https://doi.org/10.1016/j.nima.2016.06.041
17. Bychkov, I., et al.: Russian{German Astroparticle Data Life Cycle Initiative. Data,
4(4), 56 (2018). DOI: 10.3390/data3040056.
18. Blomer, J. , Buncic, P. , Ganis, G. , Hardi, N. , Meusel, R., and Popescu, R.:
New directions in the CernVM le system. In. 22nd International Conference on
Computing in High Energy and Nuclear Physics (CHEP2016), 10{14 October 2016,
San Francisco, USA. Journal of Physics: Conf. Series, 898, 062031 (2017)
19. MariaDB home page. https://mariadb.org/. Last accessed Jan. 24, 2019
20. Freedman, M.J.: TimescaleDB: Re-engineering PostgreSQL as a time-series
database. https://www.percona.com/live/18/sites/default/
les/slides/TimescaleDBPercona-2018-main.pdf. Last accessed 24 Jan 2019
21. Yang,Ch., et. al.: AstroServ: Distributed Database for Serving
Large-Scale Full Life-Cycle Astronomical Data. ArXiv: 1811.10861.
https://arxiv.org/pdf/1811.10861. Last accessed 24 Jan 2019.
22. Stefancova, E.: Evaluation of the TimescaleDB PostgreSQL Time
Series extension. https://cds.cern.ch/record/2638621/
les/evaluation-timescaledbpostgresql.pdf. Last accessed 24 Jan 2019
23. Kaitai Struct. http://doc.kaitai.io/. Last accessed 24 Jan 2019
24. Bychkov, I. et al.: Using binary le format description languages for
documenting, parsing and verifying raw data in TAIGA experiment. In. International
Conference "Distributed Computing and Grid-technologies in Science and Education"
2018 (GRID'2018), Dubna, Russia, September 10-14, 2018. CEUR Workshop
Proceedings, 2267, 563-567 (2018).
25. Sill, A.: The Design and Architecture of Microservices. IEEE Cloud Computing,
3(5), 76-80 (2016)
26. Fielding, R. Th.: Architectural Styles and the
Design of Network-based Software Architectures.
https://www.ics.uci.edu/~ elding/pubs/dissertation/ elding dissertation.pdf,
PhD Thesis (2000). Last accessed 24 Jan 2019
27. Docker home page. https://www.docker.com/. Last accessed 24 Jan 2019
28. Nguyen, M.-D. and etc. Data aggregation in the Astroparticle Physics Distributed</p>
      <p>Data Storage. In Proc. of 3-d Int Workshop DLC-2019 (this book).
29. Bychkov, I. and etc. Metadata extraction from raw astroparticle data of TAIGA
experiment. In Proc. of 3-d Int Workshop DLC-2019 (this book).
30. KASCADE Cosmic Ray Data Centre (KCDC). https://kcdc.ikp.kit.edu/. Last
accessed 24 Jan 2019</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Large</given-names>
            <surname>Synoptic</surname>
          </string-name>
          Survey Telescope. https://www.lsst.org/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kahn</surname>
            ,
            <given-names>S. M. Project</given-names>
          </string-name>
          <string-name>
            <surname>Status</surname>
          </string-name>
          . https://project.lsst.org/groups/sac/sites/lsst.org.groups.sac/ les/Kahn projectstatus.p
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>3. MAGIC. https://doi.org/10.15161/oar.it/1446204371.89</mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Ricoa</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <article-title>for the MAGIC Collaboration: Overview of MAGIC results</article-title>
          .
          <source>In. 37th International Conference on High Energy Physics, 2-9 July 2014 Valencia, Spain, Nuclear and Particle Physics Proceedings</source>
          ,
          <volume>273</volume>
          {
          <fpage>275</fpage>
          ,
          <fpage>328</fpage>
          -
          <lpage>333</lpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Cherenkov</given-names>
            <surname>Telescope</surname>
          </string-name>
          <article-title>Array. Exploring the Universe at the Highest Energies</article-title>
          . https://www.cta-observatory.org/.
          <source>Last accessed 24 Jan 2019</source>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>6. The Cherenkov Telescope Array Consortium: Science with the Cherenkov Telescope Array</article-title>
          . Arxiv:
          <volume>1709</volume>
          .07997, https://arxiv.org/pdf/1709.07997.
          <source>Last accessed 24 Jan 2019</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. VERITAS. https://veritas.sao.arizona.edu/.
          <source>Last accessed 24 Jan 2019</source>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. HESS, https://www.mpi-hd.mpg.de/hfm/HESS/.
          <source>Last accessed 24 Jan 2019</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Worldwide</surname>
            <given-names>LCH</given-names>
          </string-name>
          <article-title>Computing GRID</article-title>
          . http://wlcg.web.cern.ch/
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Franckowiak</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Multimessenger Astronomy with Neutrinos</article-title>
          .
          <source>J. Phys.: Conf. Ser.</source>
          ,
          <volume>888</volume>
          ,
          <issue>012009</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Voruganti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <source>Deil1</source>
          , Ch. ,
          <string-name>
            <surname>Donath</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>King</surname>
          </string-name>
          , J.:
          <article-title>gamma-sky.net: Portal to the Gamma-Ray Sky</article-title>
          . Arxiv:
          <volume>1709</volume>
          .04217, https://arxiv.org/pdf/1709.04217.
          <source>Last accessed 24 Jan 2019</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Wagner</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          : Gamma {
          <article-title>Ray Astronomy in the 2020s</article-title>
          . https://www.eso.org/sci/meetings/2015/eso2020/eso2015 Gamma Ray Wagner.pdf.
          <source>Last accessed Jan</source>
          .
          <volume>24</volume>
          <fpage>2019</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <article-title>HDF5 Single{writer/Multiple{reader User's Guide</article-title>
          . https://support.hdfgroup.org/HDF5/docNewFeatures/SWMR/HDF5 SWMR Users Guide.pdf.
          <source>Last accessed June 06</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>