Object Store

FlowBasis uses an object store (as opposed to a traditional relational database) for persisting, retrieving, and updating data. Objects are simply a collection of data stored at a particular path. The default implementation of the object store in FlowBasis simply stores every object as a file on disk, but anyone could implement an alternate version of FlowBasis_Data_IObjectStore that uses a SQL database, cloud storage, or stone tablets as a backend.

JSON

JSON stands for JavaScript Object Notation, and if you dig through the FlowBasis source, you'll quickly realize that JSON is the preferred format of choice for FlowBasis. JSON is easily usable from client-side javascript or within PHP on the server. JSON is the format objects are transmitted in from the client to the server and back again for remote procedure calls (AJAX stuff), and it's the format of objects saved in the FlowBasis object store.

A sample JSON object declaration in JavaScript might look like:

var bob = { username: "bob", favoriteNumbers: [42, 37, 100] };

In PHP, this could be declared as:

$bob = new stdClass;
$bob->username = "bob";
$bob->favoriteNumbers = array(42, 37, 100);

The FlowBasis object store and RPC (remote procedure call) components will automatically convert PHP objects into JSON and back to PHP objects where needed.

Multiple Object Stores

There are multiple object stores in use within the FlowBasis infrastructure, and each object store has its own object namespace (i.e. "pets/rover" in object store A is a completely different object than "pets/rover" in object store B). There is a default site object store -- see FlowBasis::getSiteObjectStore() -- that is used by many of the system components. Each module instance (module types include blog and wiki) also has it own separate object store.

Searching and Indexing

The object store does not provide any indexing or searching of data by itself. It is strictly a way to store a collection of data at a given path. The object store provides a limited browsing capability where you can ask for a list of objects at a particular path or for a list of object folders at a particular path. To provide more advanced searching, you can create a resource provider that maps objects to searchable resources in the system (used by the FlowBasis Blog and FlowBasis Wiki modules). Alternatively, you can create your own object views within the object store that map values back to other objects -- see FlowBasis_Accounts_AccountManager handling of roles for an example.