I have a service that will listen to a stream via a websocket and compute some temporary information (say, number of busses currently on the network). This number would change every few seconds.

I don't want to store this information indefinitely, I just need other services to access the most recent version of this information (number of busses currently on the public transport) at any point.

What type of storage would you recommend for this short term non presistent type of information.

I've been thinking about simply storing a json file to S3 and then overriding it when information changes. The other option was using DynamoDB.

I'm wondering what would be the simplest and most cost effective option for this?

  • 3
    Does this temporary file even need to be shared among instances? – Michael Hampton Jan 29 '19 at 14:05
  • 1
    Redis (via ElastiCache) sounds appropriate here. – ceejayoz Jan 29 '19 at 14:14
  • yes this information needs to be shared – tadoman Jan 29 '19 at 14:25
  • I'd go with Redis too. It changes too frequently for S3 to work well. – Michael Hampton Jan 29 '19 at 14:44
  • how about dynamodb? would it be too expensive to write so often? – tadoman Jan 29 '19 at 15:16

If in case you're not specifically looking for AWS service. I will suggest you go with MongoDB Atlas. With this service, you can setup TTLs on your collections. Changing the data often won't be an issue and you can use a free cluster i.e. M0 which looking at your needs would be more than enough. This also obliviates from you all the dependency as to from which service you are writing and accessing the data. Latencies are low and at any point in time you can always take a backup and use point in time restore to go back to any point.

Other than this if you want to use AWS service specifically I will suggest you go with DynamoDB that is, in my opinion, one of the best services for your use case.

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.