-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbdb.html
41 lines (38 loc) · 11.2 KB
/
bdb.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 20. Oracle Berkeley DB Java Edition</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="JanusGraph Documentation"><link rel="up" href="storage-backends.html" title="Part III. Storage Backends"><link rel="prev" href="bigtable.html" title="Chapter 19. Google Cloud Bigtable"><link rel="next" href="inmemorystorage.html" title="Chapter 21. InMemory Storage Backend"><script xmlns:d="http://docbook.org/ns/docbook" type="text/javascript" src="js/jquery/jquery-1.11.0.js"></script><script xmlns:d="http://docbook.org/ns/docbook" type="text/javascript" src="js/jquery/jquery-migrate-1.2.1.min.js"></script><link xmlns:d="http://docbook.org/ns/docbook" rel="stylesheet" id="inline-blob-janusgraph-docs-specific" href="css/docs.css" type="text/css" media="all"><link xmlns:d="http://docbook.org/ns/docbook" rel="apple-touch-icon" type="image/png" href="images/janusgraph-logomark.png"><script xmlns:d="http://docbook.org/ns/docbook" type="text/javascript">
WebFontConfig = {
google: {
families: [
"Lato:400,400italic,700,700italic:latin,greek-ext,cyrillic,latin-ext,greek,cyrillic-ext,vietnamese",
"Open+Sans:400,400italic,700,700italic:latin,greek-ext,cyrillic,latin-ext,greek,cyrillic-ext,vietnamese",
"Antic+Slab:400,400italic,700,700italic:latin,greek-ext,cyrillic,latin-ext,greek,cyrillic-ext,vietnamese"
]
}
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script></head><body xmlns:d="http://docbook.org/ns/docbook" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div id="wrapper"><div class="header-wrapper"><header id="header"><ul class="header-list"><li class="header-item"><a href="http://janusgraph.org"><img src="images/janusgraph-logo.png" alt="JanusGraph" class="normal_logo"></a></li><li class="header-item-right"><a href="https://github.com/JanusGraph/janusgraph/releases">Download JanusGraph</a></li><li class="header-item-right dropdown"><a href="https://docs.janusgraph.org/latest/doc-versions.html">Other Doc Versions</a><div class="dropdown-content"><a href="https://docs.janusgraph.org/latest/index.html">Latest</a><a href="https://docs.janusgraph.org/0.3.0/index.html">Version 0.3.0</a><a href="https://docs.janusgraph.org/0.2.2/index.html">Version 0.2.2</a><a href="https://docs.janusgraph.org/0.2.1/index.html">Version 0.2.1</a><a href="https://docs.janusgraph.org/0.2.0/index.html">Version 0.2.0</a><a href="https://docs.janusgraph.org/0.1.1/index.html">Version 0.1.1</a><a href="https://docs.janusgraph.org/0.1.0/index.html">Version 0.1.0</a></div></li><li class="header-item-right"><a href="index.html">Documentation (0.2.2)</a></li></ul></header></div><div id="main" class="clearfix width-100"><div class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">JanusGraph Documentation</a></span> > <span class="breadcrumb-link"><a href="storage-backends.html">Storage Backends</a></span> > <span class="breadcrumb-node">Oracle Berkeley DB Java Edition</span></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="bdb"></a>Chapter 20. Oracle Berkeley DB Java Edition</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="bdb.html#_berkeleydb_je_setup">20.1. BerkeleyDB JE Setup</a></span></dt><dt><span class="section"><a href="bdb.html#_berkeleydb_specific_configuration">20.2. BerkeleyDB Specific Configuration</a></span></dt><dt><span class="section"><a href="bdb.html#_ideal_use_case">20.3. Ideal Use Case</a></span></dt><dt><span class="section"><a href="bdb.html#_global_graph_operations_3">20.4. Global Graph Operations</a></span></dt></dl></div><div class="blockquote"><table border="0" class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote"><tr><td width="10%" valign="top"> </td><td width="80%" valign="top"><p>Oracle Berkeley DB Java Edition is an open source, embeddable, transactional
storage engine written entirely in Java. It takes full advantage of the Java
environment to simplify development and deployment. The architecture of
Oracle Berkeley DB Java Edition supports very high performance and concurrency
for both read-intensive and write-intensive workloads.</p></td><td width="10%" valign="top"> </td></tr><tr><td width="10%" valign="top"> </td><td colspan="2" align="right" valign="top">--<span class="attribution">
<a class="link" href="http://www.oracle.com/technetwork/database/berkeleydb/overview/index-093405.html" target="_top">Oracle Berkeley DB Java Edition Homepage</a>
</span></td></tr></table></div><p>The <a class="link" href="http://www.oracle.com/technetwork/database/berkeleydb/overview/index-093405.html" target="_top">Oracle Berkeley DB Java Edition</a> storage backend runs in the same JVM as JanusGraph and provides local persistence on a single machine. Hence, the BerkeleyDB storage backend requires that all of the graph data fits on the local disk and all of the frequently accessed graph elements fit into main memory. This imposes a practical limitation of graphs with 10-100s million vertices on commodity hardware. However, for graphs of that size the BerkeleyDB storage backend exhibits high performance because all data can be accessed locally within the same JVM.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_berkeleydb_je_setup"></a>20.1. BerkeleyDB JE Setup</h2></div></div></div><p>Since BerkeleyDB runs in the same JVM as JanusGraph, connecting the two only requires a simple configuration and no additional setup:</p><pre class="programlisting">JanusGraph g = JanusGraphFactory.build().
set(<span class="hl-string">"storage.backend"</span>, <span class="hl-string">"berkeleyje"</span>).
set(<span class="hl-string">"storage.directory"</span>, <span class="hl-string">"/data/graph"</span>).
open();</pre><p>In the Gremlin Console, you can not define the type of the variables <code class="literal">conf</code> and <code class="literal">g</code>. Therefore, simply leave off the type declaration.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_berkeleydb_specific_configuration"></a>20.2. BerkeleyDB Specific Configuration</h2></div></div></div><p>Refer to <a class="xref" href="config-ref.html" title="Chapter 14. Configuration Reference">Chapter 14, <i>Configuration Reference</i></a> for a complete listing of all BerkeleyDB specific configuration options in addition to the general JanusGraph configuration options.</p><p>When configuring BerkeleyDB it is recommended to consider the following BerkeleyDB specific configuration options:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span class="strong"><strong>transactions</strong></span>: Enables transactions and detects conflicting database operations. <span class="strong"><strong>CAUTION:</strong></span> While disabling transactions can lead to better performance it can cause to inconsistencies and even corrupt the database if multiple JanusGraph instances interact with the same instance of BerkeleyDB.</li><li class="listitem"><span class="strong"><strong>cache-percentage</strong></span>: The percentage of JVM heap space (configured via -Xmx) to be allocated to BerkeleyDB for its cache. Try to give BerkeleyDB as much space as possible without causing memory problems for JanusGraph. For instance, if JanusGraph only runs short transactions, use a value of 80 or higher.</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_ideal_use_case"></a>20.3. Ideal Use Case</h2></div></div></div><p>The BerkeleyDB storage backend is best suited for small to medium size graphs with up to 100 million vertices on commodity hardware. For graphs of that size, it will likely deliver higher performance than the distributed storage backends. Note, that BerkeleyDB is also limited in the number of concurrent requests it can handle efficiently because it runs on a single machine. Hence, it is not well suited for applications with many concurrent users mutating the graph, even if that graph is small to medium size.</p><p>Since BerkeleyDB runs in the same JVM as JanusGraph, this storage backend is ideally suited for unit testing of application code using JanusGraph.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_global_graph_operations_3"></a>20.4. Global Graph Operations</h2></div></div></div><p>JanusGraph backed by BerkeleyDB supports global graph operations such as iterating over all vertices or edges. However, note that such operations need to scan the entire database which can require a significant amount of time for larger graphs.</p><p>In order to not run out of memory, it is advised to disable transactions (<code class="literal">storage.transactions=false</code>) when iterating over large graphs. Having transactions enabled requires BerkeleyDB to acquire read locks on the data it is reading. When iterating over the entire graph, these read locks can easily require more memory than is available.</p></div></div></div><div class="clearer"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bigtable.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="storage-backends.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="inmemorystorage.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 19. Google Cloud Bigtable </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 21. InMemory Storage Backend</td></tr></table></div><div class="footer-wrapper"><footer id="footer"><div class="copyright">
Copyright © 2017 JanusGraph Authors. All rights reserved.<br>
The Linux Foundation has registered trademarks and uses trademarks. For a list of<br>
trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage">Trademark Usage</a> page.<br>
Cassandra, Groovy, HBase, Hadoop, Lucene, Solr, and TinkerPop are trademarks of the Apache Software Foundation.<br>
Berkeley DB and Berkeley DB Java Edition are trademarks of Oracle.<br>
Documentation generated with <a href="http://www.methods.co.nz/asciidoc/">AsciiDoc</a>, <a href="http://asciidoctor.org/">AsciiDoctor</a>, <a href="http://docbook.sourceforge.net/">DocBook</a>, and <a href="http://saxon.sourceforge.net/">Saxon</a>.
</div></footer></div></div></body></html>