Prerequisites
This tutorial uses a Spring Boot retail application, the Aerospike Java SDK, and the Aerospike Voyager desktop tool. Install the following dependencies and clone the sample application repository before you start.
The sample application includes a Docker Compose file that runs a single-node Aerospike Database. You do not install Aerospike Database separately.
Required
Docker
Docker runs the single-node Aerospike Database for the sample application. Download and install Docker Desktop from the Docker website.
Verify Docker is running:
docker --versionThe output is similar to:
Docker version 27.0.0, build abc1234Podman with podman compose works as a drop-in replacement on Linux and macOS. If you use it, substitute podman for docker in the commands in this tutorial.
JDK 21
The sample application requires JDK 21.
-
Download a JDK 21 distribution for your operating system and architecture. Either of the following works:
-
Run the installer for your platform:
- macOS: open the installer you downloaded (
.dmgfrom Oracle,.pkgfrom Adoptium) and follow the prompts. With Homebrew, you can runbrew install --cask temurin@21instead. - Windows: run the downloaded installer (
.exeor.msi) and accept the option to add Java to yourPATH. - Linux: install from your distribution’s package manager if it ships JDK 21, or follow the Adoptium Linux installer instructions to add the Adoptium APT, RPM, or APK repository and install
temurin-21-jdk. As an alternative, extract the downloaded.tar.gzto a stable location such as/opt/jdk-21and add the JDK’sbindirectory to yourPATH.
- macOS: open the installer you downloaded (
-
Open a new terminal so the updated
PATHis picked up, then verify the JDK.Terminal window java -versionThe output begins with
openjdk version "21(orjava version "21for Oracle JDK), for example:openjdk version "21.0.4" 2024-07-16 LTSAny 21.x (or later) build is acceptable. If the version reported is not 21.x, your
PATHis still resolving an older JDK.
Apache Maven
The sample application is built with Apache Maven. Install Maven from maven.apache.org, or use your operating system package manager. For example, run brew install maven on macOS or apt install maven on Debian-based Linux distributions.
Verify Maven is available:
mvn -versionThe output is similar to:
Apache Maven 3.9.6Java version: 21.0.4, vendor: Eclipse AdoptiumAerospike Voyager
Aerospike Voyager is the desktop tool you use to inspect and edit data in your cluster. Voyager runs on macOS, Windows, and Linux.
Download Voyager from the Aerospike download page, install it, then launch it once to confirm it opens without errors. You connect Voyager to the database in the next step.
Sample application
Clone the workshop repository, which contains the Spring Boot retail application, the local Aerospike Database Docker Compose file, and the JSON product data:
git clone https://github.com/aerospike-examples/aerospike-client-sdk-workshopcd aerospike-client-sdk-workshopOptional
An IDE with Java support
You edit Java source files in this tutorial. Any editor with Java support works. IntelliJ IDEA, VS Code with the Java Extension Pack, or Eclipse are common choices.
Verify the working tree
The repository contains the following top-level entries:
Directoryaerospike-client-sdk-workshop
Directoryconfig/
- …
Directorydata/ 200 product JSON files auto-loaded on first run
- …
Directoryspring-server/ Java source code you edit in this tutorial
- …
Directorywebsite/
- …
Directoryworkshop/
- …
- .gitignore
- docker-compose.yml runs the local single-node Aerospike Database
- guide-to-java-sdk.md
- new_client_tester_prompts.md
- README.md
- usability_test_script.md