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

Pragmatic Scalability: Under the Hood of Artifactory HA

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. Pragmatic Scalability
    Under the hood of Artifactory HA

    View full-size slide

  2. whoiam
    Senõr Solutions Architect @Hazelcast
    @gAmUssA on the internetz

    View full-size slide

  3. What’s Artifactory HA

    View full-size slide

  4. Artifactory HA Challenges
    • Concurrent and Distributed access to binaries
    • Repository Cache
    • Job Notifications
    • Connectivity / Node Discovery

    View full-size slide

  5. Artifactory HA (powered by Hazelcast)
    • Distributed Lock (ILock)
    • Distributed Map (IMap)
    • Distributed Topic
    • Membership Listener
    • Discovery SPI

    View full-size slide

  6. What’s Hazelcast
    01001
    10101
    01010
    In Memory
    Data Computing
    In Memory
    Data Messaging
    +
    +
    In Memory
    Data Storage

    View full-size slide

  7. Distribute Concurrency Control

    View full-size slide

  8. Concurrent and Distributed Access to the Binaries

    View full-size slide

  9. 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.

    View full-size slide

  10. 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();
    }
    }

    View full-size slide

  11. 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();
    }
    }

    View full-size slide

  12. Distributed Cache

    View full-size slide

  13. Green
    Primary
    Green
    Backup
    Green
    Shard

    View full-size slide

  14. 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

    View full-size slide

  15. Messaging and Notifications

    View full-size slide

  16. © 2016 Hazelcast Inc. 27
    Connectivity and Discovery

    View full-size slide

  17. Membership Listener
    public interface MembershipListener
    extends EventListener {
    void memberAdded(MembershipEvent me);
    void memberRemoved(MembershipEvent me);
    void memberAttributeChanged(MemberAttributeEvent mae);
    }

    View full-size slide

  18. Any Cloud, Anytime – Discovery SPI
    Cloud & Cloud Discovery Plugins
    Deployment Options
    YARN
    Apache jClouds
    PaaS Environment Integrations

    View full-size slide

  19. 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

    View full-size slide