Professional Documents
Culture Documents
2010 07 15 - Coherence 3.6 - BACSIG
2010 07 15 - Coherence 3.6 - BACSIG
QA
Customer Focused
Continue to help customers push the envelope: cluster size, data size, throughput Greater Flexibility and Usability: design, deployment, operations
Coherence 3.6
Transaction Framework
Overview:
Provides ACID transaction guarantees across partitions and caches even in the event of failure. Multi-Version Concurrency Control (MVCC) Supports the use of NamedCache operations, queries, aggregation, and entry processors within the context of a transaction. Allows for consistent reads.
New Features:
<transactional-scheme> Connection Based API XA Compliant Resource Adapter
Coherence 3.6
Transaction Framework
<transactional-scheme>
Allows for single statement (autocommit) transactions while using the standard Coherence API.
Coherence 3.6
Transaction Framework important to know
Limitations
No support for the CacheStore interface i.e. no read-through, writethrough or write-behind etc No support for BackingMap Listeners
Coherence 3.6
Transactions example Connection oriented
Connection con = new DefaultConnectionFactory(). createConnection("TransactionalCache");
con.setAutoCommit(false);
try {
OptimisticNamedCache cache = con.getNamedCache("MyTxCache");
cache.insert(key, value);
cache.insert(key2, value2);
con.commit();
catch (Exception e) {
con.rollback();
throw e;
}
finally {
con.close();
}
Quorum
Overview: Resource planning (e.g. # servers, RAM, etc.) Configure Coherence behavior (per-service) in the absence of significant resources New Features: Out-Of-The-Box membership-based policies Pluggable interface for custom policies
Quorum Policies
Out Of The Box: Allows users to specify (in cache-config) minimum membership thresholds for various service behaviors. For Example: Number of members to perform distribution Number of members to allow cache reads/writes Number of members to allow Extend proxy connections
(See <*-quorum-policy-scheme> documentation for details)
Quorum Policies
Pluggable Interface:
Allows for users to implement custom policies to control the "availability" of Coherence features/behaviors Policies could incorporate arbitrary external state to provide finegrained resource-driven control of the service
Cluster-Level Quorum
Split-brain results from portions of a cluster becoming disconnected Split-brain semantics can be application-specific In many cases, operating in a split-brain mode is not desired Cluster-level quorum allows for control (via configuration or custom policy) over cluster member timeouts For example if half of the cluster has exceeded a network timeout, should the members be removed (forming a split-brain), or should the cluster be suspended?
Coherence 3.6
Session Provider for the Microsoft .NET Framework
Overview:
The Coherence Session Provider for the Microsoft .NET Framework allows you to manage ASP.NET session state in a Coherence cluster in the same way Coherence*Web provides session management in JEE containers.
New Features:
Supports all Coherence*Web Session Models (Traditional, Monolithic and Split) Pluggable Serializer Support .NET and POF Serialization Support Lockless exclusive session access via EntryProcessors Optimized Session_OnEnd Support
Coherence 3.6
Coherence*Extend Security
Overview:
Coherence*Extend Security now supports the ability to restrict client access to the cluster through the use of an identity token.
New Features:
Pluggable Identity Handling - Separate serialization/ deserialization from handling of identity. Associate Identity with NamedCache and Service References Ability to Add Authorization to Remote Invocation Service Ability to Add Authorization to RemoteCacheService Always Run as an Identity - The proxy code will always run as the Subject returned by the IdentityAsserter (even if null).
Coherence 3.6
Security SSL Support
Overview:
Introduced native SSL support
New Features:
SSL support for Extend (TCP) and Cluster (TCMP) 1-way or 2-way (client authentication) Can benefit from SSL offload engine Configurable Trust Manager
SunX509 PeerX509 (default)
Coherence 3.6
User-Defined Indexes
Overview:
Used to control which entries are added to an index. User-defined indexes are typically used to reduce the memory and processing overhead required to maintain an index.
New Feature:
IndexAwareExtractor
Supports the creation and destruction of a user-defined index Intended to be used with the QueryMap API to support the creation of user-defined indexes.
Coherence 3.6
Coherence Query Language (CohQL)
Overview:
Coherence Query Language is a new light-weight syntax (in the tradition of SQL) that is used to perform cache operations on a Coherence cluster. The language can be used either programmatically or from a command-line tool.
Coherence 3.6
Coherence Query Language (CohQL)
New Features:
QueryHelper API - Programmatic Construction of Filters and ValueExtracters. New command line tool with SQL like syntax (SELECT, CREATE CACHE, UPDATE, INSERT, DELETE, BACKUP, RESTORE) Ability to source files containing Coherence Query Language commands Flexible insert and update statements that allows java constructors and static invocations Extended insert and update statements that allow literal Lists, Maps, and Sets
C++
IdentityExtractor::View hExtract = IdentityExtractor::create();
AndFilter::Handle hFilter = AndFilter::create(
GreaterEqualsFilter::create(hExtract, Float32::create(5.0F)),
Gizmology LessEqualsFilter::create(hExtract,Float32::create(10.0F)));
setResults = cache.entrySet(new AndFilter( new LikeFilter(new KeyExtractor("getLastName"), "S%", (char) 0, false), new EqualsFilter("getHomeAddress.getState", "MA")));
The Vision
be said as:
SELECT sum(amount), avg(price) FROM orders WHERE color is 'red' or color is 'green'
What is CohQL?
Command Line Tool with SQL like Language Programmatic Filter and ValueExtractor building API that is similar to the SQL WHERE clause
(ENSURE | CREATE) CACHE 'cache-name (ENSURE | CREATE) INDEX [ON] 'cache-name' value-extractor-list DROP CACHE 'cache-name DROP INDEX [ON] 'cache-name' value-extractor-list BACKUP CACHE 'cache-name' [TO] [FILE] 'filename RESTORE CACHE 'cache-name' [FROM] [FILE] 'filename INSERT INTO 'cache-name' [KEY (literal | new java-constructor | static method) ] VALUE (literal | new java-constructor | static method) DELETE FROM 'cache-name' [[AS] alias] [WHERE conditional-expression] UPDATE 'cache-name' [[AS] alias] SET update-statement {, update-statement}* [ WHERE conditional-expression ] SELECT (properties* aggregators* | * | alias) FROM 'cache-name' [[AS] alias] [WHERE conditional-expression] [GROUP [BY] properties+] SOURCE FROM [FILE] 'filename
CohQL> select min(zipCodes.size()), min(zipCodes.size()) from cityinfo Results: 0 , 0 CohQL> delete from cityinfo where zipCodes.size() is 0 or areaCodes.size() is 0 COHQL select areaCodes from cityinfo where name is Dallas Results: {214,972} CohQL> update cityinfo set areaCodes = {214, 469, 972} where name is Dallas and state is TX
cache.addIndex(QueryHelper.createExtractor("key().lastName"), true, null); cache.addIndex(QueryHelper.createExtractor("homeAddress.city"), true, null); cache.addIndex(QueryHelper.createExtractor("homeAddress.state"), true, null); cache.addIndex(QueryHelper.createExtractor("workAddress.state"), true, null); // Find all contacts who live in Massachusetts printResults("MA Residents", setResults);
Set setResults = cache.entrySet(QueryHelper.createFilter("homeAddress.state = 'MA'")); // Find all contacts who live in Massachusetts and work elsewhere setResults = cache.entrySet(QueryHelper.createFilter("homeAddress.state is 'MA' and workAddress is not 'MA'")); printResults("MA Residents, Work Elsewhere", setResults);
DEMO
Future Possibilities
Extend programmatic API to richer query language Allow users of the Coherence Query Language the ability to add their own commands GUI interface as a complement to the Command line tool Explore and extend CohQL based on new APIs (Transactions)
Summary
Customer Focused
Continue to help push the envelope: cluster size, data size, throughput Greater Flexibility: design, deployment, operations
Q&A
search.oracle.com
Coherence
or www.oracle.com/goto/coherence