Top Related Projects
Apache Ignite
Hazelcast is a unified real-time data platform combining stream processing with a fast data store, allowing customers to act instantly on data-in-motion for real-time insights.
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
Apache Cassandra®
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
Quick Overview
Apache Geode is a distributed, in-memory data management system that provides real-time, consistent access to data-intensive applications. It pools memory, CPU, network resources, and optionally local disk across multiple processes to manage application objects and behavior. Geode is designed to support high-performance, scalable, and fault-tolerant data management solutions.
Pros
- High scalability and performance for large-scale distributed systems
- Strong consistency and data replication across multiple nodes
- Support for various data models (key-value, object, JSON)
- Robust querying capabilities with OQL (Object Query Language)
Cons
- Steep learning curve for beginners
- Complex configuration and setup process
- Limited documentation compared to some other popular databases
- Requires careful tuning for optimal performance in production environments
Code Examples
- Creating a region and putting data:
Region<String, String> region = cache.createRegionFactory(RegionShortcut.REPLICATE).create("myRegion");
region.put("key1", "value1");
region.put("key2", "value2");
- Querying data using OQL:
QueryService queryService = cache.getQueryService();
String queryString = "SELECT * FROM /myRegion WHERE value LIKE '%value%'";
Query query = queryService.newQuery(queryString);
SelectResults results = (SelectResults) query.execute();
- Implementing a CacheListener:
class MyCacheListener extends CacheListenerAdapter<String, String> {
@Override
public void afterCreate(EntryEvent<String, String> event) {
System.out.println("Created: " + event.getKey() + " = " + event.getNewValue());
}
}
RegionFactory<String, String> rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
rf.addCacheListener(new MyCacheListener());
Region<String, String> region = rf.create("myRegion");
Getting Started
To get started with Apache Geode:
- Download and install Apache Geode from the official website.
- Start a Geode locator:
gfsh> start locator --name=locator1
- Start a Geode server:
gfsh> start server --name=server1
- Create a region:
gfsh> create region --name=myRegion --type=REPLICATE
- Add the Geode dependency to your project's build file (e.g., Maven):
<dependency> <groupId>org.apache.geode</groupId> <artifactId>geode-core</artifactId> <version>1.15.0</version> </dependency>
- Use the Geode API in your Java application to interact with the distributed system.
Competitor Comparisons
Apache Ignite
Pros of Ignite
- More comprehensive feature set, including distributed computing and machine learning capabilities
- Better performance in high-throughput scenarios and larger datasets
- More flexible deployment options, including cloud-native and Kubernetes support
Cons of Ignite
- Steeper learning curve due to its broader feature set
- Higher resource consumption, especially for smaller deployments
- Less focus on specific use cases compared to Geode's data management specialization
Code Comparison
Ignite:
IgniteCache<Integer, String> cache = ignite.getOrCreateCache("myCache");
cache.put(1, "Hello");
String value = cache.get(1);
Geode:
Region<Integer, String> region = cache.getRegion("myRegion");
region.put(1, "Hello");
String value = region.get(1);
Both projects use similar API patterns for basic operations, but Ignite offers more advanced features and distributed computing capabilities beyond simple caching.
Hazelcast is a unified real-time data platform combining stream processing with a fast data store, allowing customers to act instantly on data-in-motion for real-time insights.
Pros of Hazelcast
- Simpler setup and configuration process
- Better performance for certain use cases, especially with smaller datasets
- More extensive cloud integrations and deployment options
Cons of Hazelcast
- Less mature ecosystem compared to Geode
- Smaller community and fewer third-party integrations
- Limited support for complex querying and indexing
Code Comparison
Hazelcast:
HazelcastInstance hz = Hazelcast.newHazelcastInstance();
Map<String, String> map = hz.getMap("my-distributed-map");
map.put("key", "value");
String result = map.get("key");
Geode:
ClientCache cache = new ClientCacheFactory().create();
Region<String, String> region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("my-distributed-region");
region.put("key", "value");
String result = region.get("key");
Both Hazelcast and Geode are distributed in-memory data management systems, but they have different strengths. Hazelcast is often praised for its ease of use and quick setup, while Geode offers more advanced features for complex data operations. The code examples show that both systems provide similar basic functionality for storing and retrieving data, with slight differences in syntax and initialization.
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
Pros of Redis
- Simpler architecture and easier to set up and maintain
- Faster performance for single-node operations
- More widespread adoption and larger community support
Cons of Redis
- Limited built-in support for distributed systems and clustering
- Less robust data persistence options compared to Geode
- Smaller feature set for complex data operations and querying
Code Comparison
Redis (simple key-value set):
SET mykey "Hello, Redis!"
GET mykey
Geode (region creation and put operation):
Region<String, String> region = cache.createRegionFactory(RegionShortcut.REPLICATE).create("myRegion");
region.put("mykey", "Hello, Geode!");
Both Redis and Geode are popular in-memory data stores, but they cater to different use cases. Redis excels in simplicity and raw performance for single-node setups, while Geode offers more robust distributed system capabilities and advanced data management features. The choice between them depends on specific project requirements, scalability needs, and the complexity of data operations required.
Apache Cassandra®
Pros of Cassandra
- Better scalability and performance for large-scale distributed systems
- Stronger support for multi-datacenter replication
- More mature ecosystem with wider adoption in industry
Cons of Cassandra
- Steeper learning curve and more complex configuration
- Less flexible querying capabilities compared to Geode's OQL
- Higher memory consumption, especially for read-heavy workloads
Code Comparison
Cassandra CQL query:
SELECT * FROM users WHERE user_id = 123;
Geode OQL query:
SELECT * FROM /users u WHERE u.id = 123;
Both systems use SQL-like query languages, but Geode's OQL offers more flexibility for complex queries and joins across multiple regions.
Cassandra's data model is based on wide column stores, while Geode uses a key-value approach with support for complex objects. This difference is reflected in their respective APIs and query languages.
Overall, Cassandra excels in large-scale distributed environments with high write throughput, while Geode offers more flexibility and easier integration with existing Java applications. The choice between them depends on specific use cases and scalability requirements.
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
Pros of CockroachDB
- Designed for global, distributed deployments with multi-region support
- Strong consistency model with serializable isolation
- Built-in support for horizontal scaling and automatic sharding
Cons of CockroachDB
- Higher resource consumption, especially for smaller deployments
- Steeper learning curve due to its distributed nature
- More complex configuration for optimal performance tuning
Code Comparison
CockroachDB (SQL syntax):
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name STRING,
created_at TIMESTAMP DEFAULT current_timestamp()
);
Geode (Java API):
Region<String, User> usersRegion = cache.createRegionFactory(RegionShortcut.PARTITION)
.setKeyConstraint(String.class)
.setValueConstraint(User.class)
.create("users");
Both projects are distributed data stores, but they serve different purposes. CockroachDB is a SQL database focused on global scalability and strong consistency, while Geode is an in-memory data grid primarily used for caching and real-time data processing. CockroachDB offers a familiar SQL interface, making it easier for developers with SQL experience to adopt. Geode, on the other hand, provides more flexibility in data models and is better suited for high-throughput, low-latency applications. The choice between the two depends on specific use cases and requirements.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Contents
- Overview
- How to Get Apache Geode
- Main Concepts and Components
- Location of Directions for Building from Source
- Geode in 5 minutes
- Application Development
- Documentation
- Wiki
- How to Contribute
- Export Control
Overview
Apache Geode is a data management platform that provides real-time, consistent access to data-intensive applications throughout widely distributed cloud architectures.
Apache Geode pools memory, CPU, network resources, and optionally local disk across multiple processes to manage application objects and behavior. It uses dynamic replication and data partitioning techniques to implement high availability, improved performance, scalability, and fault tolerance. In addition to being a distributed data container, Apache Geode is an in-memory data management system that provides reliable asynchronous event notifications and guaranteed message delivery.
Apache Geode is a mature, robust technology originally developed by GemStone Systems. Commercially available as GemFireâ¢, it was first deployed in the financial sector as the transactional, low-latency data engine used in Wall Street trading platforms. Today Apache Geode technology is used by hundreds of enterprise customers for high-scale business applications that must meet low latency and 24x7 availability requirements.
How to Get Apache Geode
You can download Apache Geode from the website, run a Docker image, or install with Homebrew on OSX. Application developers can load dependencies from Maven Central.
Maven
<dependencies>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-core</artifactId>
<version>$VERSION</version>
</dependency>
</dependencies>
Gradle
dependencies {
compile "org.apache.geode:geode-core:$VERSION"
}
Main Concepts and Components
Caches are an abstraction that describe a node in an Apache Geode distributed system.
Within each cache, you define data regions. Data regions are analogous to tables in a relational database and manage data in a distributed fashion as name/value pairs. A replicated region stores identical copies of the data on each cache member of a distributed system. A partitioned region spreads the data among cache members. After the system is configured, client applications can access the distributed data in regions without knowledge of the underlying system architecture. You can define listeners to receive notifications when data has changed, and you can define expiration criteria to delete obsolete data in a region.
Locators provide clients with both discovery and server load balancing services. Clients are configured with locator information, and the locators maintain a dynamic list of member servers. The locators provide clients with connection information to a server.
Apache Geode includes the following features:
- Combines redundancy, replication, and a "shared nothing" persistence architecture to deliver fail-safe reliability and performance.
- Horizontally scalable to thousands of cache members, with multiple cache topologies to meet different enterprise needs. The cache can be distributed across multiple computers.
- Asynchronous and synchronous cache update propagation.
- Delta propagation distributes only the difference between old and new versions of an object (delta) instead of the entire object, resulting in significant distribution cost savings.
- Reliable asynchronous event notifications and guaranteed message delivery through optimized, low latency distribution layer.
- Data awareness and real-time business intelligence. If data changes as you retrieve it, you see the changes immediately.
- Integration with Spring Framework to speed and simplify the development of scalable, transactional enterprise applications.
- JTA compliant transaction support.
- Cluster-wide configurations that can be persisted and exported to other clusters.
- Remote cluster management through HTTP.
- REST APIs for REST-enabled application development.
- Rolling upgrades may be possible, but they will be subject to any limitations imposed by new features.
Building this Release from Source
See BUILDING.md for instructions on how to build the project.
Running Tests
See TESTING.md for instructions on how to run tests.
Geode in 5 minutes
Geode requires installation of JDK version 1.8. After installing Apache Geode, start a locator and server:
$ gfsh
gfsh> start locator
gfsh> start server
Create a region:
gfsh> create region --name=hello --type=REPLICATE
Write a client application (this example uses a Gradle build script):
build.gradle
apply plugin: 'java'
apply plugin: 'application'
mainClassName = 'HelloWorld'
repositories { mavenCentral() }
dependencies {
compile 'org.apache.geode:geode-core:1.4.0'
runtime 'org.slf4j:slf4j-log4j12:1.7.24'
}
src/main/java/HelloWorld.java
import java.util.Map;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.client.*;
public class HelloWorld {
public static void main(String[] args) throws Exception {
ClientCache cache = new ClientCacheFactory()
.addPoolLocator("localhost", 10334)
.create();
Region<String, String> region = cache
.<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create("hello");
region.put("1", "Hello");
region.put("2", "World");
for (Map.Entry<String, String> entry : region.entrySet()) {
System.out.format("key = %s, value = %s\n", entry.getKey(), entry.getValue());
}
cache.close();
}
}
Build and run the HelloWorld
example:
$ gradle run
The application will connect to the running cluster, create a local cache, put some data in the cache, and print the cached data to the console:
key = 1, value = Hello
key = 2, value = World
Finally, shutdown the Geode server and locator:
gfsh> shutdown --include-locators=true
For more information see the Geode Examples repository or the documentation.
Application Development
Apache Geode applications can be written in these client technologies:
The following libraries are available external to the Apache Geode project:
Export Control
This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.
The following provides more details on the included cryptographic software:
- Apache Geode is designed to be used with Java Secure Socket Extension (JSSE) and Java Cryptography Extension (JCE). The JCE Unlimited Strength Jurisdiction Policy may need to be installed separately to use keystore passwords with 7 or more characters.
- Apache Geode links to and uses OpenSSL ciphers.
Top Related Projects
Apache Ignite
Hazelcast is a unified real-time data platform combining stream processing with a fast data store, allowing customers to act instantly on data-in-motion for real-time insights.
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
Apache Cassandra®
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot