<!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>CM-Well: A Data Warehouse for Linked Data</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dan Bennett</string-name>
          <email>dan.bennett@tr.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jason Engelbrecht</string-name>
          <email>jason.engelbrecht@tr.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dudi Landau</string-name>
          <email>dudi.landau@tr.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Thomson Reuters</institution>
          ,
          <addr-line>30 South Colonnade</addr-line>
          ,
          <institution>Canary Wharf</institution>
          ,
          <addr-line>London, E14 5EP</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Thomson Reuters</institution>
          ,
          <addr-line>610 Opperman Drive, Eagan, MN, 55123</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Thomson Reuters</institution>
          ,
          <addr-line>94 Derech Em Hamoshavot, Petach Tikva 49527</addr-line>
          ,
          <country country="IL">Israel</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper we present CM-Well, a clustered, horizontally scalable data store for linked data. We discuss the key architectural principals of the system and introduce distinguishing features. Thomson Reuters has been running CM-Well in production for over two years, across multiple data centers. The system provides data, via API, to a number of our online products.</p>
      </abstract>
      <kwd-group>
        <kwd>Data Warehousing</kwd>
        <kwd>Linked Data</kwd>
        <kwd>SPARQL</kwd>
        <kwd>Distributed</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>CM-Well is based on a clustered architecture (Fig 1). Philosophically, the
application is similar to a Linux distribution in that it consists of a well tested</p>
      <sec id="sec-1-1">
        <title>4 https://en.wikipedia.org/wiki/Data mart</title>
        <p>5 https://github.com/thomsonreuters/CM-Well
integration of a number of open source packages including Akka6, Cassandra7,
ElasticSearch8, Jena9 and Kafka10.</p>
        <p>Each node in the cluster has the same hardware con guration and runs a
set of processes with no single point of failure. Singleton control roles are moved
between nodes on failure, implemented on a \self healing" principle. In a typical
deployment, the cluster is fronted by an HTTP load balancer such as haproxy11.
The majority of the application is written in the Scala language.
Individual triples are grouped by subject to form an \Infoton": the basic unit of
storage. These information objects are stored in Cassandra and invert indexed
by ElasticSearch. While writes require a full rewrite of the infoton, reads by
subject can be served from one node and return all triples for the subject. This
grouping of triples forms a fundamental design tradeo between read and write
performance but has been found to o er good horizontal scale performance: on
our production cluster, API response time for all information on a subject is
around 10ms.</p>
      </sec>
      <sec id="sec-1-2">
        <title>6 http://akka.io/</title>
        <p>7 http://cassandra.apache.org/
8 https://github.com/elastic/elasticsearch
9 https://jena.apache.org
10 https://kafka.apache.org
11 http://www.haproxy.org</p>
        <p>Every Infoton write is treated as immutable; this approach permits
eventually consistent replication across distributed data centers with secondary
instances subscribing to a change log and applying writes locally. Depending on
read/write tradeo , all slaves can replicate from a single master or slaves can
form a branching chain.
2.2</p>
        <sec id="sec-1-2-1">
          <title>Deployment</title>
          <p>While we have found CM-Well capable of balancing read and write tra c, in
most applications consumers wrap CM-Well with a data-mart implemented to
meet the speci c needs of their application. Depending on use case, this mart
might be as simple as a caching reverse HTTP proxy to reduce read load or
deployment of a separate search cluster which structures data to meet required
performance targets.
3</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Key features</title>
      <p>One of the motivating factors for the development of CM-Well was our perception
that key requirements were not met by other tools; either open or closed source.
Integrating our own solution permitted us to focus on key di erentiating features.
3.1</p>
      <sec id="sec-2-1">
        <title>Subscription by query</title>
        <p>The API surface for CM-Well includes a REST based API for boolean querying
by predicate. Any query can be used as a (server-side stateless) subscription;
returning a time ordered sequence of Infotons matching the query.</p>
        <p>Each stream API call returns a continuation token in the HTTP response
headers. When passed in a subsequent request, this token is used as a
point-intime marker with the stream continuing from the end of the previous response.
Additionally, an optional parameter will instruct CM-Well to include tombstones
for deleted data, e ectively treating each query as a FIFO queue of content
events.</p>
        <p>This feature is key to the `information in motion' design of CM-Well
permitting downstream stores to subscribe to relevant subsets of data de ned by
query.
3.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>SPARQL Support</title>
        <p>Currently, CM-Well supports two types of SPARQL query: sub and full graph.
When querying, the sub-graph solution consists of two sub-steps: 1) one or more
queries, routed to ElasticSearch, are rst used to select a candidate set of nodes
from our data; 2) Such candidate nodes are then loaded to a Jena triple store
on a single machine for SPARQL execution. We are also experimenting with a
second form which builds an execution plan for input ElasticSearch queries based
on data statistics relevant to the SPARQL query. Both solutions are limited to
the underlying characteristics of ElasticSearch, such maximum results window
of 10,000. Hence, wide ranging queries can miss triples of relevance.</p>
      </sec>
      <sec id="sec-2-3">
        <title>Triggers</title>
        <p>Much of the data we load to CM-Well is highly normalized and often requires
simpli cation to ease downstream consumption. Our trigger mechanism permits
a sensor to be created, based on a query, which on new data invokes a SPARQL
CONSTRUCT statement. This then generates new predicates.</p>
        <p>For example, in our organization ontology, company names are modeled as
their own type &lt;OrganizationName&gt;. Each name includes date based \from"
and \to" predicates to model company name changes over time. While this
temporal model is powerful, it complicates the simple retrieval of a company,
since one must traverse the set of attached names. A trigger is used to create
(or update) a \ attened" name predicate on the organization entity on update
of related organization name entity.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Demonstration plan &amp; Conclusions</title>
      <p>In this paper we have brie y presented our approach to managing &amp; distributing
large volumes of linked data using CM-Well. We believe the application presents
a cost e ective way of building and distributing linked datasets and are pleased
to be able to share with the wider community via open source: without which
CM-Well wouldn't be possible.</p>
      <p>A video demo to support this paper can be found on Vimeo12: the demo shows
a subset of the data from the permid.org dataset, update via API, immutable
history, retrieval by API and our implementation of \full-graph" SPARQL.
Acknowledgments. The authors would like to acknowledge the e orts of the
entire CM-Well development team, both current and historical, in addition to
Thomson Reuters for supporting the open sourcing of CM-Well.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Dayarathna</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Herath</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dewmini</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mettananda</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nandasiri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jayasena</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Suzumura</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Introducing acacia-rdf: An x10-based scalable distributed rdf graph database engine</article-title>
          .
          <source>In: 2016 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW)</source>
          . pp.
          <volume>1024</volume>
          {
          <issue>1032</issue>
          (May
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Peng</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zou</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          , Ozsu, M.T.,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Processing sparql queries over distributed rdf graphs</article-title>
          .
          <source>The VLDB Journal</source>
          <volume>25</volume>
          (
          <issue>2</issue>
          ),
          <volume>243</volume>
          {268 (Apr
          <year>2016</year>
          ), https:// doi.org/10.1007/s00778-015-0415-0
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Punnoose</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crainiceanu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rapp</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Sparql in the cloud using rya</article-title>
          .
          <source>Information Systems</source>
          <volume>48</volume>
          ,
          <fpage>181</fpage>
          {
          <fpage>195</fpage>
          (
          <year>2015</year>
          ), http://www.sciencedirect.com/science/article/ pii/S0306437913000975
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Um</surname>
            ,
            <given-names>J.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kim</surname>
            ,
            <given-names>T.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jeong</surname>
            ,
            <given-names>C.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Song</surname>
            ,
            <given-names>S.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jung</surname>
          </string-name>
          , H.:
          <article-title>Distributed rdf store for e cient searching billions of triples based on hadoop</article-title>
          .
          <source>The Journal of Supercomputing</source>
          <volume>72</volume>
          (
          <issue>5</issue>
          ),
          <year>1825</year>
          {1840 (May
          <year>2016</year>
          ), https://doi.org/10.1007/ s11227-016-1670-6
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>