Terracotta Java Scalability - Stateless Versus Stateful Apps

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

    2 Groups

    Terracotta Java Scalability - Stateless Versus Stateful Apps - Presentation Transcript

    1. Stateful Applications in a Stateless World How to write stateful web applications that scale like stateless ones Copyright Terracotta 2007
    2. Open Source Clustering for Java The Innocent Web Application   Within every innocent web application lies a sleeping monster   There comes a time when every successful web application outgrows its single machine architecture   Whether for high-availability or scalability or both, the adult web application must live on more than one application server   That's when the latent beast strikes... Copyright Terracotta 2007
    3. Open Source Clustering for Java The State Monster Copyright Terracotta 2007
    4. Open Source Clustering for Java The State Monster   Conversational state across requests   Application state: caches, indexes, etc. Copyright Terracotta 2007
    5. Open Source Clustering for Java The Stateless Convention   Push state out of your application server to achieve \"statelessness\"   Application server is for computation only   Any application server can handle any request   \"...with a little ingenuity, [we have created a] very fast application that is much more resilient to application restarts\" Copyright Terracotta 2007
    6. Open Source Clustering for Java The Stateless Convention: Push State to the Database Copyright Terracotta 2007
    7. Open Source Clustering for Java The Stateless Convention: Push State to the Database   DB becomes a bottleneck   Not optimized for object data Copyright Terracotta 2007
    8. Open Source Clustering for Java The Stateless Convention: Push State to Peers Copyright Terracotta 2007
    9. Open Source Clustering for Java The Stateless Convention: Push State to Peers   Push state everywhere gives HA, but doesn't scale   Push conversational state to buddy can't survive buddy pair death or full cluster restart. Doesn't help for application state. Copyright Terracotta 2007
    10. Open Source Clustering for Java The Stateless Convention: Push State to Client   Highly scalable for conversation state UNLESS state is large   Doesn't help with application state Copyright Terracotta 2007
    11. Open Source Clustering for Java Stateless Convention: The Real Problem \"With a little ingenuity,\" many of these problems can be solved on a per-application basis. The real problem with the \"stateless\" convention is... Copyright Terracotta 2007
    12. Open Source Clustering for Java The Stateless Convention: Eats Developer Brains Copyright Terracotta 2007
    13. Open Source Clustering for Java The Stateless Convention: Eats Developer Brains   Pushing state out of app server doesn't get rid of state. There is no such thing as \"stateless\"   Serialization/externalization:   Full-object graph serialization   breaks object identity   corrupts data and programming model   \"with a little ingenuity...\"-- seems fun/easy to try, but ends up taking over the development effort Copyright Terracotta 2007
    14. Open Source Clustering for Java Changing the Assumptions: JVM-level Clustering Copyright Terracotta 2007
    15. Open Source Clustering for Java Performance + Reliability + Simplicity   10X throughput over conventional APIs   All Reads from Cache (implicit locality)   All Writes are Deltas-only   Statistics and Heuristics (greedy locks)   Scale out the Terracotta Server   Simple form of Active / active available today   V1.0 GA this year   Looks like Java to me (code like your mom used to make) Normal access patterns: no check-out before view and check-in on commit   Code and test at a unit level without infrastructure intruding on app logic   Threads on multiple JVMs look like threads on the same JVM   PUFIELD, GETFIELD, synchronized(), wait(), notify() work as expected   Copyright Terracotta 2007
    16. Open Source Clustering for Java Demo: Session Clustering Copyright Terracotta 2007
    17. Open Source Clustering for Java Demo: CoordinationWithQueues (from our Apress book) Copyright Terracotta 2007
    18. Open Source Clustering for Java QueueReader private static final class QueueReader implements Runnable { private final NamedQueue myQueue; public QueueReader(NamedQueue queue) { this.myQueue = queue; } public void run() { while (true) { try { System.out.println(new Date() + \": message from the \" + myQueue.getName() + \" queue: \" + myQueue.take()); } catch (InterruptedException e) { // A real application would do something interesting with this // exception. e.printStackTrace(); } } } Copyright Terracotta 2007
    19. Open Source Clustering for Java Queue Writer //... private void run() { while (true) { try { String mood = MOODS[random.nextInt(MOODS.length)]; myQueue.add(myColor + \" says, \\\"I'm feeling \" + mood + \".\\\"\"); Thread.sleep(1000); } catch (InterruptedException e) { // A real application would do something with this exception e.printStackTrace(); } } } // ... Copyright Terracotta 2007
    20. Open Source Clustering for Java CoordinationWithQueues Config File ... <dso> <instrumented-classes> <include> <class-expression> org.terracotta.book.coordination.queues.CoordinationWithQueues </class-expression> </include> <include> <class-expression> org.terracotta.book.coordination.queues.CoordinationWithQueues$NamedQueue </class-expression> </include> </instrumented-classes> <roots> <root> <field-name>org.terracotta.book.coordination.queues.CoordinationWithQueues.QUEUES</field-name> </root> <root> <field-name> org.terracotta.book.coordination.queues.CoordinationWithQueues.sharedCounter</field-name> </root> </roots> <locks> <autolock> <method-expression> void org.terracotta.book.coordination.queues.CoordinationWithQueues.main(java.lang.String[]) </method-expression> <lock-level>write</lock-level> </autolock> </locks> </dso> ... Copyright Terracotta 2007
    21. Case Studies Copyright Terracotta 2007
    22. Open Source Clustering for Java Fast, Simple, Scalable “ [T]hanks to Terracotta and your post about the message bus you did we have stripped all J2EE out of our architecture making it much simpler for service developers, much faster, and much more scalable. What has us so excited about this approach is exactly what you said about developer productivity - that is Right On! --http://blog.markturansky.com/archives/77 Copyright Terracotta 2007
    23. Open Source Clustering for Java Large Publisher Gets Caught Down the Path with Oracle Scaling Out or Up? Copyright Terracotta 2007
    24. Open Source Clustering for Java Breaking the Pattern without Leaving “Load-Balanced” World • $1.5 Million DB & HW savings • Doubled business • More than halved database load Copyright Terracotta 2007
    25. Open Source Clustering for Java Coming Soon: Examinator Reference Application   Online test proctoring application   Fully tested & tuned   Popular stack   Example architecture &   Spring MVC, Webflow components   Sitemesh   Example project layout and tools   Freemarker integration (build/test/debug/   Spring Security deploy)   Tomcat/Jetty   Fully documented best practices   JPA and recommended SDLC   Hibernate processes   MySQL   Maven   Junit Copyright Terracotta 2007
    26. Open Source Clustering for Java Gnip—Internet Data Aggregation and Delivery Service Copyright Terracotta 2007
    27. Open Source Clustering for Java Gnip—Internet Data Aggregation and Delivery Service Copyright Terracotta 2007
    28. Open Source Clustering for Java Gnip—Internet Data Aggregation and Delivery Service Initial Architechture   JMS Queuing   Backing Database JMS JMS Liabilities   Many moving parts   Many technologies DB   Increased developer specialization   Lower core-competency density Copyright Terracotta 2007
    29. Open Source Clustering for Java Gnip—Internet Data Aggregation and Delivery Service Terracotta Architecture   Natural, in-memory data structures EC2 Node 1: TC Client EC2 Node 2: TC Client   Durable, TC-backed objects Periodic EC2 Node 3: TC Server snapshot of Terracotta object store for backup S3 Backup Copyright Terracotta 2007
    30. Open Source Clustering for Java Gnip—Internet Data Aggregation and Delivery Service Performance   50,000 messages/second   3-4 EC2 nodes EC2 Node 1: TC Client EC2 Node 2: TC Client Benefits   Fewer technologies, increased core competency Periodic   App built w/ simple Java EC2 Node 3: TC Server snapshot of constructs Terracotta object store for   Clustering and redundancy “just backup works” S3 Backup   Excellent monitoring/debugging tools   “I can’t believe you give them away for free…” Copyright Terracotta 2007
    31. Open Source Clustering for Java Common Use Patterns Copyright Terracotta 2007
    32. Open Source Clustering for Java Community Resources   http://www.terracotta.org/   http://forums.terracotta.org/   Mailing lists:   tc-dev@terracotta.org   tc-users@terracotta.org   IRC:   #terracotta channel on freenode   Subversion   http://svn.terracotta.org/svn/tc   http://svn.terracotta.org/svn/forge Copyright Terracotta 2007

    + Matthew McCulloughMatthew McCullough, 8 months ago

    custom

    616 views, 0 favs, 0 embeds more stats

    Orion Letizi's presentation of Terracotta to the De more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 616
      • 616 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 21
    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