| extend ../_components/base.pug |
| |
| block pagetitle |
| title Native Persistence - Apache Ignite |
| meta(name="description", content="Apache Ignite native persistence is a distributed, ACID, and SQL-compliant disk-based store. It let Ignite store more data on disk than it can cache in memory and to enable fast cluster restarts.") |
| link(rel="canonical", href="https://ignite.apache.org/arch/native-persistence.html") |
| |
| meta(property="og:title", content="Native Persistence - Apache Ignite") |
| meta(property="og:type", content="article") |
| meta(property="og:url", content="https://ignite.apache.org/arch/native-persistence.html") |
| meta(property="og:image", content="/img/og-pic.png") |
| meta(property="og:description", content="Apache Ignite native persistence is a distributed, ACID, and SQL-compliant disk-based store. It let Ignite store more data on disk than it can cache in memory and to enable fast cluster restarts.") |
| |
| block css |
| link(rel="stylesheet", href="../css/native-persistence.css?ver=" + config.version) |
| link(rel="stylesheet", href="../js/vendor/highlight/default.min.css?ver=" + config.version) |
| link(rel="stylesheet", href="../js/vendor/highlight/night-owl.css?ver=" + config.version) |
| script(src="../js/vendor/highlight/highlight.min.js") |
| |
| |
| |
| block main |
| - global.pageHref = "features" |
| - config.hdrClassName = "hdr__blue" |
| include ../_components/header.pug |
| |
| |
| section.innerhero |
| .container.innerhero__cont |
| .innerhero__main |
| .innerhero__pre.pb-3 Apache Ignite |
| h1.h1.innerhero__h1 Native Persistence |
| .innerhero__descr.pt-2.h5. |
| Scale beyond available memory capacity <br> |
| and skip memory warm-ups on restarts |
| .innerhero__action |
| a.button.innerhero__button(href="https://ignite.apache.org/docs/latest/index") Start Coding |
| img.innerhero__pic.innerhero__pic--native(src="/img/features/native-header.svg", alt="Native Persistence") |
| // /.innerhero |
| |
| |
| section.native1.container.flexi |
| .native1__block.native1__block--bad |
| img.native1__icon(src="/img/features/smile-doesnt-have.svg", alt="") |
| .native1__title.fz20.pt-1x Usually, in-memory caches and databases provide limited persistence capabilities. |
| p.pt-2 For instance, some solutions create a backup copy of <br>the in-memory data purely for restart purposes. |
| .native1__block |
| img.native1__icon(src="/img/features/smile-done.svg", alt="") |
| .native1__title.fz20.pt-1x. |
| Ignite persistence doesn’t have any limitations. <br> |
| Our native persistence behaves like a classic <br>disk-based database. |
| |
| |
| section.native2.container |
| .native2__grid |
| article.native2item |
| h3.fz20.native2item__title Scale beyond memory <br>capacity |
| p.pt-1x 100% of data is always stored on disk. You decide how much memory to allocate to your data. |
| article.native2item |
| h3.fz20.native2item__title Just seconds needed <br>for recovery |
| p.pt-1x Ignite becomes operational from disk instantaneously. There is no need to wait for the data to get preloaded on restarts. |
| article.native2item |
| h3.fz20.native2item__title Query in-memory <br>and on-disk data |
| p.pt-1x If any record is missing in memory, then Ignite reads it from disk. This is supported for all the APIs including SQL. |
| |
| |
| section.native-howwork.container |
| .native-howwork__wrap.flexi |
| .native-howwork__left |
| h3.h5 How it works |
| .native-howwork__text.pt-1 |
| p The native persistence functions as a distributed, ACID, and SQL-compliant disk-based store. It integrates into the Ignite <a href="/features/multi-tier-storage.html">multi-tier storage</a> as a disk tier. |
| p.pt-1 When the native persistence is enabled, Ignite stores a superset of data on disk and caches as much as it can in memory. |
| .native-howwork__right |
| p For example |
| p.pt-1x If your application needs to store 200 records in an Ignite cluster and the memory capacity allows caching only 150 records, then all 200 will be stored on disk, out of which 150 will be served from memory while the rest 50 records from disk whenever the application requests them. |
| |
| |
| section.native-points.container |
| h2.h4 Checkpointing And Write-Ahead Logging <br>Ensure Durability And Consistency Of Data |
| .native-points__grid.pt-5 |
| .native-points__item.fz20 |
| p Committed transactions always survive failures |
| .native-points__item.fz20 |
| p The cluster can always be recovered to the latest successfully committed transaction |
| |
| section.native-steps |
| .container |
| h2.h4 Three-Step Process To Update Your Data <br>At In-Memory Speed But Not Losing A Bit |
| img.native-steps__pic(src="/img/features/native-stepspic.svg", alt="") |
| .native-steps__grid |
| article.nativestepitem |
| i.fz20.pb-1x 01 |
| //- .nativestepitem__title.fz20 First Step |
| .nativestepitem__text |
| p As soon as the update comes from the application side, a record is updated in memory. Then, the change is added <a href="https://ignite.apache.org/docs/latest/persistence/native-persistence.html#write-ahead-log">to the write-ahead log (WAL).</a> |
| p The purpose is to propagate updates to disk in the fastest way possible and provide a consistent recovery mechanism that remediates full cluster failures. |
| article.nativestepitem |
| i.fz20.pb-1x 02 |
| //- .nativestepitem__title.fz20 Second Step |
| .nativestepitem__text |
| p As the WAL grows, it periodically gets checkpointed to the main storage. |
| p <a href="https://ignite.apache.org/docs/latest/persistence/native-persistence.html#checkpointing">Checkpointing</a> is the process of copying dirty pages from the memory tier to the partition files on disk. |
| p.nativestepitem__small A dirty page is a page that has been updated in memory and appended to the WAL, but has not yet been written to the respective partition file on disk. |
| article.nativestepitem |
| i.fz20.pb-1x 03 |
| //- .nativestepitem__title.fz20 Third Step |
| .nativestepitem__text |
| p After a while, the information about updates in WAL can be removed, compressed or moved to archive. |
| p So you can reuse your disk space. |
| |
| |
| section.nativecode.container.jsTabWrap |
| header.blockheader.blockheader--spl.flexi |
| h2.h4.blockheader__left You Decide Which Data To Persist |
| .blockheader__right.fz20 |
| p Toggle a single configuration setting to turn a cluster into a database <br>that scales across memory and disk |
| .nativecode__tabctrls.flexi |
| a(href="#", data-tablink="nativeTabXML").nativecode__link.active XML |
| a(href="#", data-tablink="nativeTabJava").nativecode__link Java |
| a(href="#", data-tablink="nativeTabNET").nativecode__link C#/.NET |
| .nativecode__tabs |
| .nativecode__tab(data-tab="nativeTabXML").active |
| pre.nativecode__codebox |
| code.xml. |
| <bean class="org.apache.ignite.configuration.IgniteConfiguration"> |
| <property name="dataStorageConfiguration"> |
| <bean class="org.apache.ignite.configuration.DataStorageConfiguration"> |
| <property name="defaultDataRegionConfiguration"> |
| <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> |
| <property name="persistenceEnabled" value="true"/> |
| </bean> |
| </property> |
| </bean> |
| </property> |
| </bean> |
| .nativecode__tab(data-tab="nativeTabJava") |
| pre.nativecode__codebox |
| code.java. |
| IgniteConfiguration cfg = new IgniteConfiguration(); |
| |
| DataStorageConfiguration storageCfg = new DataStorageConfiguration(); |
| |
| // Enable Ignite Persistence |
| storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true); |
| |
| // Using the new storage configuration |
| cfg.setDataStorageConfiguration(storageCfg); |
| .nativecode__tab(data-tab="nativeTabNET") |
| pre.nativecode__codebox |
| code.csharp. |
| var cfg = new IgniteConfiguration |
| { |
| DataStorageConfiguration = new DataStorageConfiguration |
| { |
| DefaultDataRegionConfiguration = new DataRegionConfiguration |
| { |
| Name = "Default_Region", |
| PersistenceEnabled = true |
| } |
| } |
| }; |
| // /.nativecode |
| |
| |
| section.native-bottom.container |
| .native-bottom__grid |
| article.nativebotblock |
| .h4.nativebotblock__title |
| img(src="/img/features/native-rocket.svg", alt="").nativebotblock__icon |
| span Ready to Start? |
| p.nativebotblock__text Discover more details about native persistence <br>and configure it for your use-case |
| a.nativebotblock__link.arrowlink(href="https://ignite.apache.org/docs/latest/persistence/native-persistence", target="_blank") Native Persistence Usage and Configuration |
| article.nativebotblock.nativebotblock--learn |
| .h4.nativebotblock__title |
| img(src="/img/features/native-docs.svg", alt="").nativebotblock__icon |
| span Want to Learn More? |
| p.nativebotblock__text Check out the details of native persistence <br>implementation, <a href="https://www.youtube.com/watch?v=6Yg5QW-XFVc&list=PLMc7NR20hA-I2EfyXeaSRHY5dRFtK_NF0&index=6" target="_blank">or watch a video</a> |
| a.nativebotblock__link.arrowlink(href="https://cwiki.apache.org/confluence/display/IGNITE/Ignite+Persistent+Store+-+under+the+hood", target="_blank") Native Persistence Implementation Details |
| |
| |
| |