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