If your project requirements necessitate handling large amounts of data, the most common RDBMs will not be able to handle the load. Additionally, if your requirements are high performance, scalability, and no down time, then your choices for data storing are limited. We encourage you to check Aerospike, because it meets all these requirements. The question then concentrates on implementation. How can we implement Aerospike seamlessly in our project, as if it is a Phalcon core cache component?
In this recipe, we will implement the Aerospike adapter. With it you will be able to use the Aerospike database as a cache for your application.
Phalcon provides an interface for backend caching adapters. All we need to do is implement our functionality for Aerospike in a class implementing the Phalcon\Cache\BackendInterface
. This interface allows us to use any custom class that implements it in Phalcon as if we were using one of the existing cache adapters.