diff --git a/core/core.services.yml b/core/core.services.yml
index 05067ab598..5e4c6ecfa1 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -206,7 +206,7 @@ services:
       - [setContainer, ['@service_container']]
   cache.backend.database:
     class: Drupal\Core\Cache\DatabaseBackendFactory
-    arguments: ['@database', '@cache_tags.invalidator.checksum', '@settings']
+    arguments: ['@database', '@cache_tags.invalidator.checksum', '@settings', '@serialization.phpserialize']
     tags:
       - { name: backend_overridable }
   cache.backend.apcu:
diff --git a/core/lib/Drupal/Component/Serialization/ObjectAwareSerializationInterface.php b/core/lib/Drupal/Component/Serialization/ObjectAwareSerializationInterface.php
new file mode 100644
index 0000000000..6177550363
--- /dev/null
+++ b/core/lib/Drupal/Component/Serialization/ObjectAwareSerializationInterface.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Component\Serialization;
+
+// cspell:ignore serializers igbinary
+
+/**
+ * Ensures that a serializer is usable for serializing PHP objects.
+ *
+ * Other Serializers that implement the SerializationInterface, for example
+ * serializers that use JSON or YAML, are suitable for different PHP types
+ * except objects. Serializers that implement the
+ * ObjectAwareSerializationInterface instead are clearly indicating that they're
+ * suitable for PHP objects, for example using the PHP string serialization
+ * format or the igbinary format.
+ */
+interface ObjectAwareSerializationInterface extends SerializationInterface {
+}
diff --git a/core/lib/Drupal/Component/Serialization/PhpSerialize.php b/core/lib/Drupal/Component/Serialization/PhpSerialize.php
index 1f7e03d75b..a5e47220cc 100644
--- a/core/lib/Drupal/Component/Serialization/PhpSerialize.php
+++ b/core/lib/Drupal/Component/Serialization/PhpSerialize.php
@@ -5,7 +5,7 @@
 /**
  * Default serialization for serialized PHP.
  */
-class PhpSerialize implements SerializationInterface {
+class PhpSerialize implements ObjectAwareSerializationInterface {
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index 879ffae669..259689dfc5 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Serialization\ObjectAwareSerializationInterface;
 use Drupal\Component\Assertion\Inspector;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Database\Connection;
@@ -46,6 +47,12 @@ class DatabaseBackend implements CacheBackendInterface {
    */
   protected $bin;
 
+  /**
+   * The serializer to use.
+   *
+   * @var \Drupal\Component\Serialization\ObjectAwareSerializationInterface
+   */
+  protected $serializer;
 
   /**
    * The database connection.
@@ -73,8 +80,10 @@ class DatabaseBackend implements CacheBackendInterface {
    * @param int $max_rows
    *   (optional) The maximum number of rows that are allowed in this cache bin
    *   table.
+   * @param \Drupal\Component\Serialization\ObjectAwareSerializationInterface|null $serializer
+   *   (optional) The serializer to use.
    */
-  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, $max_rows = NULL) {
+  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, $max_rows = NULL, ObjectAwareSerializationInterface $serializer = NULL) {
     // All cache tables should be prefixed with 'cache_'.
     $bin = 'cache_' . $bin;
 
@@ -82,6 +91,11 @@ public function __construct(Connection $connection, CacheTagsChecksumInterface $
     $this->connection = $connection;
     $this->checksumProvider = $checksum_provider;
     $this->maxRows = $max_rows === NULL ? static::DEFAULT_MAX_ROWS : $max_rows;
+    if (!$serializer) {
+      @trigger_error('Calling ' . __METHOD__ . ' without the $serializer argument is deprecated in drupal:9.4.0 and it will be required in drupal:10.0.0. See https://www.drupal.org/node/3014684', E_USER_DEPRECATED);
+      $serializer = \Drupal::service('serialization.phpserialize');
+    }
+    $this->serializer = $serializer;
   }
 
   /**
@@ -164,7 +178,7 @@ protected function prepareItem($cache, $allow_invalid) {
 
     // Unserialize and return the cached data.
     if ($cache->serialized) {
-      $cache->data = unserialize($cache->data);
+      $cache->data = $this->serializer->decode($cache->data);
     }
 
     return $cache;
@@ -242,7 +256,7 @@ protected function doSetMultiple(array $items) {
       }
 
       if (!is_string($item['data'])) {
-        $fields['data'] = serialize($item['data']);
+        $fields['data'] = $this->serializer->encode($item['data']);
         $fields['serialized'] = 1;
       }
       else {
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
index 175639444c..a8f85c99f9 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
@@ -2,11 +2,19 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Serialization\ObjectAwareSerializationInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Site\Settings;
 
 class DatabaseBackendFactory implements CacheFactoryInterface {
 
+  /**
+   * The serializer to use.
+   *
+   * @var \Drupal\Component\Serialization\ObjectAwareSerializationInterface
+   */
+  protected $serializer;
+
   /**
    * The database connection.
    *
@@ -37,13 +45,20 @@ class DatabaseBackendFactory implements CacheFactoryInterface {
    *   The cache tags checksum provider.
    * @param \Drupal\Core\Site\Settings $settings
    *   (optional) The site settings.
+   * @param \Drupal\Component\Serialization\ObjectAwareSerializationInterface|null $serializer
+   *   (optional) The serializer to use.
    *
    * @throws \BadMethodCallException
    */
-  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL) {
+  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL, ObjectAwareSerializationInterface $serializer = NULL) {
     $this->connection = $connection;
     $this->checksumProvider = $checksum_provider;
     $this->settings = $settings ?: Settings::getInstance();
+    if (!$serializer) {
+      @trigger_error('Calling ' . __METHOD__ . ' without the $serializer argument is deprecated in drupal:9.4.0 and it will be required in drupal:10.0.0. See https://www.drupal.org/node/3014684', E_USER_DEPRECATED);
+      $serializer = \Drupal::service('serialization.phpserialize');
+    }
+    $this->serializer = $serializer;
   }
 
   /**
@@ -57,7 +72,7 @@ public function __construct(Connection $connection, CacheTagsChecksumInterface $
    */
   public function get($bin) {
     $max_rows = $this->getMaxRowsForBin($bin);
-    return new DatabaseBackend($this->connection, $this->checksumProvider, $bin, $max_rows);
+    return new DatabaseBackend($this->connection, $this->checksumProvider, $bin, $max_rows, $this->serializer);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 42eb60d5d0..fd2aa818c2 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -6,6 +6,7 @@
 use Drupal\Component\Assertion\Handle;
 use Drupal\Component\EventDispatcher\Event;
 use Drupal\Component\FileCache\FileCacheFactory;
+use Drupal\Component\Serialization\PhpSerialize;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Cache\DatabaseBackend;
 use Drupal\Core\Config\BootstrapConfigStorageFactory;
@@ -80,12 +81,21 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
       ],
       'cache.container' => [
         'class' => 'Drupal\Core\Cache\DatabaseBackend',
-        'arguments' => ['@database', '@cache_tags_provider.container', 'container', DatabaseBackend::MAXIMUM_NONE],
+        'arguments' => [
+          '@database',
+          '@cache_tags_provider.container',
+          'container',
+          DatabaseBackend::MAXIMUM_NONE,
+          '@serialization.phpserialize',
+        ],
       ],
       'cache_tags_provider.container' => [
         'class' => 'Drupal\Core\Cache\DatabaseCacheTagsChecksum',
         'arguments' => ['@database'],
       ],
+      'serialization.phpserialize' => [
+        'class' => PhpSerialize::class,
+      ],
     ],
   ];
 
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
index a93b674d5c..a186ba1712 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
@@ -20,7 +20,7 @@ class ChainedFastBackendTest extends GenericCacheBackendUnitTestBase {
    *   A new ChainedFastBackend object.
    */
   protected function createCacheBackend($bin) {
-    $consistent_backend = new DatabaseBackend(\Drupal::service('database'), \Drupal::service('cache_tags.invalidator.checksum'), $bin, 100);
+    $consistent_backend = new DatabaseBackend(\Drupal::service('database'), \Drupal::service('cache_tags.invalidator.checksum'), $bin, 100, \Drupal::service('serialization.phpserialize'));
     $fast_backend = new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'));
     $backend = new ChainedFastBackend($consistent_backend, $fast_backend, $bin);
     // Explicitly register the cache bin as it can not work through the
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
index 1b62d89451..eb7a04e6ca 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
@@ -32,7 +32,7 @@ class DatabaseBackendTest extends GenericCacheBackendUnitTestBase {
    *   A new DatabaseBackend object.
    */
   protected function createCacheBackend($bin) {
-    return new DatabaseBackend($this->container->get('database'), $this->container->get('cache_tags.invalidator.checksum'), $bin, static::$maxRows);
+    return new DatabaseBackend($this->container->get('database'), $this->container->get('cache_tags.invalidator.checksum'), $bin, static::$maxRows, $this->container->get('serialization.phpserialize'));
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
index 1d735d511d..357f4e57c7 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
@@ -9,6 +9,7 @@
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\user\Entity\User;
 use Symfony\Component\DependencyInjection\Reference;
+use Drupal\Component\Serialization\PhpSerialize;
 
 /**
  * Tests that cache tag invalidation queries are delayed to the end of transactions.
@@ -53,11 +54,13 @@ protected function setUp(): void {
   public function register(ContainerBuilder $container) {
     parent::register($container);
 
+    $container->register('serializer', PhpSerialize::class);
     // Register a database cache backend rather than memory-based.
     $container->register('cache_factory', DatabaseBackendFactory::class)
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'))
-      ->addArgument(new Reference('settings'));
+      ->addArgument(new Reference('settings'))
+      ->addArgument(new Reference('serializer'));
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
index 3b19ba5542..bbb5ac405b 100644
--- a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
@@ -75,7 +75,8 @@ public function register(ContainerBuilder $container) {
     $container->register('cache_factory', 'Drupal\Core\Cache\DatabaseBackendFactory')
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'))
-      ->addArgument(new Reference('settings'));
+      ->addArgument(new Reference('settings'))
+      ->addArgument(new Reference('serialization.phpserialize'));
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
index 9d5ac4bdf9..a720fc70ea 100644
--- a/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use Drupal\Component\Serialization\PhpSerialize;
 use Drupal\Core\Cache\CacheTagsChecksumInterface;
 use Drupal\Core\Cache\DatabaseBackend;
 use Drupal\Core\Cache\DatabaseBackendFactory;
@@ -24,7 +25,8 @@ public function testGet(array $settings, $expected_max_rows_foo, $expected_max_r
     $database_backend_factory = new DatabaseBackendFactory(
       $this->prophesize(Connection::class)->reveal(),
       $this->prophesize(CacheTagsChecksumInterface::class)->reveal(),
-      new Settings($settings)
+      new Settings($settings),
+      new PhpSerialize()
     );
 
     $this->assertSame($expected_max_rows_foo, $database_backend_factory->get('foo')->getMaxRows());
