blob: 257b6fd23cb6de05d2892930a3a6864828fdfeb8 [file] [log] [blame]
<!--
▄▄▄ ██▓███ ▄▄▄ ▄████▄ ██░ ██ ▓█████ ██▓ ▄████ ███▄ █ ██▓▄▄▄█████▓▓█████
▒████▄ ▓██░ ██▒▒████▄ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▓██▒ ██▒ ▀█▒ ██ ▀█ █ ▓██▒▓ ██▒ ▓▒▓█ ▀
▒██ ▀█▄ ▓██░ ██▓▒▒██ ▀█▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒██▒▒██░▄▄▄░▓██ ▀█ ██▒▒██▒▒ ▓██░ ▒░▒███
░██▄▄▄▄██ ▒██▄█▓▒ ▒░██▄▄▄▄██ ▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ░██░░▓█ ██▓▓██▒ ▐▌██▒░██░░ ▓██▓ ░ ▒▓█ ▄
▓█ ▓██▒▒██▒ ░ ░ ▓█ ▓██▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒ ░██░░▒▓███▀▒▒██░ ▓██░░██░ ▒██▒ ░ ░▒████▒
▒▒ ▓▒█░▒▓▒░ ░ ░ ▒▒ ▓▒█░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░ ░▓ ░▒ ▒ ░ ▒░ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░
▒ ▒▒ ░░▒ ░ ▒ ▒▒ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒░ ▒ ░ ░ ░ ░ ░
░ ▒ ░░ ░ ▒ ░ ░ ░░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
-->
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="canonical" href="https://ignite.apache.org/arch/memorycentric.html"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<title>Memory-Centric Storage - Apache Ignite</title>
<meta name="description"
content="Apache Ignite memory-centric storage uses both memory and disk as active storage tiers. Speed of
memory with the consistency of disk-based databases and no need for memory warm-ups on restarts."/>
<!--#include virtual="/includes/styles.html" -->
<!--#include virtual="/includes/sh.html" -->
</head>
<body>
<div id="wrapper">
<!--#include virtual="/includes/header.html" -->
<main id="main" role="main" class="container">
<section id="memory-centric" class="page-section">
<h1 class="first">Memory-Centric Storage</h1>
<div class="col-sm-12 col-md-12 col-xs-12" style="padding:0 0 20px 0;">
<div class="col-sm-6 col-md-6 col-xs-12" style="padding-left:0; padding-right:0">
<p>
Apache Ignite is designed to work with both memory and disk as active storage tiers.
Ignite storage is classified as a memory-centric one since most of the architectural decisions
favor specificities of the memory tier that is always at use and cannot be disabled.
The disk tier is optional with the support of two options -- you can persist data in an
external database or keep it in the Ignite native persistence.
</p>
</div>
<div class="col-sm-6 col-md-6 col-xs-12" style="padding-right:0">
<img class="img-responsive" src="/images/durable_memory.png" width="440px" style="float: right;"/>
</div>
</div>
<p>
Ignite takes full control of its memory tier by allocating and managing off-heap regions. Each Ignite
server node allocates memory regions during bootstrap, splits the regions into pages, and keeps data
records with indexes there. Java heap is used to keep temporary objects such as queries results sets,
metrics samples, objects generated by your application code. All these objects are garbage collected
eventually.
</p>
<p>
If you select the native persistence as the disk tier, then most of the processing will still
take place in memory on cached data, but, with a full copy stored on disk. If any record is
missing in memory, Ignite will read it from disk, allowing you to persist much larger data sets
than you can cache in memory. That also eliminates the need for time-consuming memory warm-ups
on restarts. As soon as your cluster reconnects after a restart, Ignite will serve most of the
data from disk warming the memory tier up in the background.
</p>
<div class="page-heading" id="storage-usage-modes">
Memory-Centric Storage Usage Modes
<a href="/arch/memorycentric.html#storage-usage-modes"><i class="fa fa-anchor"></i></a>
</div>
<p>
Below you can see primary modes for memory-centric storage usage and configuration:
</p>
<table class="formatted" name="Deployment Options Features">
<thead>
<tr>
<th width="35%" class="left">Mode</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="left">In-Memory</td>
<td>
<p>
The whole data set is available in memory only. In order to survive node failures, it is
recommended to keep at least one backup copy of the data across the cluster.
</p>
<p>
<strong>Use cases</strong>: general in-memory caching, high-performance
computing, web-session caching, real-time processing of continuous data streams.
</p>
</td>
</tr>
<tr>
<td class="left">In-Memory + External Database</td>
<td>
<p>
Ignite is deployed as a distributed caching layer on top of an existing external database.
This mode is for the acceleration of disk-based databases and your services with APIs that
interact with them.
</p>
<p>
<strong>Use cases</strong>: acceleration of services and APIs with write-through/behind
capability, to an external database (aka. in-memory data grid).
</p>
</td>
</tr>
<tr>
<td class="left">In-Memory Cache + Native Persistence</td>
<td>
<p>
100% of data is persisted to disk, and the same or smaller amount is cached in memory.
The more data is cached, the faster is the performance. The disk serves as the primary
storage that survives any cluster failures and restarts. No need for memory warm-ups on
restarts as long as Ignite can serve data from disk.
</p>
<p>
<strong>Use cases</strong>: Ignite as an in-memory database or digital integration hub
with the active persistence layer.
</p>
</td>
</tr>
</tbody>
</table>
<h2 style="padding-top: 10px;" id="partitioning">
Partitioning & Replication
<a href="/arch/memorycentric.html#partitioning"><i class="fa fa-anchor"></i></a>
</h2>
<p>
Depending on the configuration, Ignite can both partition or replicate data across its memory-centric
storage. With the replicated mode, each cluster node keeps a full copy of the data that is advantageous
for frequently accessed dictionaries. As for the partitioned mode, Ignite spreads the data across all
the cluster nodes evenly, allowing to store much more than a single machine can fit in.
</p>
<h2 style="padding-top: 10px;" id="durability">
Durability and Consistency
<a href="/arch/memorycentric.html#durability"><i class="fa fa-anchor"></i></a>
</h2>
<p>
Ignite provides strong ACID durability guarantees to the data:
</p>
<ul class="page-list" style="margin-bottom: 20px;">
<li>Committed transactions always survive failures.</li>
<li>
The cluster can always be recovered to the latest successfully committed transaction.
</li>
</ul>
<h2 style="padding-top: 10px;" id="write-ahead-log">
Write-Ahead Logging and Checkpointing
<a href="/arch/memorycentric.html#write-ahead-log"><i class="fa fa-anchor"></i></a>
</h2>
<p>
If Ignite native persistence is selected as a disk tier, then every time a record is updated in memory,
the change is added to the write-ahead log (WAL). The purpose of the WAL is to propagate updates to
disk in the fastest way possible and provide a consistent recovery mechanism that supports full cluster
failures.
</p>
<p>
As WAL grows, it periodically gets checkpointed to the main storage. Checkpointing is the process of
copying dirty pages from the memory tier to the partition files on disk. A dirty page is a page that was
updated in memory, was appended to WAL, but was not written to a respective partition file on disk yet.
</p>
<div class="page-heading">Learn More</div>
<p>
<a href="/arch/persistence.html">
<b>Native Persistence <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
<p>
<a href="/features/datagrid.html">
<b>Ignite as an In-Memory Data Grid <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
<p>
<a href="/use-cases/in-memory-database.html">
<b>Ignite as an In-Memory Database <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
<p>
<a href="/use-cases/dih.html">
<b>Ignite as a Digital Integration Hub <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
<p>
<a href="/use-cases/hpc.html">
<b>Ignite for High Performance Computing <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
</section>
</main>
<!--#include virtual="/includes/footer.html" -->
</div>
<!--#include virtual="/includes/scripts.html" -->
</body>
</html>