Diff between Database API and MAAPI

We are incorporating confd support in our application and we started implementation by using the examples provided.

We are using confd_cli.

One thing which is confusing is when to to use MAAPI API’s and when to use Database API’s

In user guide , i found below description of MAAPI
“MAAPI is a northbound interface API which can be used to perform all read and write operations towards ConfD. It is possible to implement any proprietary configuration Agent with MAAPI.”

In our implementation we are using MAAPi API’s only to read data from CDB.

I want to know when we use MAAPI.

Thanks
Durga Prakash

Hello,

as ConfD User Guide (chapter 23.1) says, MAAPI is C API which provides full access to the ConfD internal transaction engine.

With CDB API you can just read (committed) configuration from the CDB. You cannot write or modify it.
CDB has functions like cdb_set_value, but these functions are intended for operational (state) data only, not for config data.

Whith MAAPI you can create or attach to existing transaction and access configuration data in the CDB (write or read - e.g. just like if user configures in CLI). The modifications will be then propagated at commit time of the transaction.

See chapter 23.1 for typical MAAPI usage scenarios.

Reading data through MAAPI returns configuration data in the state which corresponds
to the transaction modification , whereas CDB reading returns only committed configuration state.
The values may differ until transaction is fully committed.

If you want to read from CDB only configuration that is commited, you should use CDB API.

Thanks for the detailed explanation.