SlideShare una empresa de Scribd logo
1 de 222
Scaling up & out with
Ehcache and Terracotta
Alex Snaps
Senior Software Engineer — Terracotta, Inc.
What’s this all about ?


Rethink caching, rethink access patterns and, finally …
Know what solution is right for your application to deal with lots of data !
Agenda



 Ehcache  ? Terracotta ?
 Data access patterns revisited
 Scaling Up vs. Out
 Consistency consideration
 Search
 Inversion of control (sort of!)
Q&A




                         JeeConf 2011 — Kiev   3
Who’s who ?


… on Ehcache, Terracotta and… last & least, me.
Ehcache




          JeeConf 2011 — Kiev   5
Ehcache

   The most widely used performance library in Java
    –   Used in over 70 percent of enterprise Java applications
    –   200k + production deployments
    –   Embedded in most popular Java frameworks/apps.
        Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...




                                     JeeConf 2011 — Kiev          5
Ehcache

   The most widely used performance library in Java
    –   Used in over 70 percent of enterprise Java applications
    –   200k + production deployments
    –   Embedded in most popular Java frameworks/apps.
        Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...
   Fast




                                     JeeConf 2011 — Kiev          5
Ehcache

   The most widely used performance library in Java
    –   Used in over 70 percent of enterprise Java applications
    –   200k + production deployments
    –   Embedded in most popular Java frameworks/apps.
        Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...
 Fast
 Lightweight
    –   Less than 1 MB
    –   Easy to use API




                                     JeeConf 2011 — Kiev          5
Ehcache

   The most widely used performance library in Java
     –   Used in over 70 percent of enterprise Java applications
     –   200k + production deployments
     –   Embedded in most popular Java frameworks/apps.
         Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...
 Fast
 Lightweight
     –   Less than 1 MB
     –   Easy to use API
   Grows with your application with only two lines of configuration
     –   Scale Up - BigMemory (100’s of Gig, in process, NO GC)
     –   Scale Out - Clustering Platform (Up to 2 Terabytes, HA)



                                      JeeConf 2011 — Kiev              5
Ehcache

   The most widely used performance library in Java
     –   Used in over 70 percent of enterprise Java applications
     –   200k + production deployments
     –   Embedded in most popular Java frameworks/apps.
         Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...
 Fast
 Lightweight
     –   Less than 1 MB
     –   Easy to use API
   Grows with your application with only two lines of configuration
     –   Scale Up - BigMemory (100’s of Gig, in process, NO GC)
     –   Scale Out - Clustering Platform (Up to 2 Terabytes, HA)
   Fully backward compatible all the way back to 1.x

                                      JeeConf 2011 — Kiev              5
Terracotta




             JeeConf 2011 — Kiev   6
Terracotta

 Founded   2003 in San Francisco, CA




                        JeeConf 2011 — Kiev   6
Terracotta

 Founded   2003 in San Francisco, CA
 Present in India, Europe
  and pretty much all over the globe!




                       JeeConf 2011 — Kiev   6
Terracotta

 Founded   2003 in San Francisco, CA
 Present in India, Europe
  and pretty much all over the globe!
 Open source project that delivers
  Enterprise Java application scalability and availability




                         JeeConf 2011 — Kiev                 6
Terracotta

 Founded   2003 in San Francisco, CA
 Present in India, Europe
  and pretty much all over the globe!
 Open source project that delivers
  Enterprise Java application scalability and availability
 Products around :
  – Ehcache  & Hibernate
  – Quartz Scheduler
  – Web Sessions
  – Terracotta Toolkit


                           JeeConf 2011 — Kiev               6
About me …




             JeeConf 2011 — Kiev   7
About me …

   Senior Software Engineer at Terracotta
    – Working on Ehcache & Terracotta integration,
    – Quartz Enterprise Scheduler,
    – Terracotta toolkit




                             JeeConf 2011 — Kiev     7
About me …

   Senior Software Engineer at Terracotta
    – Working on Ehcache & Terracotta integration,
    – Quartz Enterprise Scheduler,
    – Terracotta toolkit
   Contributed to
    – Hibernate
    – Unitils & dbMaintain
    – ... and a couple of long forgotten open source projects




                              JeeConf 2011 — Kiev               7
About me …

   Senior Software Engineer at Terracotta
    – Working on Ehcache & Terracotta integration,
    – Quartz Enterprise Scheduler,
    – Terracotta toolkit
   Contributed to
    – Hibernate
    – Unitils & dbMaintain
    – ... and a couple of long forgotten open source projects
   Speak at JUGs & conferences
    –   like Codemotion, jFokus, JavaOne,
        JavaZone, Devoxx, Jazoon, ...

                              JeeConf 2011 — Kiev               7
Now to the fun part!


Data access patterns revisited
Big Data ?




             JeeConf 2011 — Kiev   9
Big Data ?

   What's Big Data for you?




                          JeeConf 2011 — Kiev   9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.




                          JeeConf 2011 — Kiev   9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?




                          JeeConf 2011 — Kiev   9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?




                          JeeConf 2011 — Kiev   9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?
    – Petabytes?




                          JeeConf 2011 — Kiev   9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?
    – Petabytes?
   It's all about supporting your business growth.




                           JeeConf 2011 — Kiev        9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?
    – Petabytes?
   It's all about supporting your business growth.
    – Growth   in terms of schema evolution.




                              JeeConf 2011 — Kiev     9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?
    – Petabytes?
   It's all about supporting your business growth.
    – Growth in terms of schema evolution.
    – Growth in terms of data storage.




                            JeeConf 2011 — Kiev       9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?
    – Petabytes?
   It's all about supporting your business growth.
    – Growth in terms of schema evolution.
    – Growth in terms of data storage.
   Growth in terms of data processing.



                            JeeConf 2011 — Kiev       9
Big Data ?

 What's Big Data for you?
 Not a question of quantity.
    – Gigabytes?
    – Terabytes?
    – Petabytes?
   It's all about supporting your business growth.
    – Growth in terms of schema evolution.
    – Growth in terms of data storage.
 Growth in terms of data processing.
 Is your data stack capable of handling such a growth?


                            JeeConf 2011 — Kiev           9
Where’s all that data ?


Relational databases & friends
How do you access your database ?




              JeeConf 2011 — Kiev   11
How do you access your database ?




              JeeConf 2011 — Kiev   11
Caching




          JeeConf 2011 — Kiev   12
Caching


  If going to the database is so
   expensive...
   ... we should just avoid it!




                        JeeConf 2011 — Kiev   12
Caching


  If going to the database is so
   expensive...
   ... we should just avoid it!
  Put a cache in front of the
   database




                        JeeConf 2011 — Kiev   12
Caching


  If going to the database is so
   expensive...
   ... we should just avoid it!
  Put a cache in front of the
   database




                        JeeConf 2011 — Kiev   12
Caching


  If going to the database is so
   expensive...
   ... we should just avoid it!
  Put a cache in front of the
   database

  Data remains closer to
   processing unit



                        JeeConf 2011 — Kiev   12
Cache in front of the database




                    JeeConf 2011 — Kiev   13
Cache in front of the database




                                                RDBMS
                                                                  READ



 Helps   scale your read operations            Cache




                                                                READ




                                                 PowerBook G4




                          JeeConf 2011 — Kiev                            13
Cache in front of the database




                                                           RDBMS
                                                                             READ



 Helps   scale your read operations                       Cache


  – Writes   go directly to the database
                                                   WRITE


                                                                           READ




                                                            PowerBook G4




                             JeeConf 2011 — Kiev                                    13
SoR aware caching

 What  about multithreaded cache misses
 for a same key …
  – You   want to avoid hitting the system of record twice!
 SelfPopulating
               caches
 know how to fetch data on misses
  – Blocking concurrent accesses to missing keys
  – While only one thread populates the Cache
 But   what about invalidation ?




                             JeeConf 2011 — Kiev              14
Cache in front of the database




                    JeeConf 2011 — Kiev   15
Cache in front of the database




 Helps   scale your read operations




                          JeeConf 2011 — Kiev   15
Cache in front of the database




 Helps   scale your read operations
  – Writes   go directly to the database




                             JeeConf 2011 — Kiev   15
Cache in front of the database




 Helps   scale your read operations
  – Writes   go directly to the database
 Introducing   Cache Writers




                             JeeConf 2011 — Kiev   15
Cache in front of the database




 Helps   scale your read operations               WRITE   RDBMS
                                                                             READ



  – Writes   go directly to the database                   Cache


 Introducing   Cache Writers
  – Writes   are being done to the Cache           WRITE                   READ




                                                            PowerBook G4




                             JeeConf 2011 — Kiev                                    15
Write-through




                     RDBMS




                     Cache




                 Application
                   code




                JeeConf 2011 — Kiev
Write-through




                     RDBMS




                     Cache




                 Application
                   code




                JeeConf 2011 — Kiev
Write-through




                     RDBMS




                     Cache




                 Application
                   code




                JeeConf 2011 — Kiev
Write-through




                     RDBMS




                     Cache




                 Application
                   code




                JeeConf 2011 — Kiev
Write-behind




               JeeConf 2011 — Kiev   17
Write-behind


 Rather than write changes directly
 to the slowest participant




                        JeeConf 2011 — Kiev   17
Write-behind


 Rather than write changes directly
 to the slowest participant
  – Write   to faster durable store (persistent queue)




                             JeeConf 2011 — Kiev         17
Write-behind


 Rather than write changes directly
 to the slowest participant
  – Write   to faster durable store (persistent queue)
    •   required for recovery in the face of failure




                                   JeeConf 2011 — Kiev   17
Write-behind


 Rather than write changes directly
 to the slowest participant
  – Write   to faster durable store (persistent queue)
    •   required for recovery in the face of failure
  – Only    write to database later




                                   JeeConf 2011 — Kiev   17
Write-behind


 Rather than write changes directly
 to the slowest participant
  – Write   to faster durable store (persistent queue)
    •   required for recovery in the face of failure
  – Only    write to database later
    •   in batches and/or coalesced




                                   JeeConf 2011 — Kiev   17
Write-behind


 Rather than write changes directly
 to the slowest participant
  – Write      to faster durable store (persistent queue)
       •   required for recovery in the face of failure
  – Only       write to database later
       •   in batches and/or coalesced
 In
   a distributed environment handling failures
 we enforce happens at least once



                                      JeeConf 2011 — Kiev   17
Write-behind


 Rather than write changes directly
 to the slowest participant
  – Write      to faster durable store (persistent queue)
       •   required for recovery in the face of failure
  – Only       write to database later
       •   in batches and/or coalesced
 In
   a distributed environment handling failures
 we enforce happens at least once
  – loosens        the contract vs. "once and only once"!



                                      JeeConf 2011 — Kiev   17
Write-behind




                    RDBMS




                    Cache




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                    Cache            Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                                     Writer
                    Cache             Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




                    RDBMS




                                     Writer
                    Cache             Writer




                Application
                  code




               JeeConf 2011 — Kiev
Write-behind




               JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable




                        JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching   & Coalescing




                              JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching
           & Coalescing
  – Maximum delay between each write




                        JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching  & Coalescing
  – Maximum delay between each write
  – Limit the writes per seconds




                        JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching  & Coalescing
  – Maximum delay between each write
  – Limit the writes per seconds
  – Retry configuration




                        JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching  & Coalescing
  – Maximum delay between each write
  – Limit the writes per seconds
  – Retry configuration




                        JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching  & Coalescing
  – Maximum delay between each write
  – Limit the writes per seconds
  – Retry configuration


 New    as of Ehcache 2.4




                         JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching  & Coalescing
  – Maximum delay between each write
  – Limit the writes per seconds
  – Retry configuration


 New    as of Ehcache 2.4
  – writeBehindConcurrency="3"




                         JeeConf 2011 — Kiev   19
Write-behind


 Very   configurable
  – Batching  & Coalescing
  – Maximum delay between each write
  – Limit the writes per seconds
  – Retry configuration


 New    as of Ehcache 2.4
  – writeBehindConcurrency="3"
  – writeBehindMaxQueueSize="500"



                         JeeConf 2011 — Kiev   19
Scaling the database




                   JeeConf 2011 — Kiev   20
Scaling the database




                   JeeConf 2011 — Kiev   20
Scaling the cache




                    JeeConf 2011 — Kiev   21
Scaling the cache




                    JeeConf 2011 — Kiev   21
BigMemory




            JeeConf 2011 — Kiev   22
BigMemory

 OffHeap   storage
 – But   in process memory




                         JeeConf 2011 — Kiev   22
BigMemory

 OffHeap   storage
 – But   in process memory
 Uses   DirectByteBuffer




                            JeeConf 2011 — Kiev   22
BigMemory

 OffHeap    storage
  – But   in process memory
 Uses  DirectByteBuffer
 Faults unused elements out of heap,
  and in again, transparently
  – …and    from or to the disk store as well




                             JeeConf 2011 — Kiev   22
BigMemory

 OffHeap    storage
  – But   in process memory
 Uses  DirectByteBuffer
 Faults unused elements out of heap,
  and in again, transparently
  – …and    from or to the disk store as well
 Holds   hundreds of gigabytes of data
  – 320Gb    tested on a single machine




                             JeeConf 2011 — Kiev   22
Large data on a single VM




                   JeeConf 2011 — Kiev   23
Distributed Caching




                      JeeConf 2011 — Kiev   24
Distributed Caching


   What  if data isn't perfectly
   partitioned ?




                          JeeConf 2011 — Kiev   24
Distributed Caching


   What   if data isn't perfectly
    partitioned ?
   How do we keep this all
    in sync ?




                           JeeConf 2011 — Kiev   24
Distributed Caching


   What   if data isn't perfectly
    partitioned ?
   How do we keep this all
    in sync ?
   Peer-to-peer ?




                           JeeConf 2011 — Kiev   24
Distributed Caching




                      JeeConf 2011 — Kiev   25
Distributed Caching


   Cached  data remains
   close to the processing
   unit




                      JeeConf 2011 — Kiev   25
Distributed Caching


   Cached   data remains
    close to the processing
    unit
   Central unit
    orchestrates it all




                       JeeConf 2011 — Kiev   25
Distributed Caching




                      JeeConf 2011 — Kiev   26
Distributed Caching




                      JeeConf 2011 — Kiev   27
Distributed Caching




                      JeeConf 2011 — Kiev   28
DCV2




       JeeConf 2011 — Kiev   29
DCV2

 Simple   storage change in the cache config
  – <terracotta   storageStrategy=”DCV2” />




                            JeeConf 2011 — Kiev   29
DCV2

 Simple    storage change in the cache config
  – <terracotta   storageStrategy=”DCV2” />
 All   keys and values are stored on the server
  – With   a local cache (enabled by default)




                             JeeConf 2011 — Kiev   29
DCV2

 Simple    storage change in the cache config
  – <terracotta   storageStrategy=”DCV2” />
 All   keys and values are stored on the server
  – With   a local cache (enabled by default)
 With   a TSA
  – holds   Terabytes of data!




                             JeeConf 2011 — Kiev   29
Consistency considerations


From Happens-Before to ACID to 2PC and… back!
The ACID guarantees




                  JeeConf 2011 — Kiev   31
The ACID guarantees

 Let   people easily reason about the problem




                          JeeConf 2011 — Kiev    31
The ACID guarantees

 Letpeople easily reason about the problem
 Atomic
  – We   see all changes, or no changes at all




                            JeeConf 2011 — Kiev   31
The ACID guarantees

 Letpeople easily reason about the problem
 Atomic
  – We   see all changes, or no changes at all
 Consistent
  – Changes    respect our rules and constraints




                            JeeConf 2011 — Kiev    31
The ACID guarantees

 Letpeople easily reason about the problem
 Atomic
  – We   see all changes, or no changes at all
 Consistent
  – Changes    respect our rules and constraints
 Isolated
  – We   see all changes as independently happening




                            JeeConf 2011 — Kiev       31
The ACID guarantees

 Letpeople easily reason about the problem
 Atomic
  – We   see all changes, or no changes at all
 Consistent
  – Changes    respect our rules and constraints
 Isolated
  – We   see all changes as independently happening
 Durable
  – We   keep the effect of our changes forever



                            JeeConf 2011 — Kiev       31
The ACID guarantees

 Letpeople easily reason about the problem
 Atomic
  – We    see all changes, or no changes at all
 Consistent
  – Changes    respect our rules and constraints
 Isolated
  – We    see all changes as independently happening
 Durable
  – We    keep the effect of our changes forever
 Fits   a simplified model of our reality

                             JeeConf 2011 — Kiev       31
... and that’s what you get




                     JeeConf 2011 — Kiev   32
... and that’s what you get

 ...   when using Hibernate
   – Using  read-write strategy
   – Falls back to DB to resolve isolation level
   – Transactional leaves it to the cache to be ACI(D)
        •   And requires an XA environment, including all overhead!




                                    JeeConf 2011 — Kiev               32
... and that’s what you get

 ...   when using Hibernate
   – Using  read-write strategy
   – Falls back to DB to resolve isolation level
   – Transactional leaves it to the cache to be ACI(D)
        •   And requires an XA environment, including all overhead!
 But       using Ehcache API directly
   – Youget the JMM guarantees
   – Cached values are not inherently thread-safe




                                    JeeConf 2011 — Kiev               32
Basic tools




              JeeConf 2011 — Kiev   33
Basic tools

 Blocking   & SelfPopulatingCache constructs
  – Will
       not let multiple threads populate
   the cache with the same key




                          JeeConf 2011 — Kiev   33
Basic tools

 Blocking    & SelfPopulatingCache constructs
  – Willnot let multiple threads populate
    the cache with the same key
 Explicit   Locking API
  – acquire  ( Read | Write ) LockOnKey
  – releaseLockOnKey
  – try ( Read | Write ) LockOnKey




                           JeeConf 2011 — Kiev   33
Atomic Operations




                    JeeConf 2011 — Kiev   34
Atomic Operations

 Atomic   operations on Cache
  – putIfAbsent(Element): Element
  – removeElement(Element): Element
  – replace(Element, Element): boolean
  – replace(Element): boolean




                            JeeConf 2011 — Kiev   34
Atomic Operations

 Atomic    operations on Cache
  – putIfAbsent(Element): Element
  – removeElement(Element): Element
  – replace(Element, Element): boolean
  – replace(Element): boolean
 Copy    on read & copy on write caches
  – Configurable    per cache
        copyOnRead=”true” copyOnWrite=”false”
  – Configurable    CopyStrategy per caches
    •   Can be used with custom ElementValueComparator



                              JeeConf 2011 — Kiev        34
Transactional caches




                   JeeConf 2011 — Kiev   35
Transactional caches

 When   you need rollback!




                        JeeConf 2011 — Kiev   35
Transactional caches

 Whenyou need rollback!
 Comes in three flavors:
  – local
  – xa
  – xa_strict




                       JeeConf 2011 — Kiev   35
Transactional caches

 Whenyou need rollback!
 Comes in three flavors:
  – local
  – xa
  – xa_strict
 Very   simple configuration per Cache configuration
  –   transactionalMode=”local”




                              JeeConf 2011 — Kiev       35
Transactional caches

 Whenyou need rollback!
 Comes in three flavors:
  – local
  – xa
  – xa_strict
 Very   simple configuration per Cache configuration
  –   transactionalMode=”local”

 Only   accessible within a Transaction




                              JeeConf 2011 — Kiev       35
Transactional caches

 Whenyou need rollback!
 Comes in three flavors:
  – local
  – xa
  – xa_strict
 Very   simple configuration per Cache configuration
  –   transactionalMode=”local”

 Onlyaccessible within a Transaction
 They will copy on read and copy on write



                              JeeConf 2011 — Kiev       35
Transactional caches

 Whenyou need rollback!
 Comes in three flavors:
  – local
  – xa
  – xa_strict
 Very   simple configuration per Cache configuration
  –   transactionalMode=”local”

 Onlyaccessible within a Transaction
 They will copy on read and copy on write
 When clustered, cache must be coherent


                              JeeConf 2011 — Kiev       35
Local transaction




                    JeeConf 2011 — Kiev   36
Local transaction

 Cheap!




                    JeeConf 2011 — Kiev   36
Local transaction

 Cheap!
 Requires   you to do the demarcation




                         JeeConf 2011 — Kiev   36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();




                           JeeConf 2011 — Kiev        36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();
 transactionController.begin();




                           JeeConf 2011 — Kiev        36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();
 transactionController.begin();
 cache1 = cacheManager.getEhcache("txCache1");




                           JeeConf 2011 — Kiev        36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();
 transactionController.begin();
 cache1 = cacheManager.getEhcache("txCache1");
 cache1.put(new Element(1, putValue));




                           JeeConf 2011 — Kiev        36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();
 transactionController.begin();
 cache1 = cacheManager.getEhcache("txCache1");
 cache1.put(new Element(1, putValue));
 cache2 = cacheManager.getEhcache("txCache2");




                           JeeConf 2011 — Kiev        36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();
 transactionController.begin();
 cache1 = cacheManager.getEhcache("txCache1");
 cache1.put(new Element(1, putValue));
 cache2 = cacheManager.getEhcache("txCache2");
 cache2.remove(“key”);




                           JeeConf 2011 — Kiev        36
Local transaction

 Cheap!
 Requires   you to do the demarcation
 transactionController
         = cacheManager.getTransactionController();
 transactionController.begin();
 cache1 = cacheManager.getEhcache("txCache1");
 cache1.put(new Element(1, putValue));
 cache2 = cacheManager.getEhcache("txCache2");
 cache2.remove(“key”);
 transactionController.rollback();




                           JeeConf 2011 — Kiev        36
XA Caches




            JeeConf 2011 — Kiev   37
XA Caches

   What for ?
    –   Synchronicity of data between
        Ehcache & other XA resources is guaranteed




                                 JeeConf 2011 — Kiev   37
XA Caches

   What for ?
    –   Synchronicity of data between
        Ehcache & other XA resources is guaranteed
   How ?
    –   Two phase commit




                                 JeeConf 2011 — Kiev   37
XA Caches

   What for ?
    –   Synchronicity of data between
        Ehcache & other XA resources is guaranteed
   How ?
    –   Two phase commit
   Java Transaction API to the rescue !
    – JSR907 / Direct port of the X/Open XA standard
    – JTA is about reading and writing transactionally into multiple
      resources:
        • databases JMS servers,
        • caches,
        • or whatever is used to store or transport data

    –   The transaction manager manages and drives XA resources

                                        JeeConf 2011 — Kiev            37
XA Caches




            JeeConf 2011 — Kiev   38
XA Caches

 READ_COMMITED   isolation level




                    JeeConf 2011 — Kiev   38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :




                        JeeConf 2011 — Kiev   38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure   the TransactionManager out




                           JeeConf 2011 — Kiev   38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically




                           JeeConf 2011 — Kiev   38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically
  – Only be accessible within an inflight Transaction




                           JeeConf 2011 — Kiev          38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically
  – Only be accessible within an inflight Transaction
 XA




                           JeeConf 2011 — Kiev          38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically
  – Only be accessible within an inflight Transaction
 XA
  – Will   synchronize on the inflight XA Transaction




                             JeeConf 2011 — Kiev        38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically
  – Only be accessible within an inflight Transaction
 XA
  – Will   synchronize on the inflight XA Transaction
 XA_STRICT




                             JeeConf 2011 — Kiev        38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically
  – Only be accessible within an inflight Transaction
 XA
  – Will   synchronize on the inflight XA Transaction
 XA_STRICT
  – Will   register a full blown XAResource with the TX



                             JeeConf 2011 — Kiev          38
XA Caches

 READ_COMMITED      isolation level
 Transactional Caches will :
  – Figure  the TransactionManager out
  – Enlist in the Transaction automagically
  – Only be accessible within an inflight Transaction
 XA
  – Will   synchronize on the inflight XA Transaction
 XA_STRICT
  – Will   register a full blown XAResource with the TX
    •   Including support for recovery


                                 JeeConf 2011 — Kiev      38
Sometimes,... you want less consistency




                    JeeConf 2011 — Kiev   39
Sometimes,... you want less consistency

 When    clustered, consistency comes at prices
 – That   you might not always want to pay




                           JeeConf 2011 — Kiev     39
Sometimes,... you want less consistency

 When     clustered, consistency comes at prices
  – That   you might not always want to pay
 Introducing     eventual consistency
  – No  lock involved
  – Client sends
    •   updates asynchronously
    •   send as batches to the server
  – Other client knowing about the value for a key,
   gets the updates pushed to by the server
    •   Might see stale values for some milliseconds from local cache




                                 JeeConf 2011 — Kiev                    39
Consistency types for clustered caches




                    JeeConf 2011 — Kiev   40
Consistency types for clustered caches

 Also   configurable per cache
  – Strong(JMM)
  – Eventual consistency
    •   Will use the local cached value




                                 JeeConf 2011 — Kiev   40
Consistency types for clustered caches

 Also   configurable per cache
  – Strong(JMM)
  – Eventual consistency
    •   Will use the local cached value
 Non-stop      caches
  – Lets   you configure
    •   Timeout on caches
    •   Timeout behavior
         – noop
         – exception
         – local read




                                 JeeConf 2011 — Kiev   40
Consistency types for clustered caches

 Also   configurable per cache
  – Strong(JMM)
  – Eventual consistency
    •   Will use the local cached value
 Non-stop      caches
  – Lets   you configure
    •   Timeout on caches
    •   Timeout behavior
         – noop
         – exception
         – local read
 Rejoin

                                 JeeConf 2011 — Kiev   40
Where’s my data ?!


… when key lookup isn’t enough
Key / Value




              JeeConf 2011 — Kiev   42
Key / Value

 Sometimes  retrieving values only based on a key
 isn’t enough, because
 – You don’t know the key
 – The key / value paradigm simply doesn’t apply




                         JeeConf 2011 — Kiev         42
Key / Value

 Sometimes  retrieving values only based on a key
 isn’t enough, because
  – You don’t know the key
  – The key / value paradigm simply doesn’t apply
 Giventhe amount of data now storable
 Search was just the natural next step...




                          JeeConf 2011 — Kiev        42
Introducing Ehcache Search




                   JeeConf 2011 — Kiev   43
Introducing Ehcache Search

   Ehcache Search is a querying capability
    built into the core OSS Ehcache API




                           JeeConf 2011 — Kiev   43
Introducing Ehcache Search

 Ehcache Search is a querying capability
  built into the core OSS Ehcache API
 Provides fast,
  flexible access to every aspect of your in-memory data




                         JeeConf 2011 — Kiev               43
Introducing Ehcache Search

 Ehcache Search is a querying capability
  built into the core OSS Ehcache API
 Provides fast,
  flexible access to every aspect of your in-memory data
 Offloads queries from the database
  reducing the DB’s role as a bottleneck
    –   Or adds search-ability to data that wasn’t before, like WS




                                 JeeConf 2011 — Kiev                 43
Introducing Ehcache Search

 Ehcache Search is a querying capability
  built into the core OSS Ehcache API
 Provides fast,
  flexible access to every aspect of your in-memory data
 Offloads queries from the database
  reducing the DB’s role as a bottleneck
    –   Or adds search-ability to data that wasn’t before, like WS
   Improves application performance/latency




                                 JeeConf 2011 — Kiev                 43
Introducing Ehcache Search

 Ehcache Search is a querying capability
  built into the core OSS Ehcache API
 Provides fast,
  flexible access to every aspect of your in-memory data
 Offloads queries from the database
  reducing the DB’s role as a bottleneck
    –   Or adds search-ability to data that wasn’t before, like WS
 Improves application performance/latency
 Works efficiently when standalone




                                 JeeConf 2011 — Kiev                 43
Introducing Ehcache Search

 Ehcache Search is a querying capability
  built into the core OSS Ehcache API
 Provides fast,
  flexible access to every aspect of your in-memory data
 Offloads queries from the database
  reducing the DB’s role as a bottleneck
    –   Or adds search-ability to data that wasn’t before, like WS
 Improves application performance/latency
 Works efficiently when standalone
 Scales out linearly with your data when distributed
  (O(Log n)/Server Count) without code changes

                                 JeeConf 2011 — Kiev                 43
Two key concepts in search




                   JeeConf 2011 — Kiev   44
Two key concepts in search

 Attributes
  – What   can be searched




                             JeeConf 2011 — Kiev   44
Two key concepts in search

 Attributes
  – What   can be searched
 Queries
  – FluentObject Oriented interface
   used for searching the cache
   leveraging the defined Attributes




                             JeeConf 2011 — Kiev   44
Attributes




             JeeConf 2011 — Kiev   45
Attributes

 Definition   Types




                       JeeConf 2011 — Kiev   45
Attributes

 Definition   Types
  – Beanattributes
   Bean style properties on the key or value




                          JeeConf 2011 — Kiev   45
Attributes

 Definition   Types
  – Bean attributes
    Bean style properties on the key or value
  – Expressions
    Method calls and/or field accesses




                          JeeConf 2011 — Kiev   45
Attributes

 Definition   Types
  – Bean  attributes
    Bean style properties on the key or value
  – Expressions
    Method calls and/or field accesses
  – Custom Extractors
    A user defined class
    that can extract what ever you need for searching




                          JeeConf 2011 — Kiev           45
Attributes

 Definition   Types
  – Bean  attributes
    Bean style properties on the key or value
  – Expressions
    Method calls and/or field accesses
  – Custom Extractors
    A user defined class
    that can extract what ever you need for searching
 Definition   Styles



                          JeeConf 2011 — Kiev           45
Attributes

 Definition   Types
  – Bean  attributes
    Bean style properties on the key or value
  – Expressions
    Method calls and/or field accesses
  – Custom Extractors
    A user defined class
    that can extract what ever you need for searching
 Definition   Styles
  – XML




                          JeeConf 2011 — Kiev           45
Attributes

 Definition   Types
  – Bean  attributes
    Bean style properties on the key or value
  – Expressions
    Method calls and/or field accesses
  – Custom Extractors
    A user defined class
    that can extract what ever you need for searching
 Definition   Styles
  – XML
  – Code


                          JeeConf 2011 — Kiev           45
Attribute definition

   XML
    <searchable>
        <!-- Bean style spec -->
        <searchAttribute name="age" />
        <!-- Expression style spec -->
        <searchAttribute name="gender"
                         expression="value.getGender()" />
        <!-- Custom Extractor style spec -->
        <searchAttribute
                    name="name"
                    class="com.company.NameAttributeExtractor" />
    </searchable>




                              JeeConf 2011 — Kiev                   46
Queries




          JeeConf 2011 — Kiev   47
Queries

   A fluent object oriented interface
    based on the defined Attributes.




                             JeeConf 2011 — Kiev   47
Queries

 A fluent object oriented interface
  based on the defined Attributes.
 Aggregate
    –   Sum, Average, Min, Max, Count




                              JeeConf 2011 — Kiev   47
Queries

 A fluent object oriented interface
  based on the defined Attributes.
 Aggregate
    –   Sum, Average, Min, Max, Count
   Match
    –   ilike, eq, between, gt, lt, between etc




                                  JeeConf 2011 — Kiev   47
Queries

 A fluent object oriented interface
  based on the defined Attributes.
 Aggregate
    –   Sum, Average, Min, Max, Count
   Match
    –   ilike, eq, between, gt, lt, between etc
   Logical Operators
    –   and, or, not




                                  JeeConf 2011 — Kiev   47
Queries

 A fluent object oriented interface
  based on the defined Attributes.
 Aggregate
    –   Sum, Average, Min, Max, Count
   Match
    –   ilike, eq, between, gt, lt, between etc
   Logical Operators
    –   and, or, not
   Result Set Control
    –   Ascending vs descending, max object counts,
        include keys/values, ranges

                                  JeeConf 2011 — Kiev   47
When moving data is not a good idea!


Sending the work to data
Introducing Quartz Scheduler




                   JeeConf 2011 — Kiev   49
Introducing Quartz Scheduler

 Lets   you schedule asynchronous jobs




                         JeeConf 2011 — Kiev   49
Introducing Quartz Scheduler

 Lets you schedule asynchronous jobs
 De facto scheduler for the Java Platform




                        JeeConf 2011 — Kiev   49
Introducing Quartz Scheduler

 Lets you schedule asynchronous jobs
 De facto scheduler for the Java Platform
 Easily clusterable using Terracotta
  – Share  scheduler across Cluster
  – Persistent storage for your jobs




                           JeeConf 2011 — Kiev   49
One simple API




                 JeeConf 2011 — Kiev
One simple API

   Job
    – Actual Job implementation
    – Defines what to execute
    – Think the script for a cron entry




                               JeeConf 2011 — Kiev
One simple API

   Job
    – Actual Job implementation
    – Defines what to execute
    – Think the script for a cron entry



        public class MyJob implements Job {
          public void execute(final JobExecutionContext context)
              throws JobExecutionException {
            // Do the actual work
          }
        }




                                JeeConf 2011 — Kiev
One simple API

   Job
    – Actual Job implementation
    – Defines what to execute
    – Think the script for a cron entry
   Triggers
    – Fire the Job for execution
    – Defines when to execute
    – Think the actual cron expression




                               JeeConf 2011 — Kiev
One simple API

   Job
    – Actual Job implementation
    – Defines what to execute
    – Think the script for a cron entry
   Triggers
    – Fire the Job for execution
    – Defines when to execute
    – Think the actual cron expression
   Single API
    – To schedule Jobs & Triggers
    – That actually executes these Jobs


                               JeeConf 2011 — Kiev
Quartz Where & Ehcache

                                                 JVM


 JVM




                                                 JVM

              SchedulerThread




                                                 JVM




                           JeeConf 2011 — Kiev
Quartz Where & Ehcache

                                                              JVM


 JVM




                                                              JVM

                           SchedulerThread




  scheduler.scheduleJob(job, trigger);

                                                              JVM




                                        JeeConf 2011 — Kiev
Quartz Where & Ehcache

                                                 JVM


 JVM




                                                 JVM

              SchedulerThread




                                                 JVM




                           JeeConf 2011 — Kiev
Quartz Where & Ehcache

                                                 JVM


 JVM

                                                       L1




                                                 JVM

              SchedulerThread

                                                       L1




                                                 JVM




                                                       L1




                           JeeConf 2011 — Kiev
Quartz Where & Ehcache

                                                 JVM


 JVM

                                                       L1




                                                 JVM

              SchedulerThread

                                                       L1




                                                 JVM




                                                       L1




                           JeeConf 2011 — Kiev
Quartz Where & Ehcache

                                                 JVM


 JVM

                                                       L1




                                                 JVM

              SchedulerThread

                                                       L1




                                                 JVM




                                                       L1




                           JeeConf 2011 — Kiev
I know… it’s late now!


So, in summary
Summary




          JeeConf 2011 — Kiev   53
Summary

   Ehcache




              JeeConf 2011 — Kiev   53
Summary

   Ehcache
    –   Scales your system of record today




                                JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!




                              JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta




                              JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    –   Scales your cache when it needs it




                                JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    – Scales your cache when it needs it
    – Whether




                              JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    – Scales your cache when it needs it
    – Whether
        •   In terms of data sizes




                                     JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    – Scales your cache when it needs it
    – Whether
        • In terms of data sizes
        • Processing power




                                   JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    – Scales your cache when it needs it
    – Whether
        • In terms of data sizes
        • Processing power
        • Redundancy




                                   JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    – Scales your cache when it needs it
    – Whether
        • In terms of data sizes
        • Processing power
        • Redundancy
        • Persistency




                                   JeeConf 2011 — Kiev   53
Summary

   Ehcache
    – Scales your system of record today
    – Easily!
   Terracotta
    – Scales your cache when it needs it
    – Whether
        • In terms of data sizes
        • Processing power
        • Redundancy
        • Persistency

   All these features available
    with a couple lines of configuration only

                                   JeeConf 2011 — Kiev   53
ehcache | ehcache.org
            quartz | quartz-scheduler.org
        terracotta | terracotta.org




Thank you !
ehcache | ehcache.org
    quartz | quartz-scheduler.org
terracotta | terracotta.org




   twitter | @alexsnaps
    email | alexsnaps@terracotta.org
     blog | www.codespot.net
ehcache | ehcache.org
    quartz | quartz-scheduler.org
terracotta | terracotta.org




   twitter | @alexsnaps
    email | alexsnaps@terracotta.org
     blog | www.codespot.net

Más contenido relacionado

La actualidad más candente

Oracle Database on Docker - Best Practices
Oracle Database on Docker - Best PracticesOracle Database on Docker - Best Practices
Oracle Database on Docker - Best Practicesgvenzl
 
Apache Hive 2.0 SQL, Speed, Scale by Alan Gates
Apache Hive 2.0 SQL, Speed, Scale by Alan GatesApache Hive 2.0 SQL, Speed, Scale by Alan Gates
Apache Hive 2.0 SQL, Speed, Scale by Alan GatesBig Data Spain
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...David Buck
 
Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0DataWorks Summit
 
Evolving Archetecture
Evolving ArchetectureEvolving Archetecture
Evolving Archetectureleo lapworth
 
Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0DataWorks Summit
 
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]David Buck
 
Operations for databases – The DevOps journey
Operations for databases – The DevOps journey Operations for databases – The DevOps journey
Operations for databases – The DevOps journey Eduardo Piairo
 
PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment
PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment
PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment PROIDEA
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Heather VanCura
 
Breathing New Life into Apache Oozie with Apache Ambari Workflow Manager
Breathing New Life into Apache Oozie with Apache Ambari Workflow ManagerBreathing New Life into Apache Oozie with Apache Ambari Workflow Manager
Breathing New Life into Apache Oozie with Apache Ambari Workflow ManagerDataWorks Summit
 
Riak - From Small to Large
Riak - From Small to LargeRiak - From Small to Large
Riak - From Small to LargeRusty Klophaus
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture stylesAraf Karsh Hamid
 

La actualidad más candente (20)

Modern Data Architecture
Modern Data ArchitectureModern Data Architecture
Modern Data Architecture
 
Oracle Database on Docker - Best Practices
Oracle Database on Docker - Best PracticesOracle Database on Docker - Best Practices
Oracle Database on Docker - Best Practices
 
Apache Hive 2.0 SQL, Speed, Scale by Alan Gates
Apache Hive 2.0 SQL, Speed, Scale by Alan GatesApache Hive 2.0 SQL, Speed, Scale by Alan Gates
Apache Hive 2.0 SQL, Speed, Scale by Alan Gates
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
 
Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0
 
DevOps tools for winning agility
DevOps tools for winning agilityDevOps tools for winning agility
DevOps tools for winning agility
 
Evolving Archetecture
Evolving ArchetectureEvolving Archetecture
Evolving Archetecture
 
Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0Meet HBase 2.0 and Phoenix 5.0
Meet HBase 2.0 and Phoenix 5.0
 
Running Apache Spark & Apache Zeppelin in Production
Running Apache Spark & Apache Zeppelin in ProductionRunning Apache Spark & Apache Zeppelin in Production
Running Apache Spark & Apache Zeppelin in Production
 
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
 
Operations for databases – The DevOps journey
Operations for databases – The DevOps journey Operations for databases – The DevOps journey
Operations for databases – The DevOps journey
 
What is Delphix
What is DelphixWhat is Delphix
What is Delphix
 
PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment
PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment
PLNOG 9: Ron Broersma - Enterprise IPv6 Deployment
 
Apache Nifi Crash Course
Apache Nifi Crash CourseApache Nifi Crash Course
Apache Nifi Crash Course
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374
 
Breathing New Life into Apache Oozie with Apache Ambari Workflow Manager
Breathing New Life into Apache Oozie with Apache Ambari Workflow ManagerBreathing New Life into Apache Oozie with Apache Ambari Workflow Manager
Breathing New Life into Apache Oozie with Apache Ambari Workflow Manager
 
Riak - From Small to Large
Riak - From Small to LargeRiak - From Small to Large
Riak - From Small to Large
 
Apache Hive 2.0: SQL, Speed, Scale
Apache Hive 2.0: SQL, Speed, ScaleApache Hive 2.0: SQL, Speed, Scale
Apache Hive 2.0: SQL, Speed, Scale
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture styles
 
Pratyusa_Resume
Pratyusa_ResumePratyusa_Resume
Pratyusa_Resume
 

Destacado

Část plánu využití rádiového spektra pro kmitočtové pásmo 174 – 380 MHz .
Část plánu využití rádiového spektra pro kmitočtové pásmo  174 – 380 MHz .Část plánu využití rádiového spektra pro kmitočtové pásmo  174 – 380 MHz .
Část plánu využití rádiového spektra pro kmitočtové pásmo 174 – 380 MHz .Jan Brychta
 
To be relational, or not to be relational? That's NOT the question!
To be relational, or not to be relational? That's NOT the question!To be relational, or not to be relational? That's NOT the question!
To be relational, or not to be relational? That's NOT the question!Sergio Bossa
 
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
 New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S... New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...Big Data Spain
 
In-Memory Database Platform for Big Data
In-Memory Database Platform for Big DataIn-Memory Database Platform for Big Data
In-Memory Database Platform for Big DataSAP Technology
 

Destacado (8)

Část plánu využití rádiového spektra pro kmitočtové pásmo 174 – 380 MHz .
Část plánu využití rádiového spektra pro kmitočtové pásmo  174 – 380 MHz .Část plánu využití rádiového spektra pro kmitočtové pásmo  174 – 380 MHz .
Část plánu využití rádiového spektra pro kmitočtové pásmo 174 – 380 MHz .
 
To be relational, or not to be relational? That's NOT the question!
To be relational, or not to be relational? That's NOT the question!To be relational, or not to be relational? That's NOT the question!
To be relational, or not to be relational? That's NOT the question!
 
The BigMemory Revolution in Financial Services
The BigMemory Revolution in Financial ServicesThe BigMemory Revolution in Financial Services
The BigMemory Revolution in Financial Services
 
Terracotta Ditch the Disk webcast
Terracotta Ditch the Disk webcastTerracotta Ditch the Disk webcast
Terracotta Ditch the Disk webcast
 
5 Ways to Boost E-Commerce Site Performance with BigMemory
5 Ways to Boost E-Commerce Site Performance with BigMemory5 Ways to Boost E-Commerce Site Performance with BigMemory
5 Ways to Boost E-Commerce Site Performance with BigMemory
 
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
 New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S... New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
 
Ehcache Writer API
Ehcache Writer APIEhcache Writer API
Ehcache Writer API
 
In-Memory Database Platform for Big Data
In-Memory Database Platform for Big DataIn-Memory Database Platform for Big Data
In-Memory Database Platform for Big Data
 

Similar a Alex Snaps JEEConf Presentation

HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...
HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...
HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...Cloudera, Inc.
 
Is Enterprise Java Still Relevant (JavaOne 2015 session)
Is Enterprise Java Still Relevant (JavaOne 2015 session)Is Enterprise Java Still Relevant (JavaOne 2015 session)
Is Enterprise Java Still Relevant (JavaOne 2015 session)Ian Robinson
 
Ensuring Quality in Data Lakes (D&D Meetup Feb 22)
Ensuring Quality in Data Lakes  (D&D Meetup Feb 22)Ensuring Quality in Data Lakes  (D&D Meetup Feb 22)
Ensuring Quality in Data Lakes (D&D Meetup Feb 22)lakeFS
 
Phoenix for Rubyists
Phoenix for RubyistsPhoenix for Rubyists
Phoenix for RubyistsDoug Goldie
 
java web framework standard.20180412
java web framework standard.20180412java web framework standard.20180412
java web framework standard.20180412FirmansyahIrma1
 
Log everything!
Log everything!Log everything!
Log everything!ICANS GmbH
 
What's new in Nuxeo 5.2? - Solutions Linux 2009
What's new in Nuxeo 5.2? - Solutions Linux 2009What's new in Nuxeo 5.2? - Solutions Linux 2009
What's new in Nuxeo 5.2? - Solutions Linux 2009Stefane Fermigier
 
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
 Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ... Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...MayaData Inc
 
High Performance Php My Sql Scaling Techniques
High Performance Php My Sql Scaling TechniquesHigh Performance Php My Sql Scaling Techniques
High Performance Php My Sql Scaling TechniquesZendCon
 
StackEngine Demo - Docker Austin
StackEngine Demo - Docker AustinStackEngine Demo - Docker Austin
StackEngine Demo - Docker AustinBoyd Hemphill
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
 
Instantaneous Replication of Build Artifacts with NetApp
Instantaneous Replication of Build Artifacts with NetAppInstantaneous Replication of Build Artifacts with NetApp
Instantaneous Replication of Build Artifacts with NetAppNetApp
 
jVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by SchoginijVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by SchoginiSchogini Systems Pvt Ltd
 
All Aboard the Databus
All Aboard the DatabusAll Aboard the Databus
All Aboard the DatabusAmy W. Tang
 
Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014Nuxeo
 
Machine Learning Platform in LINE Fukuoka
Machine Learning Platform in LINE FukuokaMachine Learning Platform in LINE Fukuoka
Machine Learning Platform in LINE FukuokaLINE Corporation
 

Similar a Alex Snaps JEEConf Presentation (20)

HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...
HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...
HBaseCon 2013: Apache Drill - A Community-driven Initiative to Deliver ANSI S...
 
Is Enterprise Java Still Relevant (JavaOne 2015 session)
Is Enterprise Java Still Relevant (JavaOne 2015 session)Is Enterprise Java Still Relevant (JavaOne 2015 session)
Is Enterprise Java Still Relevant (JavaOne 2015 session)
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Ensuring Quality in Data Lakes (D&D Meetup Feb 22)
Ensuring Quality in Data Lakes  (D&D Meetup Feb 22)Ensuring Quality in Data Lakes  (D&D Meetup Feb 22)
Ensuring Quality in Data Lakes (D&D Meetup Feb 22)
 
Phoenix for Rubyists
Phoenix for RubyistsPhoenix for Rubyists
Phoenix for Rubyists
 
java web framework standard.20180412
java web framework standard.20180412java web framework standard.20180412
java web framework standard.20180412
 
Log everything!
Log everything!Log everything!
Log everything!
 
What's new in Nuxeo 5.2? - Solutions Linux 2009
What's new in Nuxeo 5.2? - Solutions Linux 2009What's new in Nuxeo 5.2? - Solutions Linux 2009
What's new in Nuxeo 5.2? - Solutions Linux 2009
 
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
 Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ... Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
 
High Performance Php My Sql Scaling Techniques
High Performance Php My Sql Scaling TechniquesHigh Performance Php My Sql Scaling Techniques
High Performance Php My Sql Scaling Techniques
 
StackEngine Demo - Docker Austin
StackEngine Demo - Docker AustinStackEngine Demo - Docker Austin
StackEngine Demo - Docker Austin
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Ceph
CephCeph
Ceph
 
Instantaneous Replication of Build Artifacts with NetApp
Instantaneous Replication of Build Artifacts with NetAppInstantaneous Replication of Build Artifacts with NetApp
Instantaneous Replication of Build Artifacts with NetApp
 
jVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by SchoginijVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by Schogini
 
All Aboard the Databus
All Aboard the DatabusAll Aboard the Databus
All Aboard the Databus
 
Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014
 
NetBeans 6.5
NetBeans 6.5NetBeans 6.5
NetBeans 6.5
 
Apache NiFi Crash Course Intro
Apache NiFi Crash Course IntroApache NiFi Crash Course Intro
Apache NiFi Crash Course Intro
 
Machine Learning Platform in LINE Fukuoka
Machine Learning Platform in LINE FukuokaMachine Learning Platform in LINE Fukuoka
Machine Learning Platform in LINE Fukuoka
 

Último

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Último (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Alex Snaps JEEConf Presentation

  • 1. Scaling up & out with Ehcache and Terracotta Alex Snaps Senior Software Engineer — Terracotta, Inc.
  • 2. What’s this all about ? Rethink caching, rethink access patterns and, finally … Know what solution is right for your application to deal with lots of data !
  • 3. Agenda  Ehcache ? Terracotta ?  Data access patterns revisited  Scaling Up vs. Out  Consistency consideration  Search  Inversion of control (sort of!) Q&A JeeConf 2011 — Kiev 3
  • 4. Who’s who ? … on Ehcache, Terracotta and… last & least, me.
  • 5. Ehcache JeeConf 2011 — Kiev 5
  • 6. Ehcache  The most widely used performance library in Java – Used in over 70 percent of enterprise Java applications – 200k + production deployments – Embedded in most popular Java frameworks/apps. Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails... JeeConf 2011 — Kiev 5
  • 7. Ehcache  The most widely used performance library in Java – Used in over 70 percent of enterprise Java applications – 200k + production deployments – Embedded in most popular Java frameworks/apps. Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...  Fast JeeConf 2011 — Kiev 5
  • 8. Ehcache  The most widely used performance library in Java – Used in over 70 percent of enterprise Java applications – 200k + production deployments – Embedded in most popular Java frameworks/apps. Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...  Fast  Lightweight – Less than 1 MB – Easy to use API JeeConf 2011 — Kiev 5
  • 9. Ehcache  The most widely used performance library in Java – Used in over 70 percent of enterprise Java applications – 200k + production deployments – Embedded in most popular Java frameworks/apps. Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...  Fast  Lightweight – Less than 1 MB – Easy to use API  Grows with your application with only two lines of configuration – Scale Up - BigMemory (100’s of Gig, in process, NO GC) – Scale Out - Clustering Platform (Up to 2 Terabytes, HA) JeeConf 2011 — Kiev 5
  • 10. Ehcache  The most widely used performance library in Java – Used in over 70 percent of enterprise Java applications – 200k + production deployments – Embedded in most popular Java frameworks/apps. Hibernate, Spring, Liferay, JIRA, ColdFusion, Grails...  Fast  Lightweight – Less than 1 MB – Easy to use API  Grows with your application with only two lines of configuration – Scale Up - BigMemory (100’s of Gig, in process, NO GC) – Scale Out - Clustering Platform (Up to 2 Terabytes, HA)  Fully backward compatible all the way back to 1.x JeeConf 2011 — Kiev 5
  • 11. Terracotta JeeConf 2011 — Kiev 6
  • 12. Terracotta  Founded 2003 in San Francisco, CA JeeConf 2011 — Kiev 6
  • 13. Terracotta  Founded 2003 in San Francisco, CA  Present in India, Europe and pretty much all over the globe! JeeConf 2011 — Kiev 6
  • 14. Terracotta  Founded 2003 in San Francisco, CA  Present in India, Europe and pretty much all over the globe!  Open source project that delivers Enterprise Java application scalability and availability JeeConf 2011 — Kiev 6
  • 15. Terracotta  Founded 2003 in San Francisco, CA  Present in India, Europe and pretty much all over the globe!  Open source project that delivers Enterprise Java application scalability and availability  Products around : – Ehcache & Hibernate – Quartz Scheduler – Web Sessions – Terracotta Toolkit JeeConf 2011 — Kiev 6
  • 16. About me … JeeConf 2011 — Kiev 7
  • 17. About me …  Senior Software Engineer at Terracotta – Working on Ehcache & Terracotta integration, – Quartz Enterprise Scheduler, – Terracotta toolkit JeeConf 2011 — Kiev 7
  • 18. About me …  Senior Software Engineer at Terracotta – Working on Ehcache & Terracotta integration, – Quartz Enterprise Scheduler, – Terracotta toolkit  Contributed to – Hibernate – Unitils & dbMaintain – ... and a couple of long forgotten open source projects JeeConf 2011 — Kiev 7
  • 19. About me …  Senior Software Engineer at Terracotta – Working on Ehcache & Terracotta integration, – Quartz Enterprise Scheduler, – Terracotta toolkit  Contributed to – Hibernate – Unitils & dbMaintain – ... and a couple of long forgotten open source projects  Speak at JUGs & conferences – like Codemotion, jFokus, JavaOne, JavaZone, Devoxx, Jazoon, ... JeeConf 2011 — Kiev 7
  • 20. Now to the fun part! Data access patterns revisited
  • 21. Big Data ? JeeConf 2011 — Kiev 9
  • 22. Big Data ?  What's Big Data for you? JeeConf 2011 — Kiev 9
  • 23. Big Data ?  What's Big Data for you?  Not a question of quantity. JeeConf 2011 — Kiev 9
  • 24. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? JeeConf 2011 — Kiev 9
  • 25. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? JeeConf 2011 — Kiev 9
  • 26. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? – Petabytes? JeeConf 2011 — Kiev 9
  • 27. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? – Petabytes?  It's all about supporting your business growth. JeeConf 2011 — Kiev 9
  • 28. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? – Petabytes?  It's all about supporting your business growth. – Growth in terms of schema evolution. JeeConf 2011 — Kiev 9
  • 29. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? – Petabytes?  It's all about supporting your business growth. – Growth in terms of schema evolution. – Growth in terms of data storage. JeeConf 2011 — Kiev 9
  • 30. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? – Petabytes?  It's all about supporting your business growth. – Growth in terms of schema evolution. – Growth in terms of data storage.  Growth in terms of data processing. JeeConf 2011 — Kiev 9
  • 31. Big Data ?  What's Big Data for you?  Not a question of quantity. – Gigabytes? – Terabytes? – Petabytes?  It's all about supporting your business growth. – Growth in terms of schema evolution. – Growth in terms of data storage.  Growth in terms of data processing.  Is your data stack capable of handling such a growth? JeeConf 2011 — Kiev 9
  • 32. Where’s all that data ? Relational databases & friends
  • 33. How do you access your database ? JeeConf 2011 — Kiev 11
  • 34. How do you access your database ? JeeConf 2011 — Kiev 11
  • 35. Caching JeeConf 2011 — Kiev 12
  • 36. Caching  If going to the database is so expensive... ... we should just avoid it! JeeConf 2011 — Kiev 12
  • 37. Caching  If going to the database is so expensive... ... we should just avoid it!  Put a cache in front of the database JeeConf 2011 — Kiev 12
  • 38. Caching  If going to the database is so expensive... ... we should just avoid it!  Put a cache in front of the database JeeConf 2011 — Kiev 12
  • 39. Caching  If going to the database is so expensive... ... we should just avoid it!  Put a cache in front of the database  Data remains closer to processing unit JeeConf 2011 — Kiev 12
  • 40. Cache in front of the database JeeConf 2011 — Kiev 13
  • 41. Cache in front of the database RDBMS READ  Helps scale your read operations Cache READ PowerBook G4 JeeConf 2011 — Kiev 13
  • 42. Cache in front of the database RDBMS READ  Helps scale your read operations Cache – Writes go directly to the database WRITE READ PowerBook G4 JeeConf 2011 — Kiev 13
  • 43. SoR aware caching  What about multithreaded cache misses for a same key … – You want to avoid hitting the system of record twice!  SelfPopulating caches know how to fetch data on misses – Blocking concurrent accesses to missing keys – While only one thread populates the Cache  But what about invalidation ? JeeConf 2011 — Kiev 14
  • 44. Cache in front of the database JeeConf 2011 — Kiev 15
  • 45. Cache in front of the database  Helps scale your read operations JeeConf 2011 — Kiev 15
  • 46. Cache in front of the database  Helps scale your read operations – Writes go directly to the database JeeConf 2011 — Kiev 15
  • 47. Cache in front of the database  Helps scale your read operations – Writes go directly to the database  Introducing Cache Writers JeeConf 2011 — Kiev 15
  • 48. Cache in front of the database  Helps scale your read operations WRITE RDBMS READ – Writes go directly to the database Cache  Introducing Cache Writers – Writes are being done to the Cache WRITE READ PowerBook G4 JeeConf 2011 — Kiev 15
  • 49. Write-through RDBMS Cache Application code JeeConf 2011 — Kiev
  • 50. Write-through RDBMS Cache Application code JeeConf 2011 — Kiev
  • 51. Write-through RDBMS Cache Application code JeeConf 2011 — Kiev
  • 52. Write-through RDBMS Cache Application code JeeConf 2011 — Kiev
  • 53. Write-behind JeeConf 2011 — Kiev 17
  • 54. Write-behind  Rather than write changes directly to the slowest participant JeeConf 2011 — Kiev 17
  • 55. Write-behind  Rather than write changes directly to the slowest participant – Write to faster durable store (persistent queue) JeeConf 2011 — Kiev 17
  • 56. Write-behind  Rather than write changes directly to the slowest participant – Write to faster durable store (persistent queue) • required for recovery in the face of failure JeeConf 2011 — Kiev 17
  • 57. Write-behind  Rather than write changes directly to the slowest participant – Write to faster durable store (persistent queue) • required for recovery in the face of failure – Only write to database later JeeConf 2011 — Kiev 17
  • 58. Write-behind  Rather than write changes directly to the slowest participant – Write to faster durable store (persistent queue) • required for recovery in the face of failure – Only write to database later • in batches and/or coalesced JeeConf 2011 — Kiev 17
  • 59. Write-behind  Rather than write changes directly to the slowest participant – Write to faster durable store (persistent queue) • required for recovery in the face of failure – Only write to database later • in batches and/or coalesced  In a distributed environment handling failures we enforce happens at least once JeeConf 2011 — Kiev 17
  • 60. Write-behind  Rather than write changes directly to the slowest participant – Write to faster durable store (persistent queue) • required for recovery in the face of failure – Only write to database later • in batches and/or coalesced  In a distributed environment handling failures we enforce happens at least once – loosens the contract vs. "once and only once"! JeeConf 2011 — Kiev 17
  • 61. Write-behind RDBMS Cache Application code JeeConf 2011 — Kiev
  • 62. Write-behind RDBMS Cache Application code JeeConf 2011 — Kiev
  • 63. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 64. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 65. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 66. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 67. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 68. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 69. Write-behind RDBMS Cache Writer Application code JeeConf 2011 — Kiev
  • 70. Write-behind RDBMS Writer Cache Writer Application code JeeConf 2011 — Kiev
  • 71. Write-behind RDBMS Writer Cache Writer Application code JeeConf 2011 — Kiev
  • 72. Write-behind JeeConf 2011 — Kiev 19
  • 73. Write-behind  Very configurable JeeConf 2011 — Kiev 19
  • 74. Write-behind  Very configurable – Batching & Coalescing JeeConf 2011 — Kiev 19
  • 75. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write JeeConf 2011 — Kiev 19
  • 76. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write – Limit the writes per seconds JeeConf 2011 — Kiev 19
  • 77. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write – Limit the writes per seconds – Retry configuration JeeConf 2011 — Kiev 19
  • 78. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write – Limit the writes per seconds – Retry configuration JeeConf 2011 — Kiev 19
  • 79. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write – Limit the writes per seconds – Retry configuration  New as of Ehcache 2.4 JeeConf 2011 — Kiev 19
  • 80. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write – Limit the writes per seconds – Retry configuration  New as of Ehcache 2.4 – writeBehindConcurrency="3" JeeConf 2011 — Kiev 19
  • 81. Write-behind  Very configurable – Batching & Coalescing – Maximum delay between each write – Limit the writes per seconds – Retry configuration  New as of Ehcache 2.4 – writeBehindConcurrency="3" – writeBehindMaxQueueSize="500" JeeConf 2011 — Kiev 19
  • 82. Scaling the database JeeConf 2011 — Kiev 20
  • 83. Scaling the database JeeConf 2011 — Kiev 20
  • 84. Scaling the cache JeeConf 2011 — Kiev 21
  • 85. Scaling the cache JeeConf 2011 — Kiev 21
  • 86. BigMemory JeeConf 2011 — Kiev 22
  • 87. BigMemory  OffHeap storage – But in process memory JeeConf 2011 — Kiev 22
  • 88. BigMemory  OffHeap storage – But in process memory  Uses DirectByteBuffer JeeConf 2011 — Kiev 22
  • 89. BigMemory  OffHeap storage – But in process memory  Uses DirectByteBuffer  Faults unused elements out of heap, and in again, transparently – …and from or to the disk store as well JeeConf 2011 — Kiev 22
  • 90. BigMemory  OffHeap storage – But in process memory  Uses DirectByteBuffer  Faults unused elements out of heap, and in again, transparently – …and from or to the disk store as well  Holds hundreds of gigabytes of data – 320Gb tested on a single machine JeeConf 2011 — Kiev 22
  • 91. Large data on a single VM JeeConf 2011 — Kiev 23
  • 92. Distributed Caching JeeConf 2011 — Kiev 24
  • 93. Distributed Caching  What if data isn't perfectly partitioned ? JeeConf 2011 — Kiev 24
  • 94. Distributed Caching  What if data isn't perfectly partitioned ?  How do we keep this all in sync ? JeeConf 2011 — Kiev 24
  • 95. Distributed Caching  What if data isn't perfectly partitioned ?  How do we keep this all in sync ?  Peer-to-peer ? JeeConf 2011 — Kiev 24
  • 96. Distributed Caching JeeConf 2011 — Kiev 25
  • 97. Distributed Caching  Cached data remains close to the processing unit JeeConf 2011 — Kiev 25
  • 98. Distributed Caching  Cached data remains close to the processing unit  Central unit orchestrates it all JeeConf 2011 — Kiev 25
  • 99. Distributed Caching JeeConf 2011 — Kiev 26
  • 100. Distributed Caching JeeConf 2011 — Kiev 27
  • 101. Distributed Caching JeeConf 2011 — Kiev 28
  • 102. DCV2 JeeConf 2011 — Kiev 29
  • 103. DCV2  Simple storage change in the cache config – <terracotta storageStrategy=”DCV2” /> JeeConf 2011 — Kiev 29
  • 104. DCV2  Simple storage change in the cache config – <terracotta storageStrategy=”DCV2” />  All keys and values are stored on the server – With a local cache (enabled by default) JeeConf 2011 — Kiev 29
  • 105. DCV2  Simple storage change in the cache config – <terracotta storageStrategy=”DCV2” />  All keys and values are stored on the server – With a local cache (enabled by default)  With a TSA – holds Terabytes of data! JeeConf 2011 — Kiev 29
  • 106. Consistency considerations From Happens-Before to ACID to 2PC and… back!
  • 107. The ACID guarantees JeeConf 2011 — Kiev 31
  • 108. The ACID guarantees  Let people easily reason about the problem JeeConf 2011 — Kiev 31
  • 109. The ACID guarantees  Letpeople easily reason about the problem  Atomic – We see all changes, or no changes at all JeeConf 2011 — Kiev 31
  • 110. The ACID guarantees  Letpeople easily reason about the problem  Atomic – We see all changes, or no changes at all  Consistent – Changes respect our rules and constraints JeeConf 2011 — Kiev 31
  • 111. The ACID guarantees  Letpeople easily reason about the problem  Atomic – We see all changes, or no changes at all  Consistent – Changes respect our rules and constraints  Isolated – We see all changes as independently happening JeeConf 2011 — Kiev 31
  • 112. The ACID guarantees  Letpeople easily reason about the problem  Atomic – We see all changes, or no changes at all  Consistent – Changes respect our rules and constraints  Isolated – We see all changes as independently happening  Durable – We keep the effect of our changes forever JeeConf 2011 — Kiev 31
  • 113. The ACID guarantees  Letpeople easily reason about the problem  Atomic – We see all changes, or no changes at all  Consistent – Changes respect our rules and constraints  Isolated – We see all changes as independently happening  Durable – We keep the effect of our changes forever  Fits a simplified model of our reality JeeConf 2011 — Kiev 31
  • 114. ... and that’s what you get JeeConf 2011 — Kiev 32
  • 115. ... and that’s what you get  ... when using Hibernate – Using read-write strategy – Falls back to DB to resolve isolation level – Transactional leaves it to the cache to be ACI(D) • And requires an XA environment, including all overhead! JeeConf 2011 — Kiev 32
  • 116. ... and that’s what you get  ... when using Hibernate – Using read-write strategy – Falls back to DB to resolve isolation level – Transactional leaves it to the cache to be ACI(D) • And requires an XA environment, including all overhead!  But using Ehcache API directly – Youget the JMM guarantees – Cached values are not inherently thread-safe JeeConf 2011 — Kiev 32
  • 117. Basic tools JeeConf 2011 — Kiev 33
  • 118. Basic tools  Blocking & SelfPopulatingCache constructs – Will not let multiple threads populate the cache with the same key JeeConf 2011 — Kiev 33
  • 119. Basic tools  Blocking & SelfPopulatingCache constructs – Willnot let multiple threads populate the cache with the same key  Explicit Locking API – acquire ( Read | Write ) LockOnKey – releaseLockOnKey – try ( Read | Write ) LockOnKey JeeConf 2011 — Kiev 33
  • 120. Atomic Operations JeeConf 2011 — Kiev 34
  • 121. Atomic Operations  Atomic operations on Cache – putIfAbsent(Element): Element – removeElement(Element): Element – replace(Element, Element): boolean – replace(Element): boolean JeeConf 2011 — Kiev 34
  • 122. Atomic Operations  Atomic operations on Cache – putIfAbsent(Element): Element – removeElement(Element): Element – replace(Element, Element): boolean – replace(Element): boolean  Copy on read & copy on write caches – Configurable per cache copyOnRead=”true” copyOnWrite=”false” – Configurable CopyStrategy per caches • Can be used with custom ElementValueComparator JeeConf 2011 — Kiev 34
  • 123. Transactional caches JeeConf 2011 — Kiev 35
  • 124. Transactional caches  When you need rollback! JeeConf 2011 — Kiev 35
  • 125. Transactional caches  Whenyou need rollback!  Comes in three flavors: – local – xa – xa_strict JeeConf 2011 — Kiev 35
  • 126. Transactional caches  Whenyou need rollback!  Comes in three flavors: – local – xa – xa_strict  Very simple configuration per Cache configuration – transactionalMode=”local” JeeConf 2011 — Kiev 35
  • 127. Transactional caches  Whenyou need rollback!  Comes in three flavors: – local – xa – xa_strict  Very simple configuration per Cache configuration – transactionalMode=”local”  Only accessible within a Transaction JeeConf 2011 — Kiev 35
  • 128. Transactional caches  Whenyou need rollback!  Comes in three flavors: – local – xa – xa_strict  Very simple configuration per Cache configuration – transactionalMode=”local”  Onlyaccessible within a Transaction  They will copy on read and copy on write JeeConf 2011 — Kiev 35
  • 129. Transactional caches  Whenyou need rollback!  Comes in three flavors: – local – xa – xa_strict  Very simple configuration per Cache configuration – transactionalMode=”local”  Onlyaccessible within a Transaction  They will copy on read and copy on write  When clustered, cache must be coherent JeeConf 2011 — Kiev 35
  • 130. Local transaction JeeConf 2011 — Kiev 36
  • 131. Local transaction  Cheap! JeeConf 2011 — Kiev 36
  • 132. Local transaction  Cheap!  Requires you to do the demarcation JeeConf 2011 — Kiev 36
  • 133. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); JeeConf 2011 — Kiev 36
  • 134. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); transactionController.begin(); JeeConf 2011 — Kiev 36
  • 135. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); transactionController.begin(); cache1 = cacheManager.getEhcache("txCache1"); JeeConf 2011 — Kiev 36
  • 136. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); transactionController.begin(); cache1 = cacheManager.getEhcache("txCache1"); cache1.put(new Element(1, putValue)); JeeConf 2011 — Kiev 36
  • 137. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); transactionController.begin(); cache1 = cacheManager.getEhcache("txCache1"); cache1.put(new Element(1, putValue)); cache2 = cacheManager.getEhcache("txCache2"); JeeConf 2011 — Kiev 36
  • 138. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); transactionController.begin(); cache1 = cacheManager.getEhcache("txCache1"); cache1.put(new Element(1, putValue)); cache2 = cacheManager.getEhcache("txCache2"); cache2.remove(“key”); JeeConf 2011 — Kiev 36
  • 139. Local transaction  Cheap!  Requires you to do the demarcation transactionController = cacheManager.getTransactionController(); transactionController.begin(); cache1 = cacheManager.getEhcache("txCache1"); cache1.put(new Element(1, putValue)); cache2 = cacheManager.getEhcache("txCache2"); cache2.remove(“key”); transactionController.rollback(); JeeConf 2011 — Kiev 36
  • 140. XA Caches JeeConf 2011 — Kiev 37
  • 141. XA Caches  What for ? – Synchronicity of data between Ehcache & other XA resources is guaranteed JeeConf 2011 — Kiev 37
  • 142. XA Caches  What for ? – Synchronicity of data between Ehcache & other XA resources is guaranteed  How ? – Two phase commit JeeConf 2011 — Kiev 37
  • 143. XA Caches  What for ? – Synchronicity of data between Ehcache & other XA resources is guaranteed  How ? – Two phase commit  Java Transaction API to the rescue ! – JSR907 / Direct port of the X/Open XA standard – JTA is about reading and writing transactionally into multiple resources: • databases JMS servers, • caches, • or whatever is used to store or transport data – The transaction manager manages and drives XA resources JeeConf 2011 — Kiev 37
  • 144. XA Caches JeeConf 2011 — Kiev 38
  • 145. XA Caches  READ_COMMITED isolation level JeeConf 2011 — Kiev 38
  • 146. XA Caches  READ_COMMITED isolation level  Transactional Caches will : JeeConf 2011 — Kiev 38
  • 147. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out JeeConf 2011 — Kiev 38
  • 148. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically JeeConf 2011 — Kiev 38
  • 149. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically – Only be accessible within an inflight Transaction JeeConf 2011 — Kiev 38
  • 150. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically – Only be accessible within an inflight Transaction  XA JeeConf 2011 — Kiev 38
  • 151. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically – Only be accessible within an inflight Transaction  XA – Will synchronize on the inflight XA Transaction JeeConf 2011 — Kiev 38
  • 152. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically – Only be accessible within an inflight Transaction  XA – Will synchronize on the inflight XA Transaction  XA_STRICT JeeConf 2011 — Kiev 38
  • 153. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically – Only be accessible within an inflight Transaction  XA – Will synchronize on the inflight XA Transaction  XA_STRICT – Will register a full blown XAResource with the TX JeeConf 2011 — Kiev 38
  • 154. XA Caches  READ_COMMITED isolation level  Transactional Caches will : – Figure the TransactionManager out – Enlist in the Transaction automagically – Only be accessible within an inflight Transaction  XA – Will synchronize on the inflight XA Transaction  XA_STRICT – Will register a full blown XAResource with the TX • Including support for recovery JeeConf 2011 — Kiev 38
  • 155. Sometimes,... you want less consistency JeeConf 2011 — Kiev 39
  • 156. Sometimes,... you want less consistency  When clustered, consistency comes at prices – That you might not always want to pay JeeConf 2011 — Kiev 39
  • 157. Sometimes,... you want less consistency  When clustered, consistency comes at prices – That you might not always want to pay  Introducing eventual consistency – No lock involved – Client sends • updates asynchronously • send as batches to the server – Other client knowing about the value for a key, gets the updates pushed to by the server • Might see stale values for some milliseconds from local cache JeeConf 2011 — Kiev 39
  • 158. Consistency types for clustered caches JeeConf 2011 — Kiev 40
  • 159. Consistency types for clustered caches  Also configurable per cache – Strong(JMM) – Eventual consistency • Will use the local cached value JeeConf 2011 — Kiev 40
  • 160. Consistency types for clustered caches  Also configurable per cache – Strong(JMM) – Eventual consistency • Will use the local cached value  Non-stop caches – Lets you configure • Timeout on caches • Timeout behavior – noop – exception – local read JeeConf 2011 — Kiev 40
  • 161. Consistency types for clustered caches  Also configurable per cache – Strong(JMM) – Eventual consistency • Will use the local cached value  Non-stop caches – Lets you configure • Timeout on caches • Timeout behavior – noop – exception – local read  Rejoin JeeConf 2011 — Kiev 40
  • 162. Where’s my data ?! … when key lookup isn’t enough
  • 163. Key / Value JeeConf 2011 — Kiev 42
  • 164. Key / Value  Sometimes retrieving values only based on a key isn’t enough, because – You don’t know the key – The key / value paradigm simply doesn’t apply JeeConf 2011 — Kiev 42
  • 165. Key / Value  Sometimes retrieving values only based on a key isn’t enough, because – You don’t know the key – The key / value paradigm simply doesn’t apply  Giventhe amount of data now storable Search was just the natural next step... JeeConf 2011 — Kiev 42
  • 166. Introducing Ehcache Search JeeConf 2011 — Kiev 43
  • 167. Introducing Ehcache Search  Ehcache Search is a querying capability built into the core OSS Ehcache API JeeConf 2011 — Kiev 43
  • 168. Introducing Ehcache Search  Ehcache Search is a querying capability built into the core OSS Ehcache API  Provides fast, flexible access to every aspect of your in-memory data JeeConf 2011 — Kiev 43
  • 169. Introducing Ehcache Search  Ehcache Search is a querying capability built into the core OSS Ehcache API  Provides fast, flexible access to every aspect of your in-memory data  Offloads queries from the database reducing the DB’s role as a bottleneck – Or adds search-ability to data that wasn’t before, like WS JeeConf 2011 — Kiev 43
  • 170. Introducing Ehcache Search  Ehcache Search is a querying capability built into the core OSS Ehcache API  Provides fast, flexible access to every aspect of your in-memory data  Offloads queries from the database reducing the DB’s role as a bottleneck – Or adds search-ability to data that wasn’t before, like WS  Improves application performance/latency JeeConf 2011 — Kiev 43
  • 171. Introducing Ehcache Search  Ehcache Search is a querying capability built into the core OSS Ehcache API  Provides fast, flexible access to every aspect of your in-memory data  Offloads queries from the database reducing the DB’s role as a bottleneck – Or adds search-ability to data that wasn’t before, like WS  Improves application performance/latency  Works efficiently when standalone JeeConf 2011 — Kiev 43
  • 172. Introducing Ehcache Search  Ehcache Search is a querying capability built into the core OSS Ehcache API  Provides fast, flexible access to every aspect of your in-memory data  Offloads queries from the database reducing the DB’s role as a bottleneck – Or adds search-ability to data that wasn’t before, like WS  Improves application performance/latency  Works efficiently when standalone  Scales out linearly with your data when distributed (O(Log n)/Server Count) without code changes JeeConf 2011 — Kiev 43
  • 173. Two key concepts in search JeeConf 2011 — Kiev 44
  • 174. Two key concepts in search  Attributes – What can be searched JeeConf 2011 — Kiev 44
  • 175. Two key concepts in search  Attributes – What can be searched  Queries – FluentObject Oriented interface used for searching the cache leveraging the defined Attributes JeeConf 2011 — Kiev 44
  • 176. Attributes JeeConf 2011 — Kiev 45
  • 177. Attributes  Definition Types JeeConf 2011 — Kiev 45
  • 178. Attributes  Definition Types – Beanattributes Bean style properties on the key or value JeeConf 2011 — Kiev 45
  • 179. Attributes  Definition Types – Bean attributes Bean style properties on the key or value – Expressions Method calls and/or field accesses JeeConf 2011 — Kiev 45
  • 180. Attributes  Definition Types – Bean attributes Bean style properties on the key or value – Expressions Method calls and/or field accesses – Custom Extractors A user defined class that can extract what ever you need for searching JeeConf 2011 — Kiev 45
  • 181. Attributes  Definition Types – Bean attributes Bean style properties on the key or value – Expressions Method calls and/or field accesses – Custom Extractors A user defined class that can extract what ever you need for searching  Definition Styles JeeConf 2011 — Kiev 45
  • 182. Attributes  Definition Types – Bean attributes Bean style properties on the key or value – Expressions Method calls and/or field accesses – Custom Extractors A user defined class that can extract what ever you need for searching  Definition Styles – XML JeeConf 2011 — Kiev 45
  • 183. Attributes  Definition Types – Bean attributes Bean style properties on the key or value – Expressions Method calls and/or field accesses – Custom Extractors A user defined class that can extract what ever you need for searching  Definition Styles – XML – Code JeeConf 2011 — Kiev 45
  • 184. Attribute definition  XML <searchable> <!-- Bean style spec --> <searchAttribute name="age" /> <!-- Expression style spec --> <searchAttribute name="gender" expression="value.getGender()" /> <!-- Custom Extractor style spec --> <searchAttribute name="name" class="com.company.NameAttributeExtractor" /> </searchable> JeeConf 2011 — Kiev 46
  • 185. Queries JeeConf 2011 — Kiev 47
  • 186. Queries  A fluent object oriented interface based on the defined Attributes. JeeConf 2011 — Kiev 47
  • 187. Queries  A fluent object oriented interface based on the defined Attributes.  Aggregate – Sum, Average, Min, Max, Count JeeConf 2011 — Kiev 47
  • 188. Queries  A fluent object oriented interface based on the defined Attributes.  Aggregate – Sum, Average, Min, Max, Count  Match – ilike, eq, between, gt, lt, between etc JeeConf 2011 — Kiev 47
  • 189. Queries  A fluent object oriented interface based on the defined Attributes.  Aggregate – Sum, Average, Min, Max, Count  Match – ilike, eq, between, gt, lt, between etc  Logical Operators – and, or, not JeeConf 2011 — Kiev 47
  • 190. Queries  A fluent object oriented interface based on the defined Attributes.  Aggregate – Sum, Average, Min, Max, Count  Match – ilike, eq, between, gt, lt, between etc  Logical Operators – and, or, not  Result Set Control – Ascending vs descending, max object counts, include keys/values, ranges JeeConf 2011 — Kiev 47
  • 191. When moving data is not a good idea! Sending the work to data
  • 192. Introducing Quartz Scheduler JeeConf 2011 — Kiev 49
  • 193. Introducing Quartz Scheduler  Lets you schedule asynchronous jobs JeeConf 2011 — Kiev 49
  • 194. Introducing Quartz Scheduler  Lets you schedule asynchronous jobs  De facto scheduler for the Java Platform JeeConf 2011 — Kiev 49
  • 195. Introducing Quartz Scheduler  Lets you schedule asynchronous jobs  De facto scheduler for the Java Platform  Easily clusterable using Terracotta – Share scheduler across Cluster – Persistent storage for your jobs JeeConf 2011 — Kiev 49
  • 196. One simple API JeeConf 2011 — Kiev
  • 197. One simple API  Job – Actual Job implementation – Defines what to execute – Think the script for a cron entry JeeConf 2011 — Kiev
  • 198. One simple API  Job – Actual Job implementation – Defines what to execute – Think the script for a cron entry public class MyJob implements Job { public void execute(final JobExecutionContext context) throws JobExecutionException { // Do the actual work } } JeeConf 2011 — Kiev
  • 199. One simple API  Job – Actual Job implementation – Defines what to execute – Think the script for a cron entry  Triggers – Fire the Job for execution – Defines when to execute – Think the actual cron expression JeeConf 2011 — Kiev
  • 200. One simple API  Job – Actual Job implementation – Defines what to execute – Think the script for a cron entry  Triggers – Fire the Job for execution – Defines when to execute – Think the actual cron expression  Single API – To schedule Jobs & Triggers – That actually executes these Jobs JeeConf 2011 — Kiev
  • 201. Quartz Where & Ehcache JVM JVM JVM SchedulerThread JVM JeeConf 2011 — Kiev
  • 202. Quartz Where & Ehcache JVM JVM JVM SchedulerThread scheduler.scheduleJob(job, trigger); JVM JeeConf 2011 — Kiev
  • 203. Quartz Where & Ehcache JVM JVM JVM SchedulerThread JVM JeeConf 2011 — Kiev
  • 204. Quartz Where & Ehcache JVM JVM L1 JVM SchedulerThread L1 JVM L1 JeeConf 2011 — Kiev
  • 205. Quartz Where & Ehcache JVM JVM L1 JVM SchedulerThread L1 JVM L1 JeeConf 2011 — Kiev
  • 206. Quartz Where & Ehcache JVM JVM L1 JVM SchedulerThread L1 JVM L1 JeeConf 2011 — Kiev
  • 207. I know… it’s late now! So, in summary
  • 208. Summary JeeConf 2011 — Kiev 53
  • 209. Summary  Ehcache JeeConf 2011 — Kiev 53
  • 210. Summary  Ehcache – Scales your system of record today JeeConf 2011 — Kiev 53
  • 211. Summary  Ehcache – Scales your system of record today – Easily! JeeConf 2011 — Kiev 53
  • 212. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta JeeConf 2011 — Kiev 53
  • 213. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it JeeConf 2011 — Kiev 53
  • 214. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it – Whether JeeConf 2011 — Kiev 53
  • 215. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it – Whether • In terms of data sizes JeeConf 2011 — Kiev 53
  • 216. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it – Whether • In terms of data sizes • Processing power JeeConf 2011 — Kiev 53
  • 217. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it – Whether • In terms of data sizes • Processing power • Redundancy JeeConf 2011 — Kiev 53
  • 218. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it – Whether • In terms of data sizes • Processing power • Redundancy • Persistency JeeConf 2011 — Kiev 53
  • 219. Summary  Ehcache – Scales your system of record today – Easily!  Terracotta – Scales your cache when it needs it – Whether • In terms of data sizes • Processing power • Redundancy • Persistency  All these features available with a couple lines of configuration only JeeConf 2011 — Kiev 53
  • 220. ehcache | ehcache.org quartz | quartz-scheduler.org terracotta | terracotta.org Thank you !
  • 221. ehcache | ehcache.org quartz | quartz-scheduler.org terracotta | terracotta.org twitter | @alexsnaps email | alexsnaps@terracotta.org blog | www.codespot.net
  • 222. ehcache | ehcache.org quartz | quartz-scheduler.org terracotta | terracotta.org twitter | @alexsnaps email | alexsnaps@terracotta.org blog | www.codespot.net

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. ImmutableValueElementCopyStrategy\n copies the element, not its value\n
  114. ImmutableValueElementCopyStrategy\n copies the element, not its value\n
  115. ImmutableValueElementCopyStrategy\n copies the element, not its value\n
  116. ImmutableValueElementCopyStrategy\n copies the element, not its value\n
  117. ImmutableValueElementCopyStrategy\n copies the element, not its value\n
  118. ImmutableValueElementCopyStrategy\n copies the element, not its value\n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n
  200. \n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n