cloud-lock provides a means of distributed locking via cloud storage in Java. This let’s you do leader election to run certain workloads only once when your service is scaled out horizontally. Doing it via cloud has the benefit of not needing to provision a database for that purpose if your service is stateless in the first place.
At the moment, cloud-lock works with 3 different cloud storage solutions by the following providers:
- Google Cloud Storage (GCS) powered by Google Cloud Platform
- Azure Blob Storage powered by Microsoft Azure
- Object Storage Service powered by Alibaba Cloud
- Java 11+
- SLF4J
- Dependency of cloud provider's storage solution that you actually use
Add the following dependency to your project:
- Maven
<dependency> <groupId>com.originalflipster</groupId> <artifactId>cloud-lock</artifactId> <version>0.0.8</version> </dependency>
- Gradle
implementation 'com.originalflipster:cloud-lock:0.0.8'
Still questions left? Check the docs in my crib