Building and deploying hooks

Hooks are provided as a means for developers to extend the functionality of the BlobCity
DB. Hooks can be modules that perform independent actions based on actions that are
performed on the database. Hooks can also be independent modules that affect the
functioning of the database, and can change the behaviour of default functions of the
database. They can also be used to monitor and approve ACID transactions performed on
the database.

Hooks that observe
These are hooks that listen to actions happening on the database. They can observe all
operations on data including insertion, updation and deletion of records. Such hooks
could be used to move data at low latencies between BlobCity and other data systems.
Observer hooks are commonly called as event hooks in BlobCity.

Transactional Hooks
These are hooks invoked for transactions performed on the database. The transactions can
be data insertion, updation and deletion operatiosn. The item/s in transaction are passed
to the hook during an ongoing transaction. The insert, update and delete operation is not
committed unless the hook confirms back that it is okay to commit the transaction. Such
hooks can be used to extend transactional functionality of the database. An example could
be waiting for response from an external fraud analytics module to approve a financial
transaction being performed on the database.

At any point in time multiple Hooks may be associated with specific datastore or
collections within the datastore. Both transaction and event hooks can co-exist at any
point in time. A single transaction can be controlled by multiple transaction hooks as well,
but the order of execution of the multiple transaction hooks cannot be guaranteed.