Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pragmatic Scalability: Under the Hood of Artifa...

Pragmatic Scalability: Under the Hood of Artifactory HA

Application scalability is hard. Application scalability done right is even harder.

While some might try to write a distributed clustering framework from scratch, a Pragmatic Developer, from another hand, most likely will leverage mature open source framework, like Hazelcast, that takes care of all the hassle. In this session, you will learn how the pragmatic developers of JFrog benefited from using battle-tested clustering capabilities of Hazelcast while building Artifactory High Availability feature.

Viktor Gamov

May 24, 2016
Tweet

More Decks by Viktor Gamov

Other Decks in Technology

Transcript

  1. Artifactory HA Challenges • Concurrent and Distributed access to binaries

    • Repository Cache • Job Notifications • Connectivity / Node Discovery
  2. Artifactory HA (powered by Hazelcast) • Distributed Lock (ILock) •

    Distributed Map (IMap) • Distributed Topic • Membership Listener • Discovery SPI
  3. What’s Hazelcast 01001 10101 01010 In Memory Data Computing In

    Memory Data Messaging + + In Memory Data Storage
  4. ILock • Extends java.util.concurrent.locks.Lock • Is re-entrant • The ILock

    has 1 synchronous backup • Owner member goes down, lock is released • ILock is fair and grants lock in order of request • ILock can return a Condition.
  5. ILock HazelcastInstance hz = Hazelcast.newHazelcastInstance(); // Acquire the lock outside

    the try-catch block. // We may fail to get the lock but the finally unlock will // still run if we acquire inside try-catch ILock myLock = hz.getLock("myLock"); try { // Doing my protected stuff here. // No other distributed member can execute this code. } finally { myLock.unlock(); } }
  6. ILock HazelcastInstance hz = Hazelcast.newHazelcastInstance(); // Acquire the lock outside

    the try-catch block. // We may fail to get the lock but the finally unlock will // still run if we acquire inside try-catch ILock myLock = hz.getLock("myLock"); try { // Doing my protected stuff here. // No other distributed member can execute this code. } finally { myLock.unlock(); } }
  7. Hazelcast Deployment Options Great for early stages of rapid application

    development and iteration and for OEM. Necessary for scale-up or scale-out deployments – decouples upgrading of clients and cluster Embedded Mode Hazelcast Node 1 Applications Java API Client-Server Mode Hazelcast Node 3 Java API Applications .Net API Applications C++ API Applications Hazelcast Node 2 Hazelcast Node 1 Hazelcast Node 2 Applications Java API Hazelcast Node 3 Applications Java API
  8. Membership Listener public interface MembershipListener extends EventListener { void memberAdded(MembershipEvent

    me); void memberRemoved(MembershipEvent me); void memberAttributeChanged(MemberAttributeEvent mae); }
  9. Any Cloud, Anytime – Discovery SPI Cloud & Cloud Discovery

    Plugins Deployment Options YARN Apache jClouds PaaS Environment Integrations
  10. How we can make things even better • Distributed Executor

    Service for distributed jobs • Entry Processor for atomic data changes • Discovery SPI for Cloud and custom topologies