Skip to main content

Aerospike

Configuration

First of all, we need to define an Aerospike connection in our dozer-config.yaml which can then be used as a sink.

An Aerospike connection configuration has the following parameters.

Parameter NameTypeDescription
hostsStringThe host and port of the Aerospike server.
namespaceStringThe namespace for your Aerospike connection.
setsListA list of sets within the namespace.
replicationObject (Optional)Server configuration for receiving replication messages from Aerospike during ingestion.

Replication Parameters

  • server_address:

    The address of the server used to receive replication messages from Aerospike. Default is 0.0.0.0.0.

  • server_port:

    The port of the server. Default is 5929.

Example:

connections:
- config: !Aerospike
hosts: localhost:3000
namespace: test
sets:
- customers
- transactions

name: aerospike

After an Aerospike connection has been setup,the following configuration block can be used in dozer-config.yaml to define a new Aerospike sink.

This particular configuration is designed to replicate data from a table named transactions from the source, to the set transactions within the test namespace (after denormalisation) in the Aerospike connection referenced by the name aerospike.

Example:

sinks:
- name: transactions
config: !Aerospike
connection: aerospike
tables:
- namespace: test
set_name: transactions
source_table_name: transactions
denormalize:
- from_namespace: test
from_set: customers
key: CUSTOMER_ID
columns:
- PHONE_NUMBER

Parameters

Parameter NameTypeDescription
connectionStringThe corresponding connection for Aerospike which is being used as a destination
tablesListList of tables to write to on destination sink. Parameters for table configuration.
n_threadsIntegerThe maximum number of threads to spawn to write to Aerospike sink.

Table Parameters

Parameter NameTypeDescription
namespaceStringThe namespace for the table.
set_nameStringThe set within the namespace for the table.
source_table_nameStringThe name of the table in the source database.
denormalizeListA list of denormalization rules to apply to the data before writing it to the destination.

Denormalisation Parameters

Parameter NameTypeDescription
from_namespaceStringThe namespace for the source record.
from_setStringThe set within the namespace for the source record.
keyStringThe key to use to join the source and destination records.
columnsListA list of columns to copy from the source record to the destination record.

In essence, it is like a left-join, so the example sink configuration is equivalent to the following SQL query:

SELECT t.*, c.PHONE_NUMBER 
FROM transactions AS t
LEFT JOIN customers AS c ON t.CUSTOMER_ID = c.PK -- PK being the aerospike key here