Terracotta DSO


Published on

Small Presentation about Terracotta Network Attached Memory(NAM).

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Virtualization takes physical machine and slices them into logical chunks so it does exact inverse of virtualization. JVM-level clustering provides an ambience which is simple,scalable and highly available. NAM enables Terracotta to cluster Java Virtual Machines (JVMs) directly underneath applications, and is a proven runtime approach to providing Java applications both high availability and scalability. Transparency does not mean that TC works for everything and its invisible and does not require code change but  it means that freedom and purity of design. Clustering service move clustering from architecture concept to a service on which applications can 
  • Example directory and file remotely. Clients is completely transparent of whether its doing changes on local file or remote file.
  • 1) Caching inside the application's memory is po ssible through terracotta's transparency. This significantly lessens the workload from terracotta server. 2) Terrcotta stores the object's fields near each others and since tarracotta reads entire disk block in one disk I/O operation.   3) Since tarracotta writes in batches so if multiple objects change their changes are written together to the  disk.  
  • Terracotta DSO

    1. 1. Terracotta
    2. 2. Agenda <ul><ul><li>How Applications Scale? </li></ul></ul><ul><ul><li>Problems with scale-out </li></ul></ul><ul><ul><li>Defining Terracotta </li></ul></ul><ul><ul><li>Network Attached Memory (NAM)‏ </li></ul></ul><ul><ul><li>Logical Model </li></ul></ul><ul><ul><li>Benefits of Terracotta? </li></ul></ul><ul><ul><ul><li>Transparency </li></ul></ul></ul><ul><ul><ul><li>Service </li></ul></ul></ul><ul><ul><ul><li>Availability </li></ul></ul></ul><ul><ul><ul><li>Scalability </li></ul></ul></ul><ul><ul><ul><li>Avoiding bottlenecks </li></ul></ul></ul>
    3. 3. Scaling applications Scale-out Web app Business Logic Framework Framework JVM Web app Business Logic Framework Framework JVM Web app Business Logic Framework Framework JVM Database For Stateless applications In order for these servers to work in a clustered fashion a developer has to concentrate on how to integrate them and learn the apis and consider the infrastructure things. Also there is learning curve involved.
    4. 4. Problems with Scale-out <ul><li>Developers have to write custom code to make things work together. </li></ul><ul><li>Like Serialization, RMI, JMS developer needs to know these API. </li></ul><ul><li>Examples API things, these are complicated. </li></ul>
    5. 5. Enter Terracotta Scale-out Web app Business Logic Framework Framework Web app Business Logic Framework Framework Web app Business Logic Framework Framework JVM JVM JVM Terracotta JVM JVM JVM
    6. 6. Defining Terracotta    <ul><li>Terracotta is Java infrastructure software that allows you to scale your application for use on as many computers as needed, without expensive custom code or databases.   </li></ul><ul><li>Terracotta is Transparent JVM Level Clustering Service for Java Applications.  </li></ul><ul><li>Often referred to as Network Attached memory. </li></ul><ul><li>  </li></ul><ul><ul><li>Transparency: here means that an application written to support Terracotta will still function as implemented with zero changes when Terracotta is not installed. Thus application depend on terracotta without embedding it. </li></ul></ul><ul><ul><li>Clustering in this context is unique and slightly different than normal clustering which mean server talking to each other over a network JVM-Clustering Service is a technology that take the application without any clustering logic or library and spread it across the servers by clustering in the JVM, beneath the application. </li></ul></ul><ul><ul><li>Take memory from of multiple  machines and represents those as single large logical chunk of memory. </li></ul></ul>
    7. 7. Logical Model Application Instance Application Instance Application Instance Terracotta Process JVM JVM JVM
    8. 8. Cluster wide visible changes JVM JVM JVM Change ACK ACK Terracotta Update and broadcast
    9. 9. Similarities to NAS <ul><li>Its like NAS but for memory (almost)‏ </li></ul><ul><li>– A server process for central storage and locking – A transparent client I/O driver (TC libraries) – A network protocol </li></ul>
    10. 10. Deployment Model Your JVM Terracotta Libs Your JVM Terracotta Libs Your JVM Terracotta Libs Terracotta Server Disk Terracotta Server Disk
    11. 11. Availability <ul><li>Stores copy of shared data outside the existing java process, so if all our process are stopped we could gain access to objects as they existed in memory before java was terminated. </li></ul><ul><li>Terracotta process is reliable and restartable. if it were killed or stopped then it could be restarted where it left off. </li></ul>
    12. 12. Terracotta Optimizations <ul><li>Terracotta gives four optimizations </li></ul><ul><ul><ul><li>In-memory Cache </li></ul></ul></ul><ul><ul><ul><li>Read only what it needs </li></ul></ul></ul><ul><ul><ul><li>Server writes changes and in batches </li></ul></ul></ul><ul><ul><ul><li>Server writes in append-only fashion </li></ul></ul></ul>
    13. 13. HelloClusteredWorld public class HelloClusteredWorld { private static final String message = &quot;Hello Clustered World!&quot;; private static final int length = message.length(); private static char[] buffer = new char [length ]; private static int loopCounter; public static void main( String args[] ) throws Exception { while( true ) { synchronized( buffer ) { int messageIndex = loopCounter++ % length; if(messageIndex == 0) java.util.Arrays.fill(buffer, '¥u0000'); buffer[messageIndex] = message.charAt(messageIndex); System.out.println( buffer ); Thread.sleep( 100 ); } } } }
    14. 14. <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <tc:tc-config xmlns:tc=&quot;http://www.terracotta.org/config&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.terracotta.org/schema/terracotta-4.xsd&quot;> <!-- servers and clients stanzas ommitted --> <application> <dso> <roots> <root> <field-name> HelloClusteredWorld.buffer </field-name> </root> <root> <field-name> HelloClusteredWorld.loopCounter </field-name> </root> </roots>
    15. 15. <instrumented-classes> <include> <class-expression>HelloClusteredWorld</class-expression> </include> </instrumented-classes> <locks> <autolock> <lock-level>write</lock-level> <method-expression>void HelloClusteredWorld.main(..)</method-expression> </autolock> </locks> </dso> </application> </tc:tc-config>