Download presentation
Presentation is loading. Please wait.
Published byKristin Holland Modified over 9 years ago
1
Ahmet Fuat SUNGUR afsungur@gmail.com @afsungur 11.10.2012 – Bahçe ş ehir University İleri Seviyede Oracle Ön Bellek Mekanizması (Oracle Coherence)
2
Who am i Y.T.U – Computer Engineering I.T.U – Computer Engineering, not completed Since 2008, Turkcell Technology afsungur@gmail.com @afsungur
3
Agenda What is the cache and buffer? Why we use caches in designing programming? Oracle Coherence Features Demos Final
4
Buffer Memory A buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. It is a temporary memory location that is traditionally used because CPU instructions cannot directly address data stored in peripheral devices.
5
Caching A cache is a component that transparently stores data so that future requests for that data can be served faster.
6
Caching CPU Cache TLB ( Translation Lookaside Buffer ) Disk Cache Web Cache DNS Cache
7
Cache in Programming EMP_IDNAMETEL_NOEMAILADDRESSGENDER 1Ahmet531232afsungur@gmail.comBahçelievler/ İ stM 2Aysel895244aysel@hotmail.comÇankaya/AnkaraF 3Hasan855412hasan@outlook.comLevent/ İ stanbulM 4Veli789621veli@msn.comSarıyer/ İ stanbul M DB EMP_IDNAMETEL_NOGENDER 1Ahmet531232M 3Hasan855412M request response responseresponse requestrequest
8
Oracle Coherence A variety of caching strategies Reporting and administrator support via JMX and associated tools Rich language support via Coherence*Extend Has no single point of failure Automatically and transparently fails over and redistributes its clustered data managements services. Automatically scale up your application when a server added
9
What is Coherence Cluster Node A Coherence Cluster node Sometimes referred to as a member or cluster member Is a java process Joins a cluster Is an instance of Coherence server Can contain data, run processing and serve events Is often defined by a cache configuration localstorage.enabled = true => node contains data JVM 1 PID : 5654 NODE 1 JVM 2 PID : 5655 NODE 2 JVM 3 PID : 5656 NODE 3
10
Clustering in Coherence Using a conference room model -Dtangosol.coherence.cluster=name Listening Discovery Working Groups and Private Conversation Death detection Failed Servers Failover Failback
11
Coherence Cache Topology Examples Local Cache Replicated Cache JVM Local Cache JVM Replicated Cache JVM Replicated Cache JVM Replicated Cache
12
Coherence Cache Topology Examples Partitioned Cache ( Distributed Cache ) Near Cache JVM Partitioned Cache JVM Local Cache JVM Partitioned Cache
13
Replicated Cache Animation CUST_IDNAMETEL_NO 1Ahmet Sungur5301112233 2Ay ş e Öz5321112244 1,2 Add a customer 3Mehmet Akar5341234561 3 3 1,2 3 Seamlessly get all cache data and put into in its own cache
14
Partitoned Cache Animation CUST_IDNAMETEL_NO 1Ahmet Sungur5301112233 2Ay ş e Öz5321112244 12 Add a customer 3Mehmet Akar5341234561 3
15
Near Cache Animation 12 34 12 requests 1 from Front cache returns 1 from front cache no need to access back cache 34 requests 2 from Front cache it’s need to access back cache returns 2 from back cache and write it to front cache 2 returns 2 to app From front cache Generally, Local Cache is used for front cache, because of ~0 cost Generally, Partitioned Cache is used for back cache, because of accessing much more data.
16
Near Cache Animation 12 34 12 34 Updates 2 to Front cache 2 Near Cache invalidation strategies Listen None Listen Present Listen All Listen Auto
17
Failover
18
When data source is involved Read-Through Write-Through Write-Behind Refresh-Ahead Caching
19
Read Through Caching
20
Write Through Caching
21
Write-Behind Caching Improves application performance Reduces database load Insulated from database failures Linear Scalibility
22
Refresh-Ahead Two parameters Expiration time Refresh-ahead factor Expiration time:60 seconds Refresh Ahead factor :0.5 Database CUST_IDNAMETEL_NOEXPIRATI ON_TIME 1Ahmet Sungur5301112233 13:45:48 2Ay ş e Öz5321112244 13:45:24 Request «1» @13:45:10 48-10>60*05, So no need to reload Request «2» @13:45:15 24-15<60*05 So we need to reload Get object 2 from db put into the cache Got fresh object from db ( obj 2 ) 13:46:15
23
Event and Parallel Processing Coherence supports two background processing models Parallel Processing Events Map listeners which are called asynchronously after data changes Map triggers which are called synchronously before data changes
24
Queries and Filters Coherence supports two query mechanism A filter mechanism, useful for events and event filters MapEventFilter AndFilter, OrFilter … A SQL-Like mechanism known as the Coherence Query Language useful for queries against caches SELECT result-set | * FROM cache-name WHERE conditional-expression Select * from customers where name like ‘%ap%’ Select max(price) from stocks where lastupdatedate Select avg(price) from stocks Insert, update, delete…
25
Demo Time Oracle Virtual Box 4.1 Oracle Enterprise Linux OEPE ( Oracle Enterprise Package for Eclipse ) Oracle Coherence 3.7.1
26
Other Coherence Security Coherence Management Managing and monitoring via JMX Coherence Reporter Coherence*Extend Coherence*Web
27
Summary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.