Skip to content

Migrating from classic client

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 classic 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. Ensure your Aerospike server is compatible (version 6.0+)
  2. The Developer SDK is a separate package — it doesn’t replace the classic client
  3. You can run both clients side-by-side during migration

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)
);

Key and record references

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

SDK: DataSet represents namespace + set, .id() creates record references

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

Operation mapping

Create (put)

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

Read (get)

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

Update

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

Delete

client.delete(null, key);

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 classic client when migration complete

Option 2: full migration

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

What’s not supported (yet)

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

  • Admin operations (cluster management)
  • HyperLogLog
  • GeoJSON queries
  • Some complex expression in the AEL

For these features, continue using the classic client alongside Developer SDK.

Next steps

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?