Layer 4: API Layer
Background
As the top level of the library, the API layer provides the final mapping from protobuf requests & responses to the API functions that the user calls.
Bluzelle allows for basic operations (create, read, update, delete) alongside administrative calls (createDB, deleteDB, addWriters, ..). See bluzelle-js.
There is also a "status" call that is independent of the database calls. It receives swarm metadata.
Specification
Outgoing messages are of the
database_msg
orstatus_request
types.Incoming messages are of the
database_response
orstatus_response
types.Requests and responses are always matched up (ie. a
read_request
receives aread_response
).Any message can receive a
database_error
, which has an embedded error message.
As shown in database.proto, keys are strings and values are binary.
Keys should be enforced to 4kB and values to 256kB.
The API should be non-blocking while asynchronous calls are being made (there are usually language-dependent constructions for handling asynchronous behavior).
Last updated
Was this helpful?