Matomo uses the database as a session handler. Matomo used to also support redis and file based session handlers, but these have been deprecated as of 2019 and do not work anymore.

Previous FAQ: How to configure Redis as a shared cache in a load balanced environment?