Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

缓存 是一个抽象的概念, 在一个 Geode 分布式系统中用于描述一个节点.

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 both discovery and load balancing services. You configure clients with a list of locator services and the locators maintain a dynamic list of member servers. By default, Geode clients and servers use port 40404 and multicast to discover each other.

Geode includes the following features:

数据 regions 类似于传统关系型数据库中的'表'的概念, 以分布式的方式来管理数据 , 表现为名/值对儿形式. 在分布式系统的每个缓存成员中, 一个 复制 region 保存数据的拷贝. 一个 分区 region 跨缓存成员来同步数据. 在系统配置后, 客户端应用能够访问regions 中的分布式数据, 而不需要知道系统整体架构的知识. 你能够定义监听器来接收通知, 当数据发生变化时, 同时你也能够定义超时标准来删除在一个 region 中的废弃掉的数据.

Locators 提供了发现和负载均衡服务. 你配置带有 locator 服务列表的客户端, 同时 locators 维护一个成员服务器的动态列表. 默认情况下, Geode 客户端和服务器使用端口 40404 和多播来互相发现.

Geode 包含了如下的特性:

  • 结合冗余, 复制, 和 "shared nothing" 的一致性架构来交付 '自动防故障' 的可靠性和高性能.
  • 水平扩展到数千个缓存成员, 具有多种缓存拓扑结构来满足不同的企业级部署需求. 缓存能够跨多台机器进行分布.
  • 异步和同步缓存更新传播.
  • Delta 传播只分发新版本和旧版本的变化量 (delta) , 而不是整个对象, 从而可以节省大量的网络开销.
  • 通过经过优化的, 低延时的通信层进行可靠的异步事件通知, 高保障的消息投递.
  • 在没有额外硬件的辅助下, 应用可以加速4 到 40,000 倍.
  • 数据感知和实时BI. 当你查询时, 如果数据变化了, 你能够立刻在系统中看见数据的变化.
  • 集成 Spring 框架来加速和简化高可扩展、高并发和事务型企业级应用的开发复杂度.
  • JTA 兼容的事务支持.
  • 集群的配置可以写到文件中和导出到其他集群中.
  • 通过HTTP做 远程集群管理.
  • 基于REST应用开发的REST APIs.
  • 滚动升级是可行的, 但是需要服从新特性的限制问题
  • 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.
  • Applications run 4 to 40,000 times faster with no additional hardware.
  • 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.

Anchor
Geode in 5 minutes
Geode in 5 minutes

...

5分钟内上手 Geode 

 从 Download and install Geode binaries from http://geode.incubator.apache.org/releases/, and follow the installation instructions at in the posted manual at  下载和安装Geode 二进制安装包, 安装说明如下 http://geode.incubator.apache.org/docs/

With a path that contains the bin directory of the installation, start a locator and 在路径中, 包含了所安装的 bin 目录, 启动一个 locator 和 server:

$ gfsh 
gfsh> start locator --name=locator 
gfsh> start server --name=server 

Create a 创建一个 region:

gfsh> create region --name=region --type=REPLICATE 

Write a 写一个 client application应用:

Code Block
languagejava
titleHelloWorld.java
import java.util.Map;
import comorg.gemstoneapache.gemfiregeode.cache.Region;
import comorg.gemstoneapache.gemfiregeode.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("region");

    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();
  }
}

 

Compile and run 编译和运行 HelloWorld.java. The classpath should include 应该包含 geode-dependencies.jar.

Code Block
languagebash
$ javac -cp /some/path/incubator-geode/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar HelloWorld.java 
$ java -cp .:/some/path/incubator-geode/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar HelloWorld

...

应用开发

Geode applications can be written in a number of client technologies应用可以使用如下的客户端技术来写入:

...