diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php
index 02a5625..c37b679 100644
--- a/core/lib/Drupal/Core/CoreServiceProvider.php
+++ b/core/lib/Drupal/Core/CoreServiceProvider.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Cache\CacheContextsPass;
 use Drupal\Core\Cache\ListCacheBinsPass;
+use Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass;
@@ -44,11 +45,14 @@ public function register(ContainerBuilder $container) {
     $this->registerUuid($container);
     $this->registerTest($container);
 
+
     // Add the compiler pass that lets service providers modify existing
     // service definitions. This pass must come first so that later
     // list-building passes are operating on the post-alter services list.
     $container->addCompilerPass(new ModifyServiceDefinitionsPass());
 
+    $container->addCompilerPass(new BackendCompilerPass());
+
     // Collect tagged handler services as method calls on consumer services.
     $container->addCompilerPass(new TaggedHandlersPass());
 
diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php
new file mode 100644
index 0000000..d5a07d2
--- /dev/null
+++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass.
+ */
+
+namespace Drupal\Core\DependencyInjection\Compiler;
+
+use Symfony\Component\DependencyInjection\Alias;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+/**
+ * Defines a compiler pass to allow automatic override per backend.
+ *
+ * A module developer has to tag his backend service with "backend_overridable":
+ * @code
+ * custom_service:
+ *   class: ...
+ *   tags:
+ *     - { name: backend_overridable }
+ * @endcode
+ *
+ * As a site admin you set the 'default_backend' in your services.yml file:
+ * @code
+ * parameters:
+ *   default_backend: sqlite
+ * @endcode
+ *
+ * As a developer for alternative storage engines you register a service with
+ * $yourbackend.$original_service:
+ *
+ * @code
+ * sqlite.custom_service:
+ *   class: ...
+ * @endcode
+ */
+class BackendCompilerPass implements CompilerPassInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function process(ContainerBuilder $container) {
+    $default_backend = $container->hasParameter('default_backend') ? $container->getParameter('default_backend') : 'mysql';
+
+    foreach ($container->findTaggedServiceIds('backend_overridable') as $id => $attributes) {
+      // If the service is already an alias it is not the original backend, so
+      // we don't want to fallback to other storages any longer.
+      if ($container->hasAlias($id)) {
+        continue;
+      }
+      if ($container->hasDefinition("$default_backend.$id")) {
+        $container->setDefinition($id, new Alias("$default_backend.$id"));
+      }
+    }
+  }
+
+}
+
