Real Terracotta

50 %
50 %
Information about Real Terracotta
Technology

Published on January 24, 2009

Author: sbtourist

Source: slideshare.net

Description

Real-world scalability patterns with Terracotta: enjoy the challenges of scalability!

REAL TERRACOTTA Real-world scalability patterns with Terracotta SERGIO BOSSA Pro-Netics / Sourcesense Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

About Me Software architect and engineer ✔ http://www.pronetics.it ➔ http://www.sourcesense.com ➔ Blogger ✔ http://sbtourist.blogspot.com ➔ Open Source Enthusiast ✔ ➔ Lead at Scarlet - Clustering for Jira http://scarlet.sf.net ➔ Committer at Spring Modules ➔ http://springmodules.dev.java.net ➔ Committer at Terracotta Forge ➔ http://forge.terracotta.org ➔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Agenda Do I need a cluster? ✔ Terracotta concepts. ✔ Scalability patterns with Terracotta. ✔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Do I need a cluster? The old, dummy, question: ✔ ➔ Do I need a clustered architecture? The correct one: ✔ ➔ Do I need scalability? ➔ Do I need availability? ➔ Nowadays, the answer is: yes, you need. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Why should I need a cluster? Several changes in the social and market landscape ... ✔ In a few words: ✔ ➔ More and more users surfing the web. ➔ More and more hardware at cheaper price. ➔ More and more processors ... even on a single machine. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

What should I use for my cluster? Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

The Terracotta Revolution Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

The Terracotta Revolution Transparent clustering. ✔ ➔ Everything happens under the hood. Easy to work with. ✔ ➔ If you know Java, you can cluster your application with no-to-minimal code changes. ➔ Deep integration with common frameworks and patterns. Optimized for performance. ✔ ➔ No cross-node communication. ➔ Built on the concept of diff. Open Source. ✔ ➔ With a great community. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Overview Network Attached Memory ✔ ➔ All cluster nodes share part of their memory heap: a shared object graph starting from one or more roots. ➔ Shared objects changes are propagated at the byte level: only the different bytes get propagated! ➔ Shared objects changes are delimited by lock-guarded transactions. ➔ Shared objects are backed by the cluster server filesystem. ➔ With preserved Java semantics (i.e. object identity)! Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Overview Hub-and-Spoke network architecture ✔ ➔ A central cluster server with one or more cluster client nodes. ➔ Clients talk only with the server. ➔ Server can be put in active-passive mode (no SPOF). ➔ For enterprise customers only: server can be put in active-active mode (no SPOB). Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Details Bytecode instrumentation ✔ ➔ Instrument classes in order to: ➔ Share classes among cluster nodes. ➔ Intercept and propagate changes. ➔ Apply transactions. ➔ Distribute method invocations. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Details Roots ✔ ➔ AKA super-static: created only for the first time, and then shared among all cluster nodes. ➔ Start of the shared object graph: all objects reachable from roots are shared among all cluster nodes. ➔ Except transient ones. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Details Locks ✔ ➔ Every read or write operation on a shared object state must be guarded by locks. ➔ Synchronized blocks. ➔ java.util.concurrent.locks.ReentrantReadWriteLock ➔ Acting as a transaction boundary. ➔ Acting as a change propagation boundary. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Details Distributed Method Invocation ✔ ➔ Methods called on a shared object from a cluster node, are automatically fired on the same object instance of all other cluster nodes. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Technology Details Declarative configuration: ✔ ➔ XML file. ➔ Java annotations. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Quick Start Plan Identify roots and related shared object graphs. ✔ Identify transactional methods. ✔ Identify classes that need to be instrumented. ✔ Identify distributed methods (optional). ✔ Choose your cluster deployment configuration: ✔ ➔ How many client nodes? ➔ How many server nodes? ➔ How much memory? ➔ ... Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Terracotta Quick Start Operate Configure the cluster. ✔ Start the Terracotta cluster server: ✔ sh tc_home/bin/start-tc-server.sh -f path/to/tc-conf.xml Start the Terracotta cluster client(s): ✔ TC_INSTALL_DIR=... TC_CONFIG_PATH=... . $TC_INSTALL_DIR/bin/dso-env.sh -q export JAVA_OPTS=${TC_JAVA_OPTS} java ... Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

What about real world scalability? Feeling like lost at sea? Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Scalability in the real world We need some patterns! Cache your data in a distributed fashion. ✔ Partition your cached data and collocate with your ✔ processing. Asynchronously write-behind to your back-end. ✔ Asynchronously de-couple components communication. ✔ Asynchronously de-couple components processing. ✔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Data-affinity caching Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Data-affinity caching In a nutshell Key concepts: ✔ ➔ Use a partition function for grouping related entries on the same distributed cache instance. ➔ Use the partition function to look up the cache instance and put/get related entries. ➔ Process the cached data on the same node it belongs to. Key features: ✔ ➔ No network traffic between cache instances. ➔ Distributed load. ➔ Higher scalability. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Data-affinity caching With Terracotta Use: ✔ ➔ Tim-Tree-Map-Cache http://forge.terracotta.org/releases/projects/tim-tree-map-cache/ ➔ Key classes: ✔ org.tc.cache.CacheFactory ➔ org.tc.cache.ITerracottaCache ➔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous write-behind Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous write-behind In a nutshell Key concepts: ✔ ➔ Always write and read from your (distributed) cache. ➔ Asynchronously schedule writes to the storage. Key features: ✔ ➔ Higher throughput. ➔ Load throttling. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous write-behind With Terracotta Use: ✔ ➔ Tim-Async http://forge.terracotta.org/releases/projects/tim-async/ ➔ Key classes: ✔ org.terracotta.modules.async.AsyncCoordinator ➔ org.terracotta.modules.async.ItemProcessor ➔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous messaging Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous messaging In a nutshell Key concepts: ✔ ➔ Connects application components through pipes. ➔ Configure processing filters to elaborate messages and make them flow through pipes. Key features: ✔ ➔ De-coupled application components. ➔ Higher reliability. ➔ Higher scalability. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous messaging With Terracotta Use: ✔ ➔ Tim-Pipes http://forge.terracotta.org/releases/projects/tim-messaging/ ➔ Key classes: ✔ org.terracotta.message.topology.TopologyManager ➔ org.terracotta.message.topology.Topology ➔ org.terracotta.message.routing.Router ➔ org.terracotta.message.pipe.Pipe ➔ org.terracotta.message.pipe.PipeProcessor ➔ org.terracotta.message.subscriber.Subscriber ➔ org.terracotta.message.subscriber.SubscriberProcessor ➔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous processing Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous processing In a nutshell Key concepts: ✔ ➔ Create a set of tasks. ➔ Submit tasks to a master. ➔ Tasks will be executed by workers. ➔ Eventually wait for tasks to be completed. Key features: ✔ ➔ De-coupled execution of expensive tasks. ➔ Parallel execution of tasks. ➔ Customisable routing logic. ➔ Load distribution. Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Asynchronous processing With Terracotta Use: ✔ ➔ Tim-MasterWorker http://forge.terracotta.org/releases/projects/tim-messaging/ ➔ Key classes: ✔ org.terracotta.executor.DistributedExecutorService ➔ org.terracotta.executor.DistributedCompletionService ➔ org.terracotta.workmanager.statik.StaticWorkManager ➔ org.terracotta.workmanager.statik.StaticWorker ➔ org.terracotta.workmanager.dynamic.DynamicWorkManager ➔ org.terracotta.workmanager.dynamic.DynamicWorker ➔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Conclusion Enjoy scalability challenges! Design your scalable architecture ... ✔ Program in plain old Java ... ✔ Run with Terracotta! ✔ Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Q&A Sergio Bossa - sergio.bossa@pronetics.it - Pro-Netics / Sourcesense Javaday Roma III Edizione – 24 gennaio 2009

Add a comment

Related presentations

Related pages

Elektrogeräte jetzt günstig online kaufen | real,- Onlineshop

Elektrogeräte günstig online kaufen im real,- Onlineshop versandkostenfreie Marktanlieferung kostenlose Retoure PAYBACK Punkte sammeln & einlösen
Read more

In-Memory Data Management for the Enterprise | Terracotta

Terracotta provides leading in-memory data management and Big Data solutions for the enterprise, including BigMemory, Universal Messaging, and more.
Read more

Real terracotta jewellery | Facebook

Real terracotta jewellery. 4,384 likes · 17 talking about this. real terracottajewellery hand made with passion for placing order call 9488729175....
Read more

Terracotta - Wikipedia

Article on terracotta in Victorian and Edwardian Terracotta Buildings; Bibliography, Smithsonian Institution, Ceramic Tiles and Architectural Terracotta
Read more

Cotto Fliesen | eBay

TERRACOTTA FLIESEN COTTO MORENO TERRAKOTTA PLATTEN Tonfliesen Ziegelboden braun. EUR 30,00. Sofort-Kaufen + EUR 0,00 Versand. 0,20m² Cotto Fliesen ...
Read more

Pflanztopf Geli Parma Kunststoff 40x40x34 cm terracotta ...

Pflanztopf Geli Parma Kunststoff 40x40x34 cm terracotta jetzt im HORNBACH Onlineshop bestellen! Garantierte Dauertiefpreise, Beratung und Service bei HORNBACH.
Read more

Terracotta Army - Wikipedia

Terracotta Army: Simplified Chinese ... The terracotta figures currently on display have been restored from ... Most of the figures originally held real ...
Read more

Software AG Products - Terracotta

TERRACOTTA. Software AG's Terracotta enables Digital Enterprises to access and store huge volumes of data in-memory, improving system performance many ...
Read more

Cotto Hof: Terrakotta-Fliesen für Wand und Boden

Auch im Außenbereich empfehlen sich hochwertige Terrassen Fliesen aus Terracotta. Wenn Sie Ihre Terrasse fliesen, ...
Read more

Boxspringbetten günstig kaufen im real,- Onlineshop

Boxspringbetten günstig & bequem kaufen im real,- Onlineshop kostenlose Retoure PAYBACK Punkte sammeln & einlösen
Read more