Aerospike can be used in either configuration. It simply depends on your use case.
Aerospike is a low latency and high transactions/second database, so it is ideal for either use case. You can deploy it as an edge cache, by running it only in-memory. However, thanks to it having persistence and clustering (resiliency), Aerospike can be used to replace the common two-layer data store architecture of cache + database. In fact, many users have replaced the replaced their prior more complicated storage systems with Aerospike. Aerospike is often used as the online transactional (OLTP) store, due to it’s reliability, scale and performance, and much less as a cache.