| <!-- |
| ▄▄▄ ██▓███ ▄▄▄ ▄████▄ ██░ ██ ▓█████ ██▓ ▄████ ███▄ █ ██▓▄▄▄█████▓▓█████ |
| ▒████▄ ▓██░ ██▒▒████▄ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▓██▒ ██▒ ▀█▒ ██ ▀█ █ ▓██▒▓ ██▒ ▓▒▓█ ▀ |
| ▒██ ▀█▄ ▓██░ ██▓▒▒██ ▀█▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒██▒▒██░▄▄▄░▓██ ▀█ ██▒▒██▒▒ ▓██░ ▒░▒███ |
| ░██▄▄▄▄██ ▒██▄█▓▒ ▒░██▄▄▄▄██ ▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ░██░░▓█ ██▓▓██▒ ▐▌██▒░██░░ ▓██▓ ░ ▒▓█ ▄ |
| ▓█ ▓██▒▒██▒ ░ ░ ▓█ ▓██▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒ ░██░░▒▓███▀▒▒██░ ▓██░░██░ ▒██▒ ░ ░▒████▒ |
| ▒▒ ▓▒█░▒▓▒░ ░ ░ ▒▒ ▓▒█░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░ ░▓ ░▒ ▒ ░ ▒░ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░ |
| ▒ ▒▒ ░░▒ ░ ▒ ▒▒ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒░ ▒ ░ ░ ░ ░ ░ |
| ░ ▒ ░░ ░ ▒ ░ ░ ░░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ |
| ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ |
| --> |
| |
| <!-- |
| 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> |
| <meta charset="utf-8"> |
| |
| <link rel="canonical" href="https://ignite.apache.org/use-cases/in-memory-cache.html"/> |
| <!--#include virtual="/includes/scriptshead.html" --> |
| |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| <meta name="description" |
| content="Apache Ignite as an In-Memory Cache accelerates and scales your databases, services, and APIs |
| with support of ANSI SQL, ACID transactions, co-located compute, and machine learning."/> |
| |
| <title>In-Memory Cache - Apache Ignite</title> |
| |
| <!--#include virtual="/includes/styles.html" --> |
| |
| |
| </head> |
| <body> |
| <!--#include virtual="/includes/header.html" --> |
| <article> |
| <header><div class="container"> |
| <h1><strong>In-Memory Cache</strong> With Apache Ignite</h1> |
| </div></header> |
| <div class="container"> |
| <p> |
| Apache Ignite can be used as a distributed, in-memory cache that you can query with SQL and update atomically |
| by using ACID transactions and on which you can execute custom computations that are written in languages |
| such as Java, C#, and C++. Ignite provides all the components that are required to speed applications, |
| databases, and microservices. |
| </p> |
| |
| <img class="img-fluid diagram-right" src="/images/svg-diagrams/apps_acceleration.svg" alt="In-Memory Cache With Apache Ignite" width="555" height="324" /> |
| |
| <p> |
| An Apache Ignite cluster can span multiple nodes, allowing your applications to use all the memory and CPU |
| resources of a distributed environment. Your applications can interact with the cluster as they interact |
| with a standard cache, by using simple key-value requests. Also, for more advanced operations, you can |
| run distributed SQL queries that join and group datasets. If strong consistency is required, you can |
| execute multi-node and cross-cache ACID transactions in both pessimistic and optimistic modes. |
| Additionally, if an application runs compute or data-intensive logic, you can minimize data shuffling |
| and network utilization by running co-located computations that are written in a contemporary programming |
| language. |
| |
| </p> |
| |
| <p> |
| There are two primary deployment strategies for Ignite as an in-memory cache— cache-aside deployment and |
| read-through/write-through caching. We will review both strategies. |
| </p> |
| |
| |
| <h2>Cache-Aside Deployment</h2> |
| <p> |
| With the cache-aside deployment strategy, a cache is deployed separately from the primary data store and might |
| not even know that the primary store exists. An application or change-data-capture (CDC) process becomes |
| responsible for data synchronization between the two storage locations. For example, if a record is |
| updated in the primary data store, then its new value needs to be replicated to the cache. |
| </p> |
| <p> |
| This strategy works well when the cached data is relatively static (not updated frequently) or when temporary |
| data lag is allowed between the primary store and the cache. It's usually assumed that changes will be |
| fully replicated eventually and, thus, the cache and the primary store will become consistent. |
| </p> |
| <p> |
| When Apache Ignite is deployed in a cache-aside configuration, its native persistence can be used as a disk |
| store for Ignite datasets. Native persistence allows for elimination of the time-consuming cache warm-up |
| step. Furthermore, because native persistence maintains a full copy of data on disk, you can cache a |
| subset of records in memory. If a required data record is missing from memory, then Ignite reads the |
| record from the disk automatically, regardless of which API you use—whether SQL, key-value, or scan |
| queries. |
| </p> |
| |
| <h2>Read-Through/Write-Through Caching</h2> |
| <p> |
| The read-through/write-through caching strategy can be classified as an in-memory, data-grid type of deployment. |
| When Apache Ignite is deployed as a data grid, the application layer begins to treat Ignite as the |
| primary store. As applications write to and read from the data grid, Ignite ensures that all underlying |
| external databases stay updated and are consistent with the in-memory data. |
| </p> |
| |
| <p> |
| This strategy is recommended for architectures that need to accelerate disk-based databases or to create a |
| shared caching layer across various data sources. Ignite integrates with many databases out-of-the-box and, |
| in write-through or write-behind mode, can synchronize all changes to the databases. The strategy also applies |
| to ACID transactions: Ignite will coordinate and commit a transaction across its in-memory cluster as well as |
| to a relational database. |
| </p> |
| <p> |
| Read-through capability implies that, if a record is missing from memory, a cache can read the data from an |
| external database. Ignite fully supports this capability for key-value APIs. However, when you use |
| Ignite SQL, you must preload the dataset into memory—because Ignite SQL can query on-disk data only |
| if the data is stored in native persistence. |
| </p> |
| |
| |
| <div class="jumbotron jumbotron-fluid"> |
| <div class="container"> |
| <div class="display-6 title">Learn More</div> |
| <hr class="my-4"> |
| <div class="row"> |
| <div class="col-sm-6"> |
| <ul> |
| <li> |
| <p><a href="/features/sql.html"> |
| Distributed SQL <i class="fas fa-angle-double-right"></i> |
| </a></p> |
| </li> |
| <li> |
| <p><a href="/features/collocated-processing.html"> |
| Co-located Processing <i class="fas fa-angle-double-right"></i> |
| </a></p> |
| </li> |
| <li><p><a href="/features/acid-transactions.html"> |
| ACID Transactions <i class="fas fa-angle-double-right"></i> |
| </a></p></li> |
| <li><p><a href="/arch/native-persistence.html"> |
| Native Persistence <i class="fas fa-angle-double-right"></i> |
| </a></p></li> |
| </ul> |
| </div> |
| <div class="col-sm-6"> |
| <ul> |
| <li> |
| <p><a href="/features/machinelearning.html"> |
| Machine and Deep Learning <i class="fas fa-angle-double-right"></i> |
| </a></p> |
| </li> |
| <li> |
| <p><a href="/use-cases/in-memory-data-grid.html"> |
| Ignite as an In-Memory Data Grid <i class="fas fa-angle-double-right"></i> |
| </a></p> |
| </li> |
| <li><p><a href="/use-cases/in-memory-database.html"> |
| Ignite as an In-Memory Database <i class="fas fa-angle-double-right"></i> |
| </a></p></li> |
| <li><p><a href="/use-cases/digital-integration-hub.html"> |
| Ignite as a Digital Integration Hub <i class="fas fa-angle-double-right"></i> |
| </a></p></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| |
| </div> |
| </article> |
| <!--#include virtual="/includes/footer.html" --> |
| |
| <!--#include virtual="/includes/scripts.html" --> |
| </body> |
| </html> |