Using moto DynamoDB for production in-memory caching #6984
-
I would have posted this as a discussion if it were available, so apologies upfront if this is not the right space to ask my question. I am trying to implement an in-memory caching solution that operates very similarly to DynamoDB. I have a DynamoDB global table that I need to protect with a caching solution, and because of various reason, DAX is not an option. My thoughts were to use moto's DynamoDB module to effectively act as this in-memory cache, similar to how you can do the same with sqlite. Is this a really bad idea? Moto appears to have all the bells and whistles I need, and it works amazing for our unit tests. Just wanted some feedback if this was a red flag usage of moto, or it sounds ok. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We have discussions now! Been meaning to enable it for this repo for ages, so this was a good reason to finally get it done.
I would have two concerns with that approach: responsibility and performance. Responsibility: because you're essentially outsourcing the responsibility for a core component. Performance: because Moto is not made with performance in mind. It works for unit tests, but the volume/requests-per-second in production are presumably much higher. I understand that the DynamoDB parsing logic can be valuable though. If you extract that into it's own module/repo/project, with a separate release-cycle from Moto, then I don't see a problem with it. It gives you full control over the component, both in terms of new changes and in terms of any performance improvements that are required. |
Beta Was this translation helpful? Give feedback.
We have discussions now! Been meaning to enable it for this repo for ages, so this was a good reason to finally get it done.
I would have two concerns with that approach: responsibility and performance.
Responsibility: because you're essentially outsourcing the responsibility for a core component.
Moto may work perfectly today, but it may break things tomorrow/in a next release. Obviously we try to not do that, but if it happens, and you're using Moto in producti…