aws
aws copied to clipboard
[DynamoDB] Cache Adapter for Symfony
Hello!
While reading the documentation, I didn't see any mention of the possibility to use the DynamoDB client as a cache adapter for Symfony.
However, seeing there is already one for Laravel, i though it could be great to add one for Symfony too. Is it something you would consider?
Hello!
That is true. Should we add a PSR-6 compatible cache with DynamoDB? Sure, if you find it useful.
But is DynamoDB a good cache provider? Ie compared to Redis.
But is DynamoDB a good cache provider? Ie compared to Redis.
tbh, idk, maybe i'm looking in the wrong direction, but here some context regarding my request:
I'm currently testing things with Symfony + Bref on AWS Lambda and i would like to setup some persistent cache. As I'm fairly new to AWS and serverless in general maybe DynamoDB is the wrong choice.
However, I could use this package but it require the whole AWS PHP SDK which seems a bit overkill for just using one service.
Im running Symfony + Bref on AWS. The very best solution is to set up ElasticCache (Redis) and use symfony/cache' redis adapter.
You will need the extra php extension. I use a redis cluster any my DSN (used with Symfony) looks like this:
REDIS_CACHE_DSN='redis:?host[acme.zersin.clustercfg.euc1.cache.amazonaws.com]&lazy=true&redis_cluster=1'
Thank you for your reply, i'll look into it.
How did it work out for you?
I updated the mentioned package to use async-aws instead of the full AWS SDK.
But is DynamoDB a good cache provider? Ie compared to Redis.
@Nyholm I think it's a good solution. Depending on how you design your keys it's going to be pretty effing quick, (maybe as fast as Redis, i don't know?), and IMO it's the more 'serverless' way of doing things as you don't need to care about node sizes or paying for over-provisioned capacity at times that you have less traffic.
I'm closing this issue as this is implemented in https://github.com/RikudouSage/DynamoDbCachePsr6