diff --git a/search_api_db/tests/modules/search_api_test_db/config/install/search_api.server.database_search_server.yml b/search_api_db/tests/modules/search_api_test_db/config/install/search_api.server.database_search_server.yml
index a959583..fcbda38 100644
--- a/search_api_db/tests/modules/search_api_test_db/config/install/search_api.server.database_search_server.yml
+++ b/search_api_db/tests/modules/search_api_test_db/config/install/search_api.server.database_search_server.yml
@@ -41,4 +41,6 @@ backendPluginConfig:
     database_search_index: search_api_db_database_search_index
 status: 1
 langcode: en
-dependencies: {  }
+dependencies:
+  module:
+    - search_api_db
diff --git a/src/Datasource/DatasourceInterface.php b/src/Datasource/DatasourceInterface.php
index f669260..e51b6de 100644
--- a/src/Datasource/DatasourceInterface.php
+++ b/src/Datasource/DatasourceInterface.php
@@ -172,4 +172,22 @@ interface DatasourceInterface extends IndexPluginInterface {
    */
   public function getItemIds($limit = -1, $from = NULL);
 
+
+  /**
+   * Returns the list of dependencies of this datasource.
+   *
+   * @return array
+   *   An array of dependencies keyed by the type of dependency. For example:
+   * @code
+   * array(
+   *   'module' => array(
+   *     'node',
+   *     'field',
+   *     'image'
+   *   ),
+   * );
+   * @endcode
+   */
+  public function getDependencies();
+
 }
diff --git a/src/Datasource/DatasourcePluginBase.php b/src/Datasource/DatasourcePluginBase.php
index e70e80d..35e831c 100644
--- a/src/Datasource/DatasourcePluginBase.php
+++ b/src/Datasource/DatasourcePluginBase.php
@@ -64,4 +64,14 @@ abstract class DatasourcePluginBase extends IndexPluginBase implements Datasourc
   public function viewMultipleItems(array $items, $view_mode, $langcode = NULL) {
     return array_fill_keys(array_keys($items), array());
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return array(
+      'module' => array($this->getPluginDefinition()['provider']),
+    );
+  }
+
 }
diff --git a/src/Entity/Index.php b/src/Entity/Index.php
index 0877181..1118faa 100644
--- a/src/Entity/Index.php
+++ b/src/Entity/Index.php
@@ -1211,10 +1211,25 @@ class Index extends ConfigEntityBase implements IndexInterface {
     parent::calculateDependencies();
 
     // Indexes that have a server assigned need to depend on it.
-    if ($this->hasValidServer() && ($server = $this->getServer())) {
+    if ($server = $this->getServer()) {
       $this->addDependency('entity', $server->getConfigDependencyName());
     }
 
+    // Add a dependency on the module that provides the tracker for this index.
+    if ($tracker = $this->getTracker()) {
+      $this->addDependency('module', $tracker->getPluginDefinition()['provider']);
+    }
+
+    // Add dependencies on the modules that provide processors for this index.
+    foreach ($this->getProcessors() as $processor) {
+      $this->addDependency('module', $processor->getPluginDefinition()['provider']);
+    }
+
+    // Add the list of datasource dependencies collected from the plugin itself.
+    foreach ($this->getDatasources() as $datasource) {
+      $this->addDependencies($datasource->getDependencies());
+    }
+
     return $this->dependencies;
   }
 
diff --git a/src/Entity/Server.php b/src/Entity/Server.php
index 4d42ece..e1e42c5 100644
--- a/src/Entity/Server.php
+++ b/src/Entity/Server.php
@@ -442,4 +442,19 @@ class Server extends ConfigEntityBase implements ServerInterface, PluginFormInte
     }
     $delete->execute();
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function calculateDependencies() {
+    parent::calculateDependencies();
+
+    // Add a dependency on the module that provides the backend for this server.
+    if ($this->hasValidBackend() && ($backend = $this->getBackend())) {
+      $this->addDependency('module', $backend->getPluginDefinition()['provider']);
+    }
+
+    return $this->dependencies;
+  }
+
 }
diff --git a/src/Plugin/SearchApi/Datasource/ContentEntityDatasource.php b/src/Plugin/SearchApi/Datasource/ContentEntityDatasource.php
index c536b82..34e8b9e 100644
--- a/src/Plugin/SearchApi/Datasource/ContentEntityDatasource.php
+++ b/src/Plugin/SearchApi/Datasource/ContentEntityDatasource.php
@@ -11,6 +11,10 @@ use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\TypedData\ComplexDataInterface;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\FieldConfigInterface;
+use Drupal\field\FieldInstanceConfigInterface;
+use Drupal\search_api\Index\IndexInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Entity\EntityManager;
 use Drupal\search_api\Datasource\DatasourcePluginBase;
@@ -543,4 +547,77 @@ class ContentEntityDatasource extends DatasourcePluginBase implements ContainerF
     return $indexes;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    $dependencies = array(
+      'module' => array($this->getEntityType()->getProvider()),
+    ) + parent::getDependencies();
+
+    $plugin_id = $this->getPluginId();
+    $fields = array();
+    array_filter(array_keys($this->getIndex()->getFields()), function ($value) use ($plugin_id, &$fields) {
+      if (strpos($value, $plugin_id . IndexInterface::DATASOURCE_ID_SEPARATOR) !== FALSE) {
+        $fields[] = substr($value, strlen($plugin_id . IndexInterface::DATASOURCE_ID_SEPARATOR));
+      }
+    });
+    if ($field_dependencies = $this->getFieldDependencies($fields, $this->getEntityTypeId())) {
+      $dependencies += array('entity' => array_keys($field_dependencies));
+    }
+
+    return $dependencies;
+  }
+
+  /**
+   * Returns an array of 'field_config' and 'field_instance_config' config
+   * entity dependencies.
+   *
+   * @param array $fields
+   *   An array of field names, as returned by
+   *   \Drupal\search_api\Index\IndexInterface::getFields().
+   * @param string $entity_type_id
+   *   The entity type to which these fields are attached to.
+   *
+   * @return array
+   *   An array of config entity IDs.
+   */
+  protected function getFieldDependencies($fields, $entity_type_id) {
+    $field_dependencies = array();
+
+    // Figure out which fields are directly on the item and which need to be
+    // extracted from nested items.
+    $direct_fields = array();
+    $nested_fields = array();
+    foreach ($fields as $field) {
+      if (strpos($field, ':entity:') !== FALSE) {
+        list($direct, $nested) = explode(':entity:', $field, 2);
+        $nested_fields[$direct][] = $nested;
+      }
+      elseif (strpos($field, ':') === FALSE) {
+        $direct_fields[] = $field;
+      }
+    }
+
+    // Extract the config dependency name for direct fields.
+    foreach (array_keys($this->entityManager->getBundleInfo($entity_type_id)) as $bundle) {
+      foreach ($this->entityManager->getFieldDefinitions($entity_type_id, $bundle) as $field_name => $field_definition) {
+        if ($field_definition instanceof FieldInstanceConfigInterface) {
+          if (in_array($field_name, $direct_fields) || isset($nested_fields[$field_name])) {
+            $field_dependencies[$field_definition->getConfigDependencyName()] = TRUE;
+            $field_dependencies[$field_definition->getField()->getConfigDependencyName()] = TRUE;
+          }
+
+          // Recurse for nested fields.
+          if (isset($nested_fields[$field_name])) {
+            $entity_type = $field_definition->getSetting('target_type');
+            $field_dependencies += $this->getFieldDependencies($nested_fields[$field_name], $entity_type);
+          }
+        }
+      }
+    }
+
+    return $field_dependencies;
+  }
+
 }
