SObjStore

Categories

Component ID

1358954

Component name

SObjStore

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

SObjStore or Schema-less Object Store

This project is designed to support schema less (well, almost) storage of PHP objects in the MySQL database without compromise on read performance. You can view this is a poor man's mongodb running within mysql.

The object is stored as as serialized PHP object in a table. One object is stored in every row of the table. What is interesting is that arbitrary fields of the object can be "exposed" as columns in the database table. For that we declare the columns in hook_schema(). These columns can be indexed and unique keys can be added on them. This makes read accesses to this table performant and scalable.

Don't want a particular field of the PHP object as a column? Want a field in the object exposed as a column? Want to change the settings of a particular field? Simply change the hook_schema() and run

drush sms <name-of-table>

and the schema gets magically migrated.

Want to refresh the columns (from the data stored in the serialized object) ? run

drush srd <name-of-table>

You would typically run drush srd after drush sms.

Views integration is automatically generated for each table managed by SObjstore.

APIs are available to
- save an object. You never need to worry about SQL statements
- load an object with a particular primary key
- query an object meeting certain conditions. Using a simple syntax. For complicated queries you should use DBTNG.

The module does simple caching to improve performance for object loads.

See an example of how to use this in the enclosed sobjstore_example folder.

For Drupal 6.x. Requires views, autoload, DBTNG (database next generation), schema modules.

Under active development. Definitely not ready for production but can be used for testing and evaluation.