Twig templates on volatile environment (EC2) Twig templates on volatile environment (EC2) codeigniter codeigniter

Twig templates on volatile environment (EC2)


From your description it seems you have two main requirements -

  1. Frequent read access
  2. Durable persistence

Like you said using filesystem storage is not scalable or reliable for your usecase.

I think you should consider using Elasticache backed by DynamoDB. Since you care about persistence Elasticache alone is not a feasible solution. DynamoDB will provide you durability that Elasitcache does not provide.DynamoDB reads have low read/write latencies so it may turn out to be pretty fast for your use case.

Dynamo DB can give you fast reads and writes. Here is a presentation on this topic that you might find helpful: http://dig.csail.mit.edu/2013/Talks/dig-seminar-0926-daniela.pdf

Your Dynamo DB schema will depend on how your data is structured, if you want to maintain a history of file edits etc. You can also just store a file in S3 which is cached using Elasticache but that may not give you enough flexibility. If you want to be able to write parts of file with S3 you will have to rewrite the entire file everytime a file is edited. But with Dynamo DB you can get the advantage of structuring your storage such that you can edit chunks of file on demand. Also with S3 you have to remember your reads will be eventually consistency. Dynamo DB supports both Strong and Eventual Consistency.