序:曾因为项目方财大气粗,并且极度青睐Oralce,幸而能在项目中接触并使用Oracle Coherence。期间我在公司内部做过一次Oracle Coherence的分享,为保证听众中的外国朋友不致于全场“坐飞机”,讲述内容以英文呈现。在此将讲述材料进一步整理与更多的朋友分享,就当是保证它的“原汁原味”吧,就不做翻译了,还请大家不要因此拍砖^_^
-----------------------------------------------------华丽分隔线----------------------------------------------------------------
Agenda
What is Coherence?
Demonstration
Technical
Code Examples
Architectural Patterns
What is Coherence?
Distributed Memory Data Management Solution(aka: Data Grid)
How Can a Data Grid Help?
1. Provides a reliable data tier with a single, consistent view of data
2. Enables dynamic data capacity including fault tolerance and load balancing
3. Ensures that data capacity scales with processing capacity
Oracle Grid Computing: Enterprise Ready
1. Common Shared Application Infrastructure (Application Virtualization)
2. Data Virtualization (Data as a Service)
3. Middle tier scale out for Grid Based OLTP
4. Massive Persistent scale out with Oracle RAC
Requirements of Enterprise Data Grid
Reliable
1. Built for continuous operation
2. Data Fault Tolerance
3. Self-Diagnosis and Healing
4. “Once and Only Once” Processing
Scalable
1. Dynamically Expandable
2. No data loss at any volume
3. No interruption of service
4. Leverage Commodity Hardware
5. Cost Effective
Universal
1. Single view of data
2. Single management view
3. Simple programming model
4. Any Application
5. Any Data Source
Data
1. Data Caching
2. Analytics
3. Transaction Processing
4. Event Processing
How Does Coherence Data Grid Work?
1. Cluster of nodes holding % of primary data locally
2. Back-up of primary data is distributed across all other nodes
3. Logical view of all data from any node
1. All nodes verify health of each other
2. In the event a node is unhealthy, other nodes diagnose state
1. Unhealthy node isolated from cluster
2. Remaining nodes redistribute primary and back-up responsibilities to healthy nodes
Customers & Coherence?
Caching: Applications request data from the Data Grid rather than backend data sources
Analytics: Applications ask the Data Grid questions from simple queries to advanced scenario modeling
Transactions: Data Grid acts as a transactional System of Record, hosting data and business logic
Events: Automated processing based on event
Coherence Demonstration
Topology #1 - Replicated Cache
Topology #2 - Partitioned Cache
Topology #2 - Guaranteed Cluster Resiliency
Topology #2 - Partitioned Failover
Topology #2a – Cache Client/Cache Server
Topology #3 - Near Cache
Use Case: Coherence*Web
1. Coherence*Web is an HTTP session-management module (built-in feature of Coherence)
2. Supports a wide range of application servers.
3. Does not require any changes to the application.
4. Coherence*Web uses the NearCache technology to provide fully fault-tolerant caching, with almost unlimited scalability (to several hundred cluster nodes without issue).
5. Heterogeneous applications running on mixed hardware/OS/application servers can share common user session data. This dramatically simplifies supporting Single-Sign-On across applications.
Coherence*Web: Session State Management
Build slide to show state is recoverable from the data grid. There is multiple important points here – the biggest is the ability to separate the session state to a tier independent of the application – you are offloading horsepower requirements in the middletier app server to the grid and getting significant reliability as a result of making this coherence.
Read-Through Caching
Write-Through Caching
Write-Behind Caching
Coherence Code Examples
Clustering Java Processes
Cluster cluster = CacheFactory.ensureCluster();
·Joins an existing cluster or forms a new cluster
Time “to join” configurable
·cluster contains information about the Cluster
Cluster Name
Members
Locations
Processes
·No “master” servers
·No “server registries”
Leaving a Cluster
CacheFactory.shutdown();
·Leaves the current cluster
·shutdown blocks until “data” is safe
·Failing to call shutdown results in Coherence having to detect process death/exit and recover information from another process.
·Death detection and recovery is automatic
Using a Cache get, put, size & remove
NamedCache nc = CacheFactory.getCache(“mine”);
Object previous = nc.put(“key”, “hello world”);
Object current = nc.get(“key”);
int size = nc.size();
Object value = nc.remove(“key”);
·CacheFactory resolves cache names (ie: “mine”) to configured NamedCaches
·NamedCache provides data topology agnostic access to information
·NamedCache interfaces implement several interfaces;
·java.util.Map, Jcache,
·ObservableMap*,
·ConcurrentMap*,
·QueryMap*,
·InvocableMap*
(* Coherence Extensions)
Using a Cache keySet, entrySet, containsKey
NamedCache nc = CacheFactory.getCache(“mine”);
Set keys = nc.keySet();
Set entries = nc.entrySet();
boolean exists = nc.containsKey(“key”);
·Using a NamedCache is like using a java.util.Map
·What is the difference between a Map and a Cache data-structure?
· Both use (key,value) pairs for entries
· Map entries don’t expire
· Cache entries may expire
· Maps are typically limited by heap space
· Caches are typically size limited (by number of entries or memory)
· Map content is typically in-process (on heap)
Observing Cache Changes ObservableMap
NamedCache nc = CacheFactory.getCache(“stocks”);
nc.addMapListener(new MapListener() {
public void onInsert(MapEvent mapEvent) {
}
public void onUpdate(MapEvent mapEvent) {
}
public void onDelete(MapEvent mapEvent) {
}
});
·Observe changes in real-time as they occur in a NamedCache
·Options exist to optimize events by using Filters, (including pre and post condition checking) and reducing on-the-wire payload (Lite Events)
·Several MapListeners are provided out-of-the-box.
·Abstract, Multiplexing...
Querying Caches QueryMap
NamedCache nc = CacheFactory.getCache(“people”);
Set keys = nc.keySet( new LikeFilter(“getLastName”, “%Stone%”));
Set entries = nc.entrySet(new EqualsFilter(“getAge”, 35));
·Query NamedCache keys and entries across a cluster (Data Grid) in parallel* using Filters
·Results may be ordered using natural ordering or custom comparators
·Filters provide support almost all SQL constructs
·Query using non-relational data representations and models
·Create your own Filters
( * Requires Enterprise Edition or above)
Continuous Observation Continuous Query Caches
NamedCache nc = CacheFactory.getCache(“stocks”);
NamedCache expensiveItems = new ContinuousQueryCache(nc, new GreaterThan(“getPrice”, 1000));
·ContinuousQueryCache provides real-time and in-process copy of filtered cached data
·Use standard or your own custom Filters to limit view
·Access to “view”of cached information is instant
·May use with MapListeners to support rendering real-time local views (aka: Think Client) of Data Grid information.
Aggregating Information InvocableMap
NamedCache nc = CacheFactory.getCache(“stocks”);
Double total = (Double)nc.aggregate(AlwaysFilter.INSTANCE,new DoubleSum(“getQuantity”));
Set symbols = (Set)nc.aggregate(new EqualsFilter(“getOwner”, “Larry”), new DistinctValue(“getSymbol”));
·Aggregate values in a NamedCache across a cluster (Data Grid) in parallel* using Filters
·Aggregation constructs include; Distinct, Sum, Min, Max, Average, Having, Group By
·Aggregate using non-relational data models
·Create your own aggregators
(* Requires Enterprise Edition or above)
Mutating Information InvocableMap
NamedCache nc = CacheFactory.getCache(“stocks”);
nc.invokeAll(new EqualsFilter(“getSymbol”, “ORCL”), new StockSplitProcessor());
...
class StockSplitProcessor extends AbstractProcessor {
Object process(Entry entry) {
Stock stock = (Stock)entry.getValue();
stock.quantity *= 2;
entry.setValue(stock);
return null;
}
}
·Invoke EntryProcessors on zero or more entries in a NamedCache across a cluster (Data Grid) in
·parallel* (using Filters) to perform operations
·Execution occurs where the entries are managed in the cluster, not in the thread calling invoke
·This permits Data + Processing Affinity
(* Requires Enterprise Edition or above)
Oracle Coherence Architectural Patterns
Single Application Process
Coherence as “Data Structure”. Single applications may use Coherence java.util.Map interface implementations (and extensions) for high-performance, highly configurable caching. Clustering is not required!
Clustered Processes
Coherence ensures that there is a consistent view of the data in-memory to all processes.
This is sometimes referred to as a “single-system-image”
Multi Platform Cluster
Clustered Application Servers
With Data Source Integration (Cache Stores)
Clustered Second Level Cache (for Hibernate)
Remote Clients connected to Coherence Cluster
Interconnected WAN Clusters
Getting Oracle Coherence
Search:
http://search.oracle.com
Download:
http://www.oracle.com/technology/products/coherence
Support:
http://forums.tangosol.com
http://wiki.tangosol.com
Read More:
http://www.tangosol.com/
- 大小: 35.1 KB
- 大小: 67.4 KB
- 大小: 23.5 KB
- 大小: 15.7 KB
- 大小: 16.6 KB
- 大小: 15.8 KB
- 大小: 46.6 KB
- 大小: 47.7 KB
- 大小: 42.7 KB
- 大小: 41.9 KB
- 大小: 38.4 KB
- 大小: 47.6 KB
- 大小: 48.1 KB
- 大小: 61.1 KB
- 大小: 48.1 KB
- 大小: 46.5 KB
- 大小: 49.2 KB
- 大小: 14.5 KB
- 大小: 28.9 KB
- 大小: 28.6 KB
- 大小: 31.4 KB
- 大小: 26.7 KB
- 大小: 25.9 KB
- 大小: 23.2 KB
- 大小: 33.4 KB
分享到:
相关推荐
Oracle Coherence中文开发文档
A advanced application architecture. It introduce the Data Grid, Data Fabric concepts to implement application servers.
This book will tell you how to administer oracle coherence server. audience: oracle coherence administrator.
Oracle Coherence是一个企业级的分布式集群缓存框架。具有自管理,自恢复,高可用性,高扩展性等优良特点,在电信BOSS等项目中有很大的应用价值。本文对它的特点,架构,基本使用方法,JMX管理,调优等进行简要但...
Oracle Coherence的系統架構說明與介紹。
Oracle Coherence是一个企业级的分布式集群缓存框架。具有自管理,自恢复,高可用性,高扩展性等优良特点,在电信BOSS等项目中有很大的应用价值。 压缩包里面有最新版Oracle Coherence 3.7.1,加上中文资料。
Tutorial for Oracle Coherence
this book introduces the basic concepts and principle of Oracle Coherence (In Memory Data Grid). It is suitable for the beginners of Oracle Coherence.
openfire集群用到的 Oracle Coherence很难找到
oracle coherence 使用经验 1
Oracle Coherence Developer’s Guide.pdf
最新版Oracle Coherence 3.6上市.pdf
NULL 博文链接:https://hujing101.iteye.com/blog/1601336
coherence入门文档 内容大概涵盖了基础部分 文字版本
Oracle Coherence社区版内容介绍是一个可扩展的,容错的,云就绪的分布式平台,用于构建基于网格的应用程序并可靠地存储数据。 该产品已在关键金融交易系统,高性能电信产品和电子商务应用等众多行业中大规模用于...
Packtpub.Oracle.Coherence.3.5.Mar.2010.rar
oracle_coherence_solution.pdf-中文
Oracle通过支持Docker和Kubernetes等行业标准,使使用组织将集群迁移到云中,Oracle促进了在与云无关的基础架构上运行Coherence。 此外,Oracle提供了一个开源的Coherence Operator,它实现了一些功能,以帮助在...