Skip to content

Migrating from legacy client

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

Applies to

  • Aerospike Developer SDK (Java 21+ and Python 3.11+)
  • Aerospike Database 6.0 or later unless a section states otherwise

This guide helps you migrate an existing application from the Classic Aerospike client to the Developer SDK.

Why migrate?

The Developer SDK offers several advantages over the legacy client:

  • Cleaner syntax — Chainable, fluent APIs reduce boilerplate
  • AEL queries — Human-readable filter expressions
  • Better error handling — Actionable errors with recovery suggestions
  • Decoupled configuration — Separate connection from behavior

Before you start

  1. Confirm your Aerospike server is compatible (version 6.0 or later).
  2. Install the Developer SDK as a separate package. It does not replace the legacy client.
  3. Plan to run both clients side by side during migration if you need a gradual cutover.
  4. Inventory the secondary indexes your filtered queries depend on. See Query with filters.

Conceptual changes

Connection model

Classic: Direct client with embedded configuration

SDK: Separate Cluster (connection) and Session (behavior)

// Classic: Everything in one place
AerospikeClient client = new AerospikeClient(
new ClientPolicy(),
new Host("localhost", 3000)
);

📖 API reference: Host(String,int) | Host(String,String,int)

Key and record references

Classic: Explicit Key objects with namespace, set, and user key

SDK: DataSet represents namespace + set, .id() creates a Key

Key key = new Key("test", "users", "user-1");

📖 API reference: Key

Operation mapping

Create (put)

client.put(null, key, new Bin("name", "Alice"), new Bin("age", 30));

📖 API reference: com.aerospike.client.sdk

Read (get)

Record record = client.get(null, key);
String name = record.getString("name");

📖 API reference: Record.getString(...)

Update

client.put(null, key, new Bin("visits", 1), new Bin("updated", true));

📖 API reference: com.aerospike.client.sdk

Delete

client.delete(null, key);

📖 API reference: com.aerospike.client.sdk

Query with filters

Statement stmt = new Statement();
stmt.setNamespace("test");
stmt.setSetName("users");
stmt.setFilter(Filter.range("age", 21, 100));
RecordSet rs = client.query(null, stmt);
while (rs.next()) {
Record record = rs.getRecord();
// process record
}

Migration strategy

Option 1: gradual migration

  1. Add Developer SDK dependency alongside classic
  2. Create new features with Developer SDK
  3. Migrate existing code incrementally
  4. Remove legacy client when migration complete

Option 2: full migration

  1. Create a feature branch
  2. Replace all legacy client calls with Developer SDK equivalents
  3. Run comprehensive tests
  4. Deploy with confidence

What’s not supported (yet)

Some advanced features from the legacy client are not yet available in the Developer SDK:

  • Admin operations (cluster management)

HyperLogLog and GeoJSON are supported in the Python SDK. See Update records and Secondary indexes.

Next steps