2010-07-15_coherence-3.6_bacsig
DESCRIPTION
Oracle CoherenceTRANSCRIPT
<Insert Picture Here>
Oracle Coherence 3.6 - Overview Christer Fahlgren David Leibs Oracle Coherence Engineering
Coherence 3.6 Release Overview Agenda
• 3.6 Release Highlights • 3.6 Feature Walk-Through – Transaction Framework – Quorum – Session Provider for the Microsoft .NET Framework – Coherence*Extend Security – SSL Support – User-Defined Indexes – Coherence Query Language (CohQL) + DEMO
• QA
Oracle Coherence 3.6 Highlights
• Very Significant Product Release – Over 18 months in the making – Hundreds of RASP improvements
• 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. Connection Based API • This API provides for more control over transactions. • Allows for transactions that span multiple statements. • Also introduces the OptimisticNamedCache interface which
introduces functionality useful for optimistic transactions.
XA Compliant Resource Adapter • Allows Coherence to participate in a distributed transaction
as a fully compliant XA resource.
Coherence 3.6 Transaction Framework – important to know
Transactions across caches • Caches must be running on the same Distributed Service
Cache size overhead for MVCC • MVCC stores additional versions of Cache values • Details and sizing directions in the documentation
Transactions from Coherence*Extend • Only possible by using EntryProcessors that execute the Transaction.
Limitations • No support for the CacheStore interface – i.e. no read-through, write-
through 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 fine-
grained resource-driven control of the service Example Use Cases:
• Size-based quorum that is also a function of time (e.g. weekly maintenance window during which cache requests are disallowed)
• Resource-driven policies (e.g. no writes allowed unless database is available)
• Externally-triggered policies (e.g. “Start a cluster, and immediately preload data into the cache. Until this process completes, do not allow cache requests”)
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
Background: Porting Filters
new AndFilter(
new GreaterFilter(IdentityExtractor.INSTANCE, 1),
new LessFilter(IdentityExtractor.INSTANCE, 4));
Java
IdentityExtractor::View hExtract = IdentityExtractor::create();
AndFilter::Handle hFilter = AndFilter::create(
GreaterEqualsFilter::create(hExtract, Float32::create(5.0F)),
LessEqualsFilter::create(hExtract,Float32::create(10.0F)));
C++
Gizmology setResults = cache.entrySet(new AndFilter(
new LikeFilter(new KeyExtractor("getLastName"), "S%",
(char) 0, false),
new EqualsFilter("getHomeAddress.getState", "MA")));
The Vision
InvocableMap.EntryAggrigator[] agg = InvocableMap.EntryAggrigator[] {
new DoubleSum(“getAmount”), new DoubleAverage(“getPrice”)
};
Filter filter = new OrFilter(new EqualsFilter(“getColor”, “red”), new EqualsFilter(“getColor”, “green”));
CacheFactory.getCache("orders").aggregate(filter, new CompositeAggrigator(agg));
Could Gizmology like:
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
Command Line CohQL - Syntax
(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’
Command Line CohQL - sample
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”
Programmatic API Example
cache.addIndex(QueryHelper.createExtractor("age"), true, null);
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
Set setResults = cache.entrySet(QueryHelper.createFilter("homeAddress.state = 'MA'"));
printResults("MA Residents", setResults);
// 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);
Creating Filters and ValueExtractors
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
• Very Significant Product Release – Over 18 months in the making – Hundreds of RASP improvements
• Customer Focused – Continue to help push the envelope: cluster size, data size,
throughput – Greater Flexibility: design, deployment, operations