title: How to cache JSON data instead of accessing the REST endpoint
body: <p><a href="http://api.bitcoincharts.com/v1/markets.json" rel="nofollow">http://api.bitcoincharts.com/v1/markets.json</a> (sample example)</p>
  
  <p>I am planning to access several REST endpoints as mentioned below for data and at certain times access to some of the endpoints fail because of a connectivity error or the service being non available. I am interested only in the last snapshot of the data. In order to resolve this issue I would like to store the latest snapshot in a data store (preferably NoSQL) say Mongo or Redis and would want to modify the application logic to look at these data sources always instead of the API endpoint. This would always provide predictable data and I intend to run some CRON scripts to pull data regularly from these REST endpoints and store it in the above data sources.</p>
  
  <pre><code>http://api.foo.com/v1/foo.json
  http://api.bar.com/v1/bar.json
  http://api.baz.com/v1/baz.json
  </code></pre>
  
  <ol>
  <li>Is there a better approach to resolve this issue?</li>
  <li>What storage would be appropriate for storing the JSON as it is and retrieve it for processing. Is it Mongo or Redis?</li>
  </ol>