Top Banner
Oracle Coherence By Mustafa Ahmed 1
27

Oracle Coherence

Nov 12, 2014

Download

Documents

mustafa777

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Oracle Coherence

1

Oracle CoherenceBy Mustafa Ahmed

Page 2: Oracle Coherence

2

Agenda The Problem Solution Data Grids Replicated Topology Partitioned Topology Near Topology Events Query Read Through Caching Write Through Caching Write Behind Caching Coherence Code Examples Conclusion• Performance • Availability• Scalability

Page 3: Oracle Coherence

3

Data• Extreme increase in Access Volume & Complexity

of Data Driving Data Demand• Virtualization

Ability to move applications around several machines• Service Oriented Architecture (SOA)

Integrated services that can be used in Multiple business domains

Relying on other services

The Problem

Page 4: Oracle Coherence

4

Provide Reliable, Scalable, Universal Data Access and Management. • Performance

Solves Latency and Bandwidth Problems• Availability

Having the data available at all times• Scalability

Handle growing demand of Data Efficiently

Solution – Oracle Coherence

Page 5: Oracle Coherence

5

Manages Information in a grid environment• Lots of servers working together• Servers do not run independently

Server manages state Even server failure occurs.

• Adding more servers Concept of scale out It will manage more data and can handle more transactions per

second. Data as a Service• Middle Tier • In App Server

Data Integration is in Data Service• Integration can occur in Domain Model

Data Grids

Page 6: Oracle Coherence

6

Combines Data Management with Data Processing• Push processing where data is being managed• Read or Write data across any number of servers

Single System Image• No need to show server infrastructure• Pretend all the information is Local• Logical view of all data in all the servers

Data Grids

Page 7: Oracle Coherence

7

There are two things you can move in a Distributed Environment• State

Distribution of a state is referred to as replication• Behavior

Moving messages Data Grids combine these two concepts• You can either move data or the processing where

data is sitting• Push all the processes to the Information

Data Grids

Page 8: Oracle Coherence

8

Locality of Data• Most applications spend most of the time waiting

for data• If the data is partitioned with non overlapping

regions the behavior can be moved to the server that owns the data to process

• Results In lower latency

Data Grids

Page 9: Oracle Coherence

9

Technology introduced In 2001 Replicate information among all servers

◦ Data is replicated to all members in Data Grid Problems

◦ Scalability Problem Capacity of Information Stays the same

Replicated Topology

Page 10: Oracle Coherence

10

Replicated Topology Expensive• Update Each Server every time• Conceptually its expensive

Page 11: Oracle Coherence

11

Each Information is spread out across the servers (Peer to Peer)

Load Balancer• Keeps track of the load• Move from one server

to another• Sends to the server

which owns the data Exactly one server

owns the information• Has a sync back up for

it

Partitioned Topology

Page 12: Oracle Coherence

12

Partitioned Topology Failure Occurs• The operation still

finishes correctly• Increase servers

from 2 to 2000 servers it increases scalability

• All servers are disposable at any period of time

Page 13: Oracle Coherence

13

L2 Cache vs. L1 Cache• Partitioned Topology as L2 Cache• Near Topology as L1 Cache

Stores it Locally• If asks again then gets it locally

Demand base replicated caching Zero Latency access to recently used data

Near Topology

Page 14: Oracle Coherence

14

Near Topology

Page 15: Oracle Coherence

15

Events All the dataset

provide events regardless of Topology

Events are distributed efficiently to the interested listeners

Page 16: Oracle Coherence

16

Parallel Query• Query performed

parallel across the data grid using indexing

• All doing the local portion of the Query

Query

Page 17: Oracle Coherence

17

Continuous Query• Combines a Query

with Events to provide a local materialized view

• Result is up to date in real time

• Like in near topology but always contains the desired data

Query

Page 18: Oracle Coherence

18

Read Through Caching Finds it in L1 or

L2 Cache◦ Otherwise sends

a request to the database

Only sends one requests

Coalesces multiple reads to reduce the database load

Page 19: Oracle Coherence

19

Writes first to the database and then commits to the cache

Not a Two-Phase Commit

Keeps the in-memory data and the database in sync.

Write Through Caching

Page 20: Oracle Coherence

20

First writes it to the cache◦ Later commits it to the

database◦ This assures the latest

version of the cache Batches all the writes

into one object Geico uses it

◦ Improved performance◦ 90% reduction in

database usage

Write Behind Caching

Page 21: Oracle Coherence

21

Joins an existing cluster or forms a new one

Leaves the current cluster

Coherence Code Examples

Cluster cluster = CacheFactory.ensureCluster();

CacheFactory.shutdown();

Page 22: Oracle Coherence

22

Coherence Code Examples

NamedCache nc = CacheFactory.getCache(“mine”);

Object previous = nc.put(“key”, “hello world”);

Object current = nc.get(“key”);

int size = nc.size();

boolean exists = nc.containsKey(“key”);

Page 23: Oracle Coherence

23

Observe changes in real time as the occur

Coherence Code Examples

NamedCache nc = CacheFactory.getCache(“stocks”);

nc.addMapListener(new MapListener() { public void onInsert(MapEvent mapEvent) { }

public void onUpdate(MapEvent mapEvent) { }

public void onDelete(MapEvent mapEvent) { } });

Page 24: Oracle Coherence

24

Performance◦ Solves Latency Problems And Preserve network

bandwidth Cache recently used data Ability to execute tasks parallel across the data grid Moving the process where the data is

Conclusion - Performance

Page 25: Oracle Coherence

25

Availability◦ Remove all single point of failure◦ Added redundancy to improve availability◦ Able to Queue updates if database is not available◦ Increase availability from 11 days to 2.5 hours

per year

Conclusion - Availability

Page 26: Oracle Coherence

26

Scalability◦ Scale Out functionality

Database Sharding◦ Coherence eliminates Database Sharding◦ Distributed cache ◦ Updates performed against the cache data◦ Scaling both capacity and throughput

Adding more nodes to the Coherence Cluster

Conclusion - Scalability

Page 27: Oracle Coherence

27

Any Questions