Apache Ignite

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Apache Ignite
Apache Ignite logo.svg
Original author(s) GridGain Systems
Developer(s) Apache Software Foundation
Initial release 24 March 2015; 3 years ago (2015-03-24)
Stable release
2.6.0 / 16 July 2018; 3 months ago (2018-07-16)
Repository github.com/apache/ignite
Written in Java, C#, C++
Operating system Cross-platform
Platform IA-32, x86-64, PowerPC, SPARC, Java platform, .NET Framework
Type Database, computing platform
License Apache License 2.0
Website ignite.apache.org

Apache Ignite is an open-source distributed database, caching and processing platform designed to store and compute on large volumes of data across a cluster of nodes.[1]

Ignite was open-sourced by GridGain Systems in late 2014 and accepted in the Apache Incubator program that same year.[2][3] The Ignite project graduated on September 18, 2015.[3]

Apache Ignite's database utilizes RAM as the default storage and processing tier, thus, belonging to the class of in-memory computing platforms.[4] The disk tier is optional but, once enabled, will hold the full data set whereas the memory tier[5] will cache full or partial data set depending on its capacity.

Regardless of the API used, data in Ignite is stored in the form of key-value pairs. The database component scales horizontally, distributing key-value pairs across the cluster in such a way that every node owns a portion of the overall data set. Data is rebalanced automatically whenever a node is added to or removed from the cluster.

On top of its distributed foundation, Apache Ignite supports a variety of APIs including JCache-compliant key-value APIs, ANSI-99 SQL with joins, ACID transactions, as well as MapReduce like computations.

Apache Ignite cluster can be deployed on-premise on a commodity hardware, in the cloud (e.g. Microsoft Azure, AWS, Google Compute Engine) or in a containerized and provisioning environments such as Kubernetes, Docker, Apache Mesos, VMWare.[6][7]

Clustering[edit]

Apache Ignite clustering component is based on the shared nothing architecture. The nodes are divided into two main categories - server and client. Server nodes are storage and computational units of the cluster that hold both data and indexes and process incoming requests along with computations. Server nodes are also known as data nodes.[8]

Client nodes are connection points from applications and services to the distributed database represented as a cluster of server nodes. Client nodes are usually embedded in the application code written in Java, C# or C++ that have special libraries developed.

Furthermore, Apache Ignite provides ODBC,[9] JDBC[10] and REST drivers as a way to work with the database from other programming languages or tools. The drivers utilize either client nodes or low-level socket connections internally in order to communicate to the cluster.

Partitioning and replication[edit]

Ignite database organizes data in the form of key-value pairs in distributed "caches" (the cache notion is used for historical reasons because initially, the database supported the memory tier). Generally, each cache represents one entity type such as an employee or organization.

Every cache is split into a fixed set of "partitions" that are evenly distributed among cluster nodes using the rendezvous hashing algorithm. There is always one primary and zero or more backup copies of a partition. The number of copies is configured with a replication factor parameter.[11] If the full replication mode is configured, then every cluster node will store a partition's copy. The partitions are rebalanced[12] automatically if a node is added to or removed from the cluster in order to achieve an even data distribution and spread the workload.

The key-value pairs are kept in the partitions. Apache Ignite maps a pair to a partition by taking the key's value and passing it to a special hash function.

Memory architecture[edit]

The memory architecture in Apache Ignite consists of two storage tiers and is called "durable memory". Internally, it uses paging for memory space management and data reference,[13] similar to the virtual memory of systems like Unix. However, one significant difference between the durable and virtual memory architectures is that the former always keeps the whole data set with indexes on disk (assuming that the disk tier is enabled), while the virtual memory uses the disk when it runs out of RAM, for swapping purposes only.

The first tier of the memory architecture, memory tier, keeps data and indexes in RAM out of Java heap in so-called "off-heap regions". The regions are preallocated and managed by the database on its own which prevents Java heap utilization for storage needs, as a result, helping to avoid long garbage collection pauses. The regions are split into pages of fixed size that store data, indexes, and system metadata.[14]

Apache Ignite is fully operational from the memory tier but it is always possible to use the second tier, disk tier, for the sake of durability. The database comes with its own native persistence and, plus, can use RDBMS, NoSQL or Hadoop databases as its disk tier.

Native persistence[edit]

Apache Ignite native persistence is a distributed and strongly consistent disk store that always holds a superset of data and indexes on disk. The memory tier [5] will only cache as much data as it can depending on its capacity. For example, if there are 1000 entries and the memory tier can fit only 300 of them, then all 1000 will be stored on disk and only 300 will be cached in RAM.

Persistence uses the write-ahead logging (WAL) technique for keeping immediate data modifications on disk.[15] In the background, the store runs the "checkpointing process" which purpose is to copy dirty pages from the memory tier to the partition files. A dirty page is a page that is modified in memory with the modification recorded in WAL but not written to a respective partition file. The checkpointing allows removing outdated WAL segments over the time and reduces cluster restart time replaying only that part of WAL that has not been applied to the partition files.[16]

Third-party persistence[edit]

The native persistence became available starting version 2.1.[17] Before that Apache Ignite supported only third-party databases as its disk tier.

Apache Ignite can be configured as the in-memory tier on top of RDBMS, NoSQL or Hadoop databases speeding up the latter.[18] However, there are some limitations in comparison to the native persistence. For instance, SQL queries will be executed only on the data that is in RAM, thus, requiring to preload all the data set from disk to memory beforehand.

Swap space[edit]

When using pure memory storage, it is possible for the data size to exceed the physical RAM size, leading to OOMEs. To avoid this, the ideal approach would be to enable Ignite native persistence or use third-party persistence. However, if you do not want to use native or third-party persistence, you can enable swapping, in which case, Ignite in-memory data will be moved to the swap space located on disk. Please know that Ignite does not provide its own implementation of swap space. Instead, it takes advantage of the swapping functionality provided by the operating system (OS). When swap space is enabled, Ignites stores data in memory mapped files (MMF) whose content will be swapped to disk by the OS depending on the current RAM consumption

Consistency[edit]

Apache Ignite is a strongly consistent platform that implements two-phase commit protocol.[19] The consistency guarantees are met for both memory and disk tiers. Transactions in Apache Ignite are ACID-compliant and can span multiple cluster nodes and caches. The database supports pessimistic and optimistic concurrency modes, deadlock-free transactions and deadlock detection techniques.

In the scenarios where transactional guarantees are optional, Apache Ignite allows executing queries in the atomic mode that provides better performance.

Distributed SQL[edit]

Apache Ignite can be accessed using SQL APIs exposed via JDBC and ODBC drivers, and native libraries developed for Java, C#, C++ programming languages. Both data manipulation and data definition languages' syntax complies with ANSI-99 specification.

Being a distributed database, Apache Ignite supports both distributed collocated and non-collocated joins.[20] When the data is collocated, joins are executed on the local data of cluster nodes avoiding data movement across the network. Non-collocated joins might move the data sets around the network in order to prepare a consistent result set.

References[edit]

  1. ^ "What Is Apache Ignite? - DZone Big Data". dzone.com. Retrieved 2017-11-02.
  2. ^ "Nikita Ivanov on Apache Ignite In-Memory Computing Platform". InfoQ. Retrieved 2017-11-02.
  3. ^ a b "Ignite Status - Apache Incubator". incubator.apache.org. Retrieved 2017-11-02.
  4. ^ "Nikita Ivanov on Apache Ignite In-Memory Computing Platform". InfoQ. Retrieved 2017-10-11.
  5. ^ a b "Apache Ignite Native Persistence, a Brief Overview - DZone Big Data". dzone.com. Retrieved 2017-10-11.
  6. ^ "Deploying Apache Ignite in Kubernetes on Microsoft Azure - DZone Cloud". dzone.com. Retrieved 2017-10-11.
  7. ^ "Real-time in-memory OLTP and Analytics with Apache Ignite on AWS | Amazon Web Services". Amazon Web Services. 2016-05-14. Retrieved 2017-10-11.
  8. ^ "Clients and Servers". apacheignite.readme.io. Retrieved 2017-10-11.
  9. ^ "ODBC Driver". apacheignite.readme.io. Retrieved 2017-10-11.
  10. ^ "JDBC Driver". apacheignite.readme.io. Retrieved 2017-10-11.
  11. ^ "Primary & Backup Copies". apacheignite.readme.io. Retrieved 2017-10-11.
  12. ^ "Data Rebalancing". apacheignite.readme.io. Retrieved 2017-10-11.
  13. ^ "Apache Ignite 2.0: Redesigned Off-heap Memory, DDL and Machine Learning : Apache Ignite". blogs.apache.org. Retrieved 2017-10-11.
  14. ^ "Memory Architecture". apacheignite.readme.io. Retrieved 2017-10-11.
  15. ^ "Ignite Persistence". apacheignite.readme.io. Retrieved 2017-10-11.
  16. ^ "Ignite Persistence". apacheignite.readme.io. Retrieved 2017-10-11.
  17. ^ "Apache Ignite 2.1 - A Leap from In-Memory to Memory-Centric Architecture : Apache Ignite". blogs.apache.org. Retrieved 2017-10-11.
  18. ^ "Apache Ignite for Database Caching - DZone Database". dzone.com. Retrieved 2017-10-11.
  19. ^ "Distributed Thoughts". Retrieved 2017-10-11.
  20. ^ "Apache Ignite 1.7: Welcome Non-Collocated Distributed Joins! - DZone Database". dzone.com. Retrieved 2017-10-11.