Here is the first in a number of posts about the Configuration Management system of Drupal 8. This system is certainly one of its most eagerly anticipated features, . The Configuration Management Initiative (CMI) was the, and we have learned a great deal during 1000s of hours of work on the initiative since that time. These places will share how and provide history and that which we have learned.
Store info that needs synchronising in the configuration system
Drupal 8 boats with four storage APIs that are leading. You also should save info and in the event you are writing a module, then where that info is stored by you is not unimportant. Which one to depends on which you’re keeping.
is somewhere to put away things which is distinctive to your specific site example. An example is the final time that cron has run. That is a thing that cannot be recalculated and must not be shared across production and development variants of the exact same site.
Is somewhere to put away things which is not cheap to compute but could be reconstructed. A good example with this is an array containing each of info that is the thing kind annotation. Drupal needs to read all the thing types that are annotated to get these records. Carrying this out is on every request is not cheap, so we save it. In the event the cache is cleared information which is cached must be rebuildable from code as well as other information save.
Is somewhere to save information which you would ever want to synchronise from development. This info isn’t normally generated by frequent users during normal site operation and is usually created during site building. The Configuration Management API comes in two flavours – the (straightforward) Config API as well as the Configuration Thing API. The crucial difference is the Config API is the singleton use case. Where there might be just one example of the configuration, a singleton is. An example will be the name of the site. The should be utilized to save multiple sets of configuration – for perspectives example node kinds, terminologies, and disciplines.
And obviously there’s the , which ought to be utilized for saving content, not configuration. Taxonomy terms nodes, and users are saved together with the Content Thing API. Occasionally the borders between configuration and content may be clouded, but that’s a subject for another blog post.