2008年借着金融危机之际凭着其实力击败老牌厂商Oracle, 大举进入华尔街金融领域,而其中Citi则是Gemfire的铁粉,据称全球2/3的Gemfire应用跑在Citi的服务器上,尤其是固定收益类交易系统的最爱 Gemfire整体分布式架构 总体来说Gemfire提供了基于内存的海量数据实时处理平台,包括低延迟高吞吐,线性动态扩展 (流行的话叫“弹性水平扩展”),HA,MapReduce,听起来很Hadoop 核心概念 1 Region Region是Gemfire中一Map的分布式实现,同时具备了支持查询,事务。这个是Gemfire的核心中核心,一切的一切始于此。 12306的架构正是运行在Linux X86的集群Gemfire, 水平弹性扩展,当年铁道部想必也是调研了众多分布式产品,多重分析评估,最终Gemfire胜出。 Gemfire在支持万次/每秒查询,以及高频写/修改,二者兼备的佼佼者。 11. DT时代的Gemfire 临时加一章了,老东家的Gemfire铁粉太多,得来点干货了。
Spring Data 针对 Pivotal GemFire 关注整合强大的 Spring 框架的能力,无创编程模型和使用 Pivotal GemFire 数据管理方案的 GemFire 的概念来集成和简化配置 本文档假定你已经对 Spring Framework 和 Pivotal GemFire 的概念有了些基本的了解。 我们将会尽力保证这个文档的完整和正确。 https://www.cwiki.us/display/SpringDataZH/Spring+Data+for+Pivotal+GemFire+Reference+Guide
在GemFire中,数据分布在集群成员之间,其成员称为“节点”,这些节点的数据分布称为“分区”。然后,vFabric GemFire允许开发人员查询驻留在多个节点上的数据,同时保留大规模的核心价值。 GemFire使用键值对中的关键字分配数据。查询这些数据涉及类SQL语言的使用,如面向对象查询语言或者OQL。如果不在GemFire中使用任何特殊的分区(后面会讨论),关键字最终会与数组的值无关。 GemFire可以选择自定义分区或固定分区(在关系数据库术语中有时也称为“基于列的分区”)用于确定性分配数据。在GemFire 6.6.2中,我们可以选择性地查询基于列的分布式(即分区)数据。 为了自定义分区数据,应用程序开发人员必须实现PartitionResolver以导入他们的GemFire分区策略。 GemFire-Function-Execution.png 使用自定义分区实现函数执行 然后,GemFire的函数执行服务可用于此分区数据,以实现对分布式数据进行像map-reduce 一样的操作,
Spring认证指南:了解如何使用 Gemfire 的数据结构构建应用程序。 在 Pivotal GemFire 中访问数据 本指南将引导您完成构建Apache Geode数据管理系统应用程序的过程。 光盘进入gs-accessing-data-gemfire/initial 跳转到定义一个简单实体。 完成后,您可以对照中的代码检查结果 gs-accessing-data-gemfire/complete。 ; import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions; import org.springframework.data.gemfire.repository.config.EnableGemfireRepositories
=info spring.data.gemfire.pool.Venus.servers=venus[48484] spring.data.gemfire.pool.Venus.max-connections =200 spring.data.gemfire.pool.Venus.min-connections=50 spring.data.gemfire.pool.Venus.ping-interval=15000 spring.data.gemfire.pool.Venus.pr-single-hop-enabled=true spring.data.gemfire.pool.Venus.read-timeout =20000 spring.data.gemfire.pool.Venus.subscription-enabled=true spring.data.gemfire.pool.Saturn.locators =40404 spring.data.gemfire.cache.server.Venus.port=43434 spring.data.gemfire.cache.server.Saturn.port
interface EnableStatistics 该EnableStatistics注解标记了一个 Spring,该@Configuration注解Class 用于配置和启用正在运行的 Pivotal GemFire GemfireCachingConfiguration.class) 公共@interface EnableGemfireCaching 该EnableGemfireCaching注释使 Pivotal GemFire Inherited @Documented public @interface EnableIndexing 该EnableIndexing注释标记的春天@Configuration注释应用类启用的GemFire /的Geode上的GemFire /的Geode 。 /的Geode 上的GemFire /的Geode 。
/Geode 的应用程序成为 GemFire/Geode 缓存客户端(即ClientCache)。 的应用程序中启用嵌入式 GemFire 实例。 的应用程序中启用嵌入式 GemFire 对等实例。 GemFire/Apache Geode Manager ,从而用作切换。 Pivotal GemFire/Apache Geode Redis 服务,从而用作切换。
gfe:partitioned-region id="Guests" persistent="false"/> <bean id="activeUsersFilter" class="example.<em>gemfire</em>.snapshot.filter.ActiveUsersFilter Admins"> <gfe-data:snapshot-import location="/path/to/import/users.snapshot"> <bean class="example.<em>gemfire</em>.snapshot.filter.AdminsFilter "/> <bean class="org.example.app.<em>gemfire</em>.snapshot.filter.UsersSinceFilter" p:since= <gfe:event-filter> <ref bean="event-filter"/> <bean class="org.springframework.data.<em>gemfire</em>.example.SomeEventFilter "/> <bean id="transport-filter" class="org.springframework.data.<em>gemfire</em>.example.AnotherTransportFilter
@Import(值= GemfireFunctionBeanPostProcessorRegistrar.class) 公共@interface EnableGemfireFunctions 启用 GemFire @Retention ( value = RUNTIME ) @Target ( value = TYPE ) 公共@interface OnMember 将接口声明为 GemFire OnMember 函数执行的注释 @Retention ( value = RUNTIME ) @Target ( value = TYPE ) 公共@interface OnMembers 将接口声明为 GemFire 模式对象定义、ClientCache使用 Spring 配置的Apache Geode / Pivotal GemFire应用程序能够推送到 Apache Geode / Pivotal GemFire 集群,类似于模式命令(例如`create region `) 在 Gfsh 中由 Apache Geode / Pivotal GemFire 管理器处理。
问题导读: 1、什么是GemFire分布式内存数据技术? 2、12306购票网站是如何实现大规模访问? 2012年10月份,二期用GemFire改造订单查询系统(客户查询自己的订单记录)。 12306发现GemFire分布式内存数据平台就是这样一种技术。 ? GemFire是Pivotal企业级大数据PaaS平台的一部分。 Pivotal GemFire分布式集群内存数据技术对整个技术改造发挥了关键的作用。
很多银行、投行,实时交易方面的系统都采用 Pivotal GemFire 作为解决方案。 GemFire 基于开源项目 Geode 进行研发的。 GemFire 本身是 Geode 的商用版本,可以理解为收费的 Redis(Redis的作者现在就在 GemFire 打工)。就像 Oracle 和 MySQL。 而在银行以及 12306 这些系统中,它们对可靠性要求非常的高,因此会选择商用的 GemFire,不仅性能强、高可用,而且 GemFire 还会提供一系列的解决方案。 当时 12306 也尝试了许多其他的解决方案,都扛不住查询的流量,而使用 GemFire 之后扛住了流量,因此就使用了 GemFire。 db-engines.com 这个网站可以对比主流数据库之间的差异 扣减库存之后再同步至 GemFire,然后在 GemFire 里进行动态计算,整个 GemFire 承载的是查询的流量。
31.4 Gemfire Spring数据Gemfire为访问Pivotal Gemfire数据管理平台提供了方便的Spring友好工具 。 有一 个 spring-boot-starter-data-gemfire “Starter”用于以方便的方式收集依赖项。 目前没有Gemfire的自动配置支持,但您可以使用单个注 释启用Spring数据存储库 :@EnableGemfireRepositories 。
Spring Data for Pivotal GemFire - Easy configuration and access to Pivotal GemFire for your highly consistent 关键 GemFire 的 Spring Data ——对于高度一致、低延迟/高通过性、面向数据的 Spring 应用程序,可以轻松配置和访问关键 GemFire。 Apache Geode 的 Spring Data Spring Data for Apache Solr Apache Solr 的 Spring 数据 Spring Data for Pivotal GemFire 关键 GemFire 的弹簧数据 Spring Data Couchbase (community module) Spring 数据库(社区模块) Spring Data Elasticsearch
10)spring-boot-starter-data-gemfire 支持GemFire分布式数据存储,包括spring-data-gemfire。
2.利用成熟的技术做session复制,比如12306使用的gemfire,比如常见的内存数据库如redis或memorycache,这类方案虽然比较普适,但是严重依赖于第三方,这样当第三方服务器出现问题的时候 我们实现的方案可以说是第二种方案和第三种方案的合体,可以利用gemfire实现session复制共享,还可以将session维护在redis中实现session共享,同时可以将session维护在客户端的 我们在实践中,首选gemfire或者redis作为session共享的载体,一旦session不稳定出现问题的时候,可以紧急切换cookie维护session作为备用,不影响应用提供服务,下面我简单介绍方案中 这里主要讲解redis和cookie方案,gemfire比较复杂大家可以自行查看gemfire工作原理。
2.利用成熟的技术做session复制,比如12306使用的gemfire,比如常见的内存数据库如redis或memorycache,这类方案虽然比较普适,但是严重依赖于第三方,这样当第三方服务器出现问题的时候 我们实现的方案可以说是第二种方案和第三种方案的合体,可以利用gemfire实现session复制共享,还可以将session维护在redis中实现session共享,同时可以将session维护在客户端的 我们在实践中,首选gemfire或者redis作为session共享的载体,一旦session不稳定出现问题的时候,可以紧急切换cookie维护session作为备用,不影响应用提供服务,下面我简单介绍方案中 这里主要讲解redis和cookie方案,gemfire比较复杂大家可以自行查看gemfire工作原理。
为了帮助确保LuceneIndexes在 Spring 容器中定义的所有声明都是在它们应用的区域之前创建的,SDG 包括 org.springframework.data.gemfire.config.support.LuceneIndexRegionBeanFactoryPostProcessor 您可以BeanFactoryPostProcessor 使用.xml在 XML 配置中注册这个 Spring <bean class="org.springframework.data.<em>gemfire</em>.config.support.LuceneIndexRegionBeanFactoryPostProcessor cache/cache-1.0.xsd" version="1.0"> <initializer> <class-name>org.springframework.data.gemfire.support.SpringContextBootstrappingInitializer <key-constraint>java.lang.String</key-constraint> <value-constraint>org.springframework.data.gemfire.repository.sample.User </class-name> <parameter name="basePackages"> <string>org.springframework.data.gemfire.support.sample
-- enable declarative caching --> <cache:annotation-driven/> <gfe:cache id="<em>gemfire</em>-cache"/> must have a bean ID of 'cacheManager' --> <bean id="cacheManager" class="org.springframework.data.<em>gemfire</em>.cache.GemfireCacheManager " p:cache-ref="<em>gemfire</em>-cache"> </beans> 在cache-ref该属性CacheManager如果默认缓存bean的名字被使用(即“gemfireCache caching --> <cache:annotation-driven/> <bean id="cacheManager" class="org.springframework.data.<em>gemfire</em>.cache.GemfireCacheManager 以下示例显示了如何创建实例化器: <bean id="instantiatorFactory" class="org.springframework.data.<em>gemfire</em>.serialization.InstantiatorFactoryBean
GemFire 事务的生命周期从开始操作开始。生命周期以提交或回滚操作结束。在开始和提交/回滚之间通常是 Region操作。 一个 GemFire 事务可能涉及对多个区域的操作,每个区域可能具有不同的属性。 在本地 VM 中调用 GemFire 事务及其操作时,根据每个参与区域的属性,在提交时将生成的事务状态分发到其他 VM。 GemFire Transactions 目前只支持 Read Committed 隔离。此外,它们是乐观事务,因为写锁定和冲突检查是作为提交操作的一部分执行的。 有关在分区区域中使用事务的详细信息,请参阅 GemFire 开发人员指南。
从Linux Foundation, Slideshare, or YouTube获得更多的信息 访问与Apache Geode website, Pivotal GemFire website相关话题的文章 查看Apache Geode website, Pivotal GemFire website网站 阅读Apache MADlib详情 Editor’s Note: ©2015 Pivotal Software All rights reserved.Pivotal, Pivotal Greenplum, Pivotal GemFire and Pivotal Cloud Foundry aretrademarks All rights reserved.Pivotal, Pivotal Greenplum, Pivotal GemFire and Pivotal Cloud Foundry aretrademarks