kununu / projections
Handle projections of items to cache
Installs: 2 671
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
Requires (Dev)
- ext-igbinary: *
- ext-json: *
- ext-zlib: *
- jms/serializer: ^3.28
- kununu/scripts: >=4.0
- phpunit/phpunit: ^10.5
- symfony/cache: ^6.4
- symfony/property-access: ^6.4
- symfony/serializer: ^6.4
- symfony/yaml: ^6.4
Suggests
- ext-igbinary: To use IgBinary cache serializers
- ext-zlib: To use deflated cache serializers
- jms/serializer: To use JMSSerializer cache serializers
- symfony/cache: To use SymfonyCacheProjectionRepository
- symfony/property-access: To use Symfony Serializer cache serializers
- symfony/serializer: To use Symfony Serializer cache serializers
README
Projections are a temporary storage and are a way to access data faster than fetching it from a regular storage (e.g. getting data from a cache vs from the database).
Data needs to be projected first so that its projection can be accessed without the need to access the actual source of truth, which is usually a slower process.
Projections have a short lifetime, and are not updated automatically if data in source of truth changes. So they need to be frequently refreshed.
Overview
This repository contains the interfaces to implement projections logic.
It also includes an implementation of the projection over the Symfony's Tag Aware Cache Pool component, which can use several cache providers, like Memcached, Redis or simply process memory, amongst others.
Installation
Require this library to your project
composer require kununu/projections
If you wish to have projections implemented via Symfony's Tag Aware Cache Pool, you must also request the required packages for that implementation
composer require symfony/cache
Also you will need to include a serializer (e.g. JMSSerializer)
composer require jms/serializer
(Or, in this example, if you want to use this library on a Symfony App you may want to require the jms/serializer-bundle
instead of jms/serializer
)
composer require jms/serializer-bundle