Terracotta Ch'ti Jug

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Terracotta Ch'ti Jug - Presentation Transcript

    1. Terracotta
    2. Context – Database abuse
      • Database used to store Durable and Temporary data
      • The database can become a bottleneck when too many requests
          • SPOB
          • SPOF
    3. Goals
      • High availability
      • High performances
      • Linear scalability
      • A possible solution : data grids
      • It is a cluster of machines that handles in memory a large quantity of shared data
    4. Terracotta (Server)
      • Clustering at the JVM level
      • 1 active TC server
      • Server TC :
        • Shared data
        • Clients list
        • Spread the updates
        • Manage locks
        • Garbage Collector
    5. Terracotta (Client)
      • From the code
        • No specific storage structure, only use Java classes
        • Recommanded to use "synchronized" keyword
      • Configuration file (XML)
        • To configure the objects to share (roots)
        • To configure locks
        • To configure distributed methods
        • ...
    6. Useful for
      • Relieving Database Overload
        • Distributed Caching
        • Hibernate second level cache
        • HTTP Session
      • Simplifying Application Architecture and avoid clustering by hand
        • Virtual Heap for Large Datasets
        • Clustering OSS Frameworks
        • Master / Worker
        • POJO Clustering
      • Linear Scalability by connected JVMs
    7. HTTP Sessions
    8. Demo Sample Terracotta application
    9. Clustering a Wicket Application
      • Wicket stores objects into the session
        • Page, PageMap...
      • These objects would need to be declared in the Terracotta configuration
        • Already done in a wicket-module for Terracotta
      <clients> <modules> <module name= &quot;clustered-wicket-1.3&quot; version= &quot;2.6.2&quot; /> </modules> </clients> <instrumented-classes> <!--Include all classes for DSO instrumentation--> <include> <class-expression> *..* </class-expression> </include> </instrumented-classes> <!--Tell DSO which applications in your web container is using DSO--> <web-applications> <web-application> Gallery </web-application> </web-applications>
    10. Sharing Data
      • Wicket, as a Java application, will use objects for the business layer
      • Instead of coming from the database, those objects can be in memory
      • Should be declared in the tc-config file
      • Classes using it (Pages), should declare it in the tc-config file
      public class SharedAlbum extends Observable implements Serializable { private List<String> images; private String defaultImage; private String host; private String album; private boolean slideShow = false ; }
    11. Demo Sharing information Wicket application vs Swing client
    12. Ajax component
      • Using of a checkbox to activate / deactivate a slideshow
      • Wicket has built in integration for Ajax behaviours
      • By clicking on the checkbox, The « Album » object state will be update on the server with the value of the checkbox
        • The update object is shared / clustered via Terracotta
      add( new AjaxCheckBox( &quot;slideshow&quot; , new PropertyModel( this , &quot;slideshow&quot; )) { @Override protected void onUpdate(AjaxRequestTarget target) { album.updateSlideShowStatus( slideshow ); } }); <input type= &quot;checkbox&quot; wicket:id= &quot;slideshow&quot; value= &quot;true&quot; > Slideshow </input>
    13. Demo Sharing information -Ajax checkbox
    14.  
      • Why a cache ?
        • Temporal Locality
        • Non-uniform distribution
      • EhCache
      • Hibernate 2 nd level cache
      • Terracotta
    15. Temporal Locality
    16. Non Uniform Distribution
    17. Non Uniform Distribution top 4 pages account for >50% of total hits top 17 pages account for >80% of total hits (14% of total pages) spend small amount of memory to cache top 14% of pages -> remove 80% of load
    18. Cache limitations
      • Amdahl' Law
        • If the thing you’re caching is not your bottleneck, it won’t matter
      • Memory
        • cache uses memory which your app might need
      • Concurrency
        • access to cache can be a bottleneck
    19. Reduce LAtency
    20. EhCache
      • First created in 2003 by Greg Luck
      • Most widely used Java cache
      • Apache 2.0 licence
      • JSR 107 Java cach implementation
    21. EhCache Architecture
    22. Hibernate 2 nd Level Cache
    23. Using Terracotta
      • EhCache 1.7.0 can be as drop in replacement
      • Side effect on a single node, keeping state
      • Monitoring and profiling capabilities
      • Distributed transparently
    24. Using Terracotta
    25. Enhancement to Hibernate
      • More efficient in-memory and total count eviction (3.1.1)
      • Better visibility of memory conditions
      • Improved Query Caching
      • Improved performance of core Terracotta (lock manager and memory manager)

    + Ch'ti JUGCh'ti JUG, 2 months ago

    custom

    275 views, 0 favs, 2 embeds more stats

    More info about this document

    CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

    Go to text version

    • Total Views 275
      • 227 on SlideShare
      • 48 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    Most viewed embeds
    • 47 views on http://chtijug.org
    • 1 views on http://feeds2.feedburner.com

    more

    All embeds
    • 47 views on http://chtijug.org
    • 1 views on http://feeds2.feedburner.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories