From I/O To RAM

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

    1 Favorite, 1 Group & 1 Event

    From I/O To RAM - Presentation Transcript

    1. Riding The Memory Bus
      Ophir Radnitz
    2. Agenda
      RAM vs. IO
      Tools of the Trade
      Introducing Terracotta
      RAM Patterns with Terracotta
    3. Anatomy of an Application
      Get a DB connection, start transactioning
      Start a request
      Network
      Get a bunch of data
      Access disk,
      Serialization
      Release resources
      Render stuff
    4. I/O Issues
      Scalability issues
      Excessive network chatter
      How do you scale the database?
      Only as fast as your slowest query
      Implies serialization/deserialization
    5. Bandwidths (1 of 2)
    6. Bandwidths (1 of 2)
    7. RAM vs. Disk
      Internet: ~80ms
    8. RAM Goodness
      RAM = High Bandwidth & Low Latency
      No serialization costs
      Less network
    9. Use Cases
      Low level cache
      SQL, HTTP
      Application cache
      Hibernate 2nd level cache
      Short lived entities
      Queues
    10. Generic Tools
      Memcached
      A high-performance, distributed memory caching system
      Used EVRYWHERE: Facebook, Twitter, Digg, Wikipedia, Slashdot, LiveJournal, Sourceforge etc.
      Squid
      Routing and load balancing
      HTTP cache
    11. Memcached Limitations for Java
      Remote cache
      Serialization
      2Gb limit
    12. Java In-Memory Tools
      Prevayler, Space4J
      Persist objects in memory, supports ACID and file system journaling
      Db4O in memory, Perst
      Object oriented database
      Jofti
      A high-performance object indexing and searching solution. Supports Map.
    13. In-Memory Considerations
      Reliability requires redundancy
      And/or durability
      In a cluster state must be synced
      Requires state distribution
    14. Java Distribution Tools
      Coherence
      GigaSpace
      Ehcache
      Infinispan
      Terracotta
      Hazelcast
    15. Introducing Terracotta
      Network-Attached Memory infrastructure for the JVM
      Open source
      (TPL, based on Mozilla License)
      Current version: 3.0.1
    16. Terracotta Customers
    17. Introducing Terracotta
      Highly Available
      Highly Scalable
      Avoids excessive state replication
      Hub and spoke architecture
    18. A Nice Diagram
      Application
      Application
      Application
      Terracotta
      Server
      Terracotta
      Server
      Terracotta
      Server
      Application
      Application
    19. How Terracotta Works
      Application
      Terracotta
      Client
      Bootjarinstrumenting your application
      Terracotta Libraries
      JVM
      Terracotta
      Server
      TC handles
      JVM locks and
      data access
    20. How Terracotta Works, take 2
      Application
      Application
      Application
      Terracotta Server
      Reference
      Actual instance
    21. Terracotta Features
      Cross-JVM object identity
      Automatic Persistence to disk
      Virtual Memory
      spill heap to TC and/or to disk, transparently
      Cluster profiling & visualization
      JMX-based monitoring and management
    22. Terracotta Advantages
      Easy to integrate, Maven support
      Great scalability
      No proprietary API (optional)
      Ready made integration modules
      Great diagnostics
      In/out of process
    23. Terracotta Development Console
    24. Integrating Terracotta
      Download & extract
      Write a tc-config.xml
      Create a bootjar
      Run your app with the bootjar
      Add elements & refactor
    25. TIM - Terracotta Integration Modules
      Packaged functionality
      Easy to integrate
      Handles locks details
      Examples:
      Concurrent collections, Ehcache
      Lucene/Compass, Spring Security
      Pipes, Wicket, Tomcat, Jetty
      Hibernate, JBoss, Spring etc.
    26. Terracotta Elements
      HTTP Session Replication
      Cache Evictor
      Queues
      Master-Worker
      Asynchronous Processor
      Cluster membership events
    27. Terracotta Patterns
      Data Cache
      Intermediate persistence
      Queues / work distribution
      Write behind to database
    28. Data Cache Considerations
      Figure out data lifecycle
      Read-only, metadata, configuration, session
      Where cache is applicable
      Single point of update
      Set eviction policies
      LRU, FIFO
    29. Data Cache
      Session cache is easier, entity cache needs real distribution
      Use a generic cache
      ConcurrentMap + Map Evictor (+ Jofti)
      Or a Hibernate 2nd level cache
      ehcache, TC-Cache
    30. Where Should My Objects Live?
      Memory
      Database
      Appropriateness
      dies quickly
      stays forever
      Data Lifetime
    31. Intermediate Data Lifetime
      Some data doesn’t have to be stored in the database
      Session information
      Messages / Tokens
      Transaction
      Unfinished stuff
      Data Lifetime
    32. TIM Pipes: Queues
      Execute time consuming tasks asynchronously
      In a reliable way
      Load balanced
      Examples:
      Send emails, process images
      Supports pub/sub, routing
      No need for JMS
    33. CommonJ – Work Distribution
      A joint API spec by Oracle and IBM
      Provides interfaces for:
      Worker / WorkItem / WorkManager
      Scheduler
      etc…
      TIM-Messaging provides an implementation
      Pipes
      Master / Worker
    34. Write Behind to System Of Record
      Asynchronously persist to DB
      Work queue
      “1.5 phase commit”
      Flags objects as dirty
      Avoids syncing dirty objects
      Flushes objects
      Flags objects as clean
    35. Terracotta Drawbacks
      Concurrency awareness
      Massive scalability is a commercial feature
      Requires another machine(s)
      Sharing objects across applications requires configuration
      TIMs documentation
    36. Terracotta Pros
      Concurrency awareness
      Fits into your application
      Provides great visibility
      Very versatile usage
      Scales massively
      Doesn’t use serialization
      Great community
    37. Summary
      Ask yourself:
      Does it belong in the DB?
      Do I have to go to the DB for that?
      Do I have to do it now?
    38. Terracotta Pros
      Any Questions?
    SlideShare Zeitgeist 2009

    + Baruch SadogurskyBaruch Sadogursky Nominate

    custom

    415 views, 1 favs, 0 embeds more stats

    IO is slow, memory is fast. For many applications, more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 415
      • 415 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 7
    Most viewed embeds

    more

    All embeds

    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

    Tags