diff --git a/core/modules/statistics/lib/Drupal/statistics/DatabaseStatisticsBackend.php b/core/modules/statistics/lib/Drupal/statistics/DatabaseStatisticsBackend.php
new file mode 100644
index 0000000..0adf5d0
--- /dev/null
+++ b/core/modules/statistics/lib/Drupal/statistics/DatabaseStatisticsBackend.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * Definition of Drupal\statistics\StatisticsBackend.
+ */
+
+namespace Drupal\statistics;
+
+use Drupal\statistics\StatisticsBackendInterface;
+
+/**
+ * @todo Add proper documentation.
+ */
+class DatabaseStatisticsBackend implements StatisticsBackendInterface {
+
+  public function save($nid) {
+    db_merge('node_counter')
+       ->key(array('nid' => $nid))
+       ->fields(array(
+         'daycount' => 1,
+         'totalcount' => 1,
+         'timestamp' => REQUEST_TIME,
+       ))
+       ->expression('daycount', 'daycount + 1')
+       ->expression('totalcount', 'totalcount + 1')
+       ->execute();
+  }
+}
\ No newline at end of file
diff --git a/core/modules/statistics/lib/Drupal/statistics/StatisticsBackendInterface.php b/core/modules/statistics/lib/Drupal/statistics/StatisticsBackendInterface.php
new file mode 100644
index 0000000..4f14147
--- /dev/null
+++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsBackendInterface.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Definition of Drupal\statistics\StatisticsBackendInterface.
+ */
+
+namespace Drupal\statistics;
+
+/**
+ * @todo Add proper documentation.
+ */
+interface StatisticsBackendInterface {
+
+  public function save($nid);
+
+}
\ No newline at end of file
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index ef1bceb..212dc9b 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -44,6 +44,16 @@ function statistics_help($path, $arg) {
 }
 
 /**
+ * Implements hook_init().
+ */
+function statistics_init() {
+  // Define the mappings to the statistics wrapper. We register this in
+  // the Drupal container so that it can be re-registered with a
+  // different backend later on.
+  drupal_container()->register('statistics', 'Drupal\\statistics\\DatabaseStatisticsBackend');
+}
+
+/**
  * Implements hook_exit().
  *
  * Gathers statistics for page accesses.
diff --git a/core/modules/statistics/statistics.php b/core/modules/statistics/statistics.php
index 040dc19..36d4634 100644
--- a/core/modules/statistics/statistics.php
+++ b/core/modules/statistics/statistics.php
@@ -14,20 +14,11 @@ chdir('../../..');
 define('DRUPAL_ROOT', getcwd());
 
 include_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
-drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
 if (variable_get('statistics_count_content_views', 0)) {
   $nid = $_POST['nid'];
   if (is_numeric($nid)) {
-    db_merge('node_counter')
-      ->key(array('nid' => $nid))
-      ->fields(array(
-        'daycount' => 1,
-        'totalcount' => 1,
-        'timestamp' => REQUEST_TIME,
-      ))
-      ->expression('daycount', 'daycount + 1')
-      ->expression('totalcount', 'totalcount + 1')
-      ->execute();
+    drupal_container()->get('statistics')->save($nid);
   }
-}
-
+}
\ No newline at end of file
