Ash FrameworkAF
Ash Frameworkโ€ข7mo agoโ€ข
7 replies
giusdp

Short-lived Tokens in Ets-backed Resource

I was wondering if it makes sense to store short-lived tokens in an ets-backed resource. The tokens are created -> read -> deleted in usually < 2 minutes and they should have ttl of 5 minutes. I could just do everything in postgres but perhaps it makes sense to do it in a cache in memory. Initially I thought of using ets and use it directly through changes/preparations (with the set_result thing) or just use a normal phoeinx controller and deal with those endpoints myself. Then I remembered about the ETS data layer but the notice of not recommended in production kinda scared me.

So I have like these 4 directions to take (ets-backed resource, phoenix controller using ets, ets via changes/preparations on a postgres-backed resource, just postgres) and not sure which I should do. So just seeking some advice ๐Ÿ˜…
Was this page helpful?