SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Building High Scalability Apps
        with Terracotta

            David Reines
          Senior Architect
         Object Partners Inc.

   david.reines@objectpartners.com
            twitter: dhreines
Agenda

Terracotta Overview
   Products
   Distributed Shared Objects (DSO)
Architecture
Distributed Shared Objects
   Roots and Instrumented Classes
   Locks
   Data Structures
   Object Identity
Designing to Scale
Demo
Terracotta Overview
Terracotta is an open source software solution that provides JVM-level
clustering.
    Plugs into the Java Memory Model
    Utilizes bytecode manipulation
Consistent
    Creates a virtual heap across multiple nodes
    Provides highly optimized cluster-wide locking
Available
    Terracotta active/standby servers provide high-availability
    Data persisted to disk to survive certain disaster scenarios

Terracotta Server Array provides "linear" scalability
Terracotta Products

Terracotta Products
   Distributed Ehcache
       cache eviction algorithms
       write-through/write-behind
       JTA support (XA compliant)
       monitoring
   Distributed Ehcache for Hibernate
   Job Store for Quartz
   Web Session Clustering
   Spring Framework Clustering
Distributed Shared Objects
   the foundation of Terracotta Products
Terracotta Architecture

Client JVM(s) (L1)
   Application logic
   Communicates with active Terracotta server(s)
   Supports numerous standard containers
   Utilize Terracotta Integration Modules (TIMs)
Terracotta Server(s) (L2)
   Data management
       data storage (memory and disk)
       full-fill L1 data requests/change broadcasts
       distributed garbage collection
   Lock management
   Active server(s) replicate data to standby server(s) in real-
   time
Deployment Options
Permanent Storage
   Recommended for high-availability mode
   Stores data to disk (Berkeley-DB)
   Disk speed will impact performance
Active/Standby
   Allows for high availability
   Active server "elected" at start-up
   Automatic failover if active fails
Terracotta Server Array (Enterprise Only)
   Provides "linear" scalability
   Multiple active/standby "mirror groups"
   Transparent to the application tier
Terracotta Cluster
Open Source vs. Enterprise

Open Source Version
   Production ready
   High availability
   Very high throughput and performance
   Developer console
   Limited to a single active server
Enterprise Version
   Terracotta Server Array (Terracotta FX)
   Additional Enterprise Operations and Management Tools
   Production back-up and restore
   Certified Patches, Support

Simple upgrade from open source to enterprise version.
Distributed Shared Objects (DSO)

As a developer, you may never need to work directly with
Terracotta DSOs.

Terracotta products such as Ehcache hide the complexity of
DSOs from developers.

The concepts are still important because DSOs provide the
foundation for Terracotta's products.

If needed, developers can still utilize DSOs directly.
Root
Root
  Applications define root(s)
  A root and it's references are clustered
  A root cannot be changed

/**
 * Singleton CustomerService.
 */
private class CustomerService {
@Root
private ConcurrentDistributedMap<Long, Customer>
customers;
}
Instrumented Classes

Instrumented Class
   Shared objects must be instrumented
   Serializable not required
   Root container is automatically instrumented

/**
 * Shared Customer.
 */
@InstrumentedClass
public class Customer {
...
}
Locks

Terracotta Locks
   Provide cluster-wide synchronization
   Provide a means for terracotta "transactions"
   Modifications to clustered objects must occur within a
   clustered lock.
   Utilizes standard Java synchronization syntax
Lock Support
   read/write
   synchronous-write
   ReentrantReadWriteLock
Lock Optimization
   Greedy locks - once obtained, no need to contact server
Object Identity

Objects are assigned a cluster-wide ObjectId

Object identity is maintained cluster-wide!

Multiple objects can reference the same object instance cluster-
wide

Only data changes are broadcast

Not completely true when using ehcache serialization mode.
Good reasons for either option. Ehcache provides the flexibility
to choose per cache.
Designing to Scale

Partial Loading and Locality of Reference

To properly scale an application can utilize partial
loading to maintain a good locality of reference .
Partial Loading

Consider the following example:

Map<String, ReallyBigObject>

Loading all elements into each node limits scalability.

Partial Loading a Map
   Terracotta faults the keys into each node in the cluster
   Values are faulted into node(s) as needed
Data Structures Supporting Partial Loading
   DSO Data Structures Guide
   (i.e. LinkedBlockingQueue)
Locality of Reference

Always access and update the same data on the same node.

For example, CustomerId 100 is always accessed on Client JVM #1

Benefits
  Uses partial loading
  Minimizes lock recalls - greedy locks
  Minimizes fault rates
  Minimizes flush rates
  Minimizes change broadcasts
  Reduces L1 garbage collection cycles
Locality of Reference (cont)

Potential Routing Options
   Load-balancers (i.e. session, url or header properties)
   Custom Client Libraries
Potential Routing Keys
   HttpSession Id
   CustomerId
   UserId
   etc...
Failover
   If a node fails, route requests to another server
   Objects transparently fault into memory
Designing to Scale




* Transparent Failover
Demo
References
http://www.terracotta.org/documentation/ga/product-documentation-1page

http://www.terracotta.org/confluence/display/docs/Concept+and+Architecture+Guide

http://blog.terracottatech.com/archive/2005/08/object_identity.html
Data Structures (via terracotta.org)




http://www.terracotta.org/confluence/display/docs/DSO+Data+Structures+Guide

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to NuoDB
Introduction to NuoDBIntroduction to NuoDB
Introduction to NuoDBSandun Perera
 
Time for Change: Migrate your Non-RAC Database to RAC
Time for Change: Migrate your Non-RAC Database to RACTime for Change: Migrate your Non-RAC Database to RAC
Time for Change: Migrate your Non-RAC Database to RACSatishbabu Gunukula
 
QUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTURE
QUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTUREQUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTURE
QUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTURESourabh Saxena
 
Distributed, Concurrent, and Independent Access to Encrypted Cloud Databases
Distributed, Concurrent, and Independent Access to Encrypted Cloud DatabasesDistributed, Concurrent, and Independent Access to Encrypted Cloud Databases
Distributed, Concurrent, and Independent Access to Encrypted Cloud DatabasesJPINFOTECH JAYAPRAKASH
 
Azure, Cloud Computing & Services
Azure, Cloud Computing & ServicesAzure, Cloud Computing & Services
Azure, Cloud Computing & ServicesAlan Dean
 
JPA and Coherence with TopLink Grid
JPA and Coherence with TopLink GridJPA and Coherence with TopLink Grid
JPA and Coherence with TopLink GridJames Bayer
 
Lucene Bootcamp - 2
Lucene Bootcamp - 2Lucene Bootcamp - 2
Lucene Bootcamp - 2GokulD
 
Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)Shrijan Tiwari
 
Amazon elastic block store (ebs) and
Amazon elastic block store (ebs) andAmazon elastic block store (ebs) and
Amazon elastic block store (ebs) andlurdhu agnes
 
Quadcept v10.0.0 Released
Quadcept v10.0.0 ReleasedQuadcept v10.0.0 Released
Quadcept v10.0.0 ReleasedQuadcept
 
The Future of Distributed Databases
The Future of Distributed DatabasesThe Future of Distributed Databases
The Future of Distributed DatabasesNuoDB
 
An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflakeSivakumar Ramar
 
Practical examples of using extended events
Practical examples of using extended eventsPractical examples of using extended events
Practical examples of using extended eventsDean Richards
 
Christoforos zolotas cloudmde2015 presentation - camera ready
Christoforos zolotas  cloudmde2015 presentation - camera readyChristoforos zolotas  cloudmde2015 presentation - camera ready
Christoforos zolotas cloudmde2015 presentation - camera readyISSEL
 

Was ist angesagt? (20)

Openstack swift - VietOpenStack 6thmeeetup
Openstack swift - VietOpenStack 6thmeeetupOpenstack swift - VietOpenStack 6thmeeetup
Openstack swift - VietOpenStack 6thmeeetup
 
Introduction to NuoDB
Introduction to NuoDBIntroduction to NuoDB
Introduction to NuoDB
 
Hazelcast 101
Hazelcast 101Hazelcast 101
Hazelcast 101
 
Time for Change: Migrate your Non-RAC Database to RAC
Time for Change: Migrate your Non-RAC Database to RACTime for Change: Migrate your Non-RAC Database to RAC
Time for Change: Migrate your Non-RAC Database to RAC
 
QUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTURE
QUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTUREQUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTURE
QUICK REFERENCE FOR KEY CONCEPT AND TERMINOLOGY FOR ORACLE CLOUD INFRASTRUCTURE
 
Distributed, Concurrent, and Independent Access to Encrypted Cloud Databases
Distributed, Concurrent, and Independent Access to Encrypted Cloud DatabasesDistributed, Concurrent, and Independent Access to Encrypted Cloud Databases
Distributed, Concurrent, and Independent Access to Encrypted Cloud Databases
 
Azure, Cloud Computing & Services
Azure, Cloud Computing & ServicesAzure, Cloud Computing & Services
Azure, Cloud Computing & Services
 
JPA and Coherence with TopLink Grid
JPA and Coherence with TopLink GridJPA and Coherence with TopLink Grid
JPA and Coherence with TopLink Grid
 
Lucene Bootcamp - 2
Lucene Bootcamp - 2Lucene Bootcamp - 2
Lucene Bootcamp - 2
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)
 
Project Voldemort
Project VoldemortProject Voldemort
Project Voldemort
 
Cassandra Architecture FTW
Cassandra Architecture FTWCassandra Architecture FTW
Cassandra Architecture FTW
 
Amazon elastic block store (ebs) and
Amazon elastic block store (ebs) andAmazon elastic block store (ebs) and
Amazon elastic block store (ebs) and
 
Quadcept v10.0.0 Released
Quadcept v10.0.0 ReleasedQuadcept v10.0.0 Released
Quadcept v10.0.0 Released
 
SQL server Backup Restore Revealed
SQL server Backup Restore RevealedSQL server Backup Restore Revealed
SQL server Backup Restore Revealed
 
The Future of Distributed Databases
The Future of Distributed DatabasesThe Future of Distributed Databases
The Future of Distributed Databases
 
An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflake
 
Practical examples of using extended events
Practical examples of using extended eventsPractical examples of using extended events
Practical examples of using extended events
 
Christoforos zolotas cloudmde2015 presentation - camera ready
Christoforos zolotas  cloudmde2015 presentation - camera readyChristoforos zolotas  cloudmde2015 presentation - camera ready
Christoforos zolotas cloudmde2015 presentation - camera ready
 

Ähnlich wie Building High Scalability Apps with Terracotta DSO and Products

Windows Azure: Lessons From The Field
Windows Azure: Lessons From The FieldWindows Azure: Lessons From The Field
Windows Azure: Lessons From The FieldRob Gillen
 
Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityPaulo Fagundes
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On ConcurrencyWill Gage
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On ConcurrencyRodney Barlow
 
Terracotta Ch'ti Jug
Terracotta Ch'ti JugTerracotta Ch'ti Jug
Terracotta Ch'ti JugCh'ti JUG
 
Clouds in Your Coffee Session with Cleversafe & Avere
Clouds in Your Coffee Session with Cleversafe & AvereClouds in Your Coffee Session with Cleversafe & Avere
Clouds in Your Coffee Session with Cleversafe & AvereAvere Systems
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Baruch Sadogursky
 
Understanding Oracle GoldenGate 12c
Understanding Oracle GoldenGate 12cUnderstanding Oracle GoldenGate 12c
Understanding Oracle GoldenGate 12cIT Help Desk Inc
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingDibyendu Bhattacharya
 
Databricks Platform.pptx
Databricks Platform.pptxDatabricks Platform.pptx
Databricks Platform.pptxAlex Ivy
 
Microsoft Database Options
Microsoft Database OptionsMicrosoft Database Options
Microsoft Database OptionsDavid Chou
 
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GRGlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GRTheophanis Kontogiannis
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache CamelChristian Posta
 
Clustering In The Wild
Clustering In The WildClustering In The Wild
Clustering In The WildSergio Bossa
 

Ähnlich wie Building High Scalability Apps with Terracotta DSO and Products (20)

Hibernate
HibernateHibernate
Hibernate
 
Terracotta DSO
Terracotta DSOTerracotta DSO
Terracotta DSO
 
Clustering van IT-componenten
Clustering van IT-componentenClustering van IT-componenten
Clustering van IT-componenten
 
Windows Azure: Lessons From The Field
Windows Azure: Lessons From The FieldWindows Azure: Lessons From The Field
Windows Azure: Lessons From The Field
 
Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availability
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On Concurrency
 
Druid deep dive
Druid deep diveDruid deep dive
Druid deep dive
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On Concurrency
 
Terracotta Ch'ti Jug
Terracotta Ch'ti JugTerracotta Ch'ti Jug
Terracotta Ch'ti Jug
 
Clouds in Your Coffee Session with Cleversafe & Avere
Clouds in Your Coffee Session with Cleversafe & AvereClouds in Your Coffee Session with Cleversafe & Avere
Clouds in Your Coffee Session with Cleversafe & Avere
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
 
Understanding Oracle GoldenGate 12c
Understanding Oracle GoldenGate 12cUnderstanding Oracle GoldenGate 12c
Understanding Oracle GoldenGate 12c
 
Open ebs 101
Open ebs 101Open ebs 101
Open ebs 101
 
Oracle Coherence
Oracle CoherenceOracle Coherence
Oracle Coherence
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
 
Databricks Platform.pptx
Databricks Platform.pptxDatabricks Platform.pptx
Databricks Platform.pptx
 
Microsoft Database Options
Microsoft Database OptionsMicrosoft Database Options
Microsoft Database Options
 
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GRGlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache Camel
 
Clustering In The Wild
Clustering In The WildClustering In The Wild
Clustering In The Wild
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Building High Scalability Apps with Terracotta DSO and Products

  • 1. Building High Scalability Apps with Terracotta David Reines Senior Architect Object Partners Inc. david.reines@objectpartners.com twitter: dhreines
  • 2. Agenda Terracotta Overview Products Distributed Shared Objects (DSO) Architecture Distributed Shared Objects Roots and Instrumented Classes Locks Data Structures Object Identity Designing to Scale Demo
  • 3. Terracotta Overview Terracotta is an open source software solution that provides JVM-level clustering. Plugs into the Java Memory Model Utilizes bytecode manipulation Consistent Creates a virtual heap across multiple nodes Provides highly optimized cluster-wide locking Available Terracotta active/standby servers provide high-availability Data persisted to disk to survive certain disaster scenarios Terracotta Server Array provides "linear" scalability
  • 4. Terracotta Products Terracotta Products Distributed Ehcache cache eviction algorithms write-through/write-behind JTA support (XA compliant) monitoring Distributed Ehcache for Hibernate Job Store for Quartz Web Session Clustering Spring Framework Clustering Distributed Shared Objects the foundation of Terracotta Products
  • 5. Terracotta Architecture Client JVM(s) (L1) Application logic Communicates with active Terracotta server(s) Supports numerous standard containers Utilize Terracotta Integration Modules (TIMs) Terracotta Server(s) (L2) Data management data storage (memory and disk) full-fill L1 data requests/change broadcasts distributed garbage collection Lock management Active server(s) replicate data to standby server(s) in real- time
  • 6. Deployment Options Permanent Storage Recommended for high-availability mode Stores data to disk (Berkeley-DB) Disk speed will impact performance Active/Standby Allows for high availability Active server "elected" at start-up Automatic failover if active fails Terracotta Server Array (Enterprise Only) Provides "linear" scalability Multiple active/standby "mirror groups" Transparent to the application tier
  • 8. Open Source vs. Enterprise Open Source Version Production ready High availability Very high throughput and performance Developer console Limited to a single active server Enterprise Version Terracotta Server Array (Terracotta FX) Additional Enterprise Operations and Management Tools Production back-up and restore Certified Patches, Support Simple upgrade from open source to enterprise version.
  • 9. Distributed Shared Objects (DSO) As a developer, you may never need to work directly with Terracotta DSOs. Terracotta products such as Ehcache hide the complexity of DSOs from developers. The concepts are still important because DSOs provide the foundation for Terracotta's products. If needed, developers can still utilize DSOs directly.
  • 10. Root Root Applications define root(s) A root and it's references are clustered A root cannot be changed /** * Singleton CustomerService. */ private class CustomerService { @Root private ConcurrentDistributedMap<Long, Customer> customers; }
  • 11. Instrumented Classes Instrumented Class Shared objects must be instrumented Serializable not required Root container is automatically instrumented /** * Shared Customer. */ @InstrumentedClass public class Customer { ... }
  • 12. Locks Terracotta Locks Provide cluster-wide synchronization Provide a means for terracotta "transactions" Modifications to clustered objects must occur within a clustered lock. Utilizes standard Java synchronization syntax Lock Support read/write synchronous-write ReentrantReadWriteLock Lock Optimization Greedy locks - once obtained, no need to contact server
  • 13. Object Identity Objects are assigned a cluster-wide ObjectId Object identity is maintained cluster-wide! Multiple objects can reference the same object instance cluster- wide Only data changes are broadcast Not completely true when using ehcache serialization mode. Good reasons for either option. Ehcache provides the flexibility to choose per cache.
  • 14. Designing to Scale Partial Loading and Locality of Reference To properly scale an application can utilize partial loading to maintain a good locality of reference .
  • 15. Partial Loading Consider the following example: Map<String, ReallyBigObject> Loading all elements into each node limits scalability. Partial Loading a Map Terracotta faults the keys into each node in the cluster Values are faulted into node(s) as needed Data Structures Supporting Partial Loading DSO Data Structures Guide (i.e. LinkedBlockingQueue)
  • 16. Locality of Reference Always access and update the same data on the same node. For example, CustomerId 100 is always accessed on Client JVM #1 Benefits Uses partial loading Minimizes lock recalls - greedy locks Minimizes fault rates Minimizes flush rates Minimizes change broadcasts Reduces L1 garbage collection cycles
  • 17. Locality of Reference (cont) Potential Routing Options Load-balancers (i.e. session, url or header properties) Custom Client Libraries Potential Routing Keys HttpSession Id CustomerId UserId etc... Failover If a node fails, route requests to another server Objects transparently fault into memory
  • 18. Designing to Scale * Transparent Failover
  • 19. Demo
  • 21. Data Structures (via terracotta.org) http://www.terracotta.org/confluence/display/docs/DSO+Data+Structures+Guide