Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Clustering Java applications with Terracotta and Hazelcast

6,970 views

Published on

Presentation prepared for JavaBreese in Odessa, Ukraine (18 May 2013)

Published in: Technology, Travel

Clustering Java applications with Terracotta and Hazelcast

  1. 1. CLUSTERING JAVA APPLICATIONSWITH TERRACOTTA AND HAZELCASTBoris Trofimov @ Sigma Ukraine
  2. 2. Why clasterizationTerracottaHazelcastSummarySigma Ukraine2AGENDA
  3. 3. Sigma Ukraine3WHY CLASTERIZATION?Moores law is brokenEra of Big Data
  4. 4. Application clusterization Horizontal scaling, vertical scaling, MapReduce, MPI,...Data Claterization Distributed Data Exchanging Distributed Coordination Distributed HeapSigma Ukraine4KINDS OF CLASTERIZATION
  5. 5. SOMETIMES ITS HARD TO CHOOSE...Sigma Ukraine5
  6. 6. Sigma Ukraine6
  7. 7. Maintained by private companySupports Quartz and EhcacheTerracota modesSigma Ukraine7ABOUT TERRACOTTA
  8. 8. Sigma Ukraine8
  9. 9. BigMemory uses Ehcache as its main programming interfaceOff-Heap without Garbage Collection Pauses3 major bricks: CacheManager, Cache and ElementSerializable data classesSigma Ukraine9DISTRIBUTED CACHE MODE
  10. 10. Sigma Ukraine10EXAMPLE — CONFIGURATION
  11. 11. 11EXAMPLE CRUD
  12. 12. 12EXAMPLE — IN-MEMORY SEARCH
  13. 13. BigMemory GO vs BigMemory MAXMight use Server ArrayRespecting CA (CAP theorem)Linear grouthSigma Ukraine13CLUSTERIZATION
  14. 14. Sigma Ukraine14
  15. 15. Sigma Ukraine15HOW IT WORKSSpecify root objectsLaunch terracotta serverLaunch app instances
  16. 16. Terracotta uses aspect-oriented technologies to adapt theapplication at class load time.Terracotta does not use serialization.DSO uses object identity, instrumented classes (byte-codeinstrumentation), object-graph roots, and cluster-wide locks tomaintain data coherenceDistributed GCSigma Ukraine16DSO INTERNALS
  17. 17. All Standard non-value types like maps, listsPOJO ObjectsSynchronization Java objects like locks, semaphoresSigma Ukraine17OBJECTS TO SYNC
  18. 18. Sigma Ukraine18EXAMPLE — DEFINE CONFIGURATION
  19. 19. Sigma Ukraine19EXAMPLE — CODE
  20. 20. Start Terracotta Server (local or cluster)Launch two Java application instances through terracottascript launcher.Sigma Ukraine20EXAMPLE — LAUNCH
  21. 21. Sharing ordinary objectsLegacy clasteringDistributed CacheHibernate 2nd Cache (through DSO)Web Session clustering (through DSO)Clastering read/write data with fast updateSigma Ukraine21USE CASES
  22. 22. Internal ACID TransactionsOnly data changes are broadcastLocal cachesDSO- POJO transparent clasterizationsMonitoring Control toolsSigma Ukraine22BENEFITS
  23. 23. Sigma Ukraine23
  24. 24. InMemory Distributed CacheOpen Source solutionSupports own special distributed data structuresSupports locks and eventsMight be slcaled outEasy to use and integrateAll objects must be serializableSupports standard collection interfacesSigma Ukraine24WHAT IS HAZELCAST
  25. 25. Distributed QueueDistributed TopicDistributed MapDistributed MultiMapDistributed SetDistributed ListDistributed LocksDistribured Event (Listeners)Distributed Topic (Hello JMS)Distributed SemaphoreDistributed Executor ServiceSigma Ukraine25SUPPORTED DATA
  26. 26. 26EXAMPLE — DISTRIBUTED MAP
  27. 27. Partitioning with replicasScalable Peer-toPeer architectureAvailability over ConsistencyFailover clusterNative Client supportSigma Ukraine27CLUSTERIZATION
  28. 28. User ASID Transactions over several operationsIt is free, unlimited community license *PersistenceSearch enhanced by user-defined indexesSpring support (beans, cachable)Simple interfaces in comparison to Terracotta BigMemorySigma Ukraine28BENEFITS
  29. 29. Share data across clusterSend/receive messagesDistributed Coordination (locks)Hibernate 2nd CacheHttp Session Clustering with HazelcastWM (based on Servletspecification)Sigma Ukraine29USE CASES
  30. 30. Sigma Ukraine30SUMMARY
  31. 31. Thank you for your attention!

×