Drupal and MongoDB or the road to APIs
Drupal 7
What went well? Entity-field storage: node, comment, user... Session (frequent writes) Watchdog (capped collection) Cache
What worked out so-so? Blocks. Unmaintainable solution.
Where were things stored? List of modules: system table Date formats: date_format_type date_formats date_format_locale tables Text formats: filter filter_format tables Arbitrary contrib arbitrary table
How were things handled? Field widgets, formatters: Some info hook settings stored in an arbitrary table handled by arbitrary callbacks Cache, query: variable_get defines include file variable_get defines settings
Consequences Even with a SQL abstraction driver, full MongoDB is practically impossible. Pluggability is totally arbitrary
Drupal 8 There can be only one
Where are things stored? List of modules: CMI Date formats: CMI Text formats: CMI Arbitrary contrib: CMI or bust
How are things handled? Defined in a dependency injection container: easy and uniform to change Annotated classes: every kind of plugin has the same metadata definition Again, settings in CMI
So how will MongoDB fit? Inject via the DIC Sweep up the remaining little via a DB driver, but this is limited.
MongoDB distribution Necessary to be able to install without MySQL Ability to change things early and keep them changed
Existing drivers? Session: might become Symfony, then needs new driver Watchdog: this might change to Monolog or PSR-3. Entity storage: hopefully base entity storage also (I will work on this)
New drivers File usage Flood
CMI "driver" CMI canonical is YAML file Plus caching We have a cache driver For speed on queries, do not serialize on cache_config (other bins might have objects/arrays so serialize needed)