I'm currently designing a set of webservices related to travel industry. one of this service need to be take in input a airport code and a locale, and return the localized city name.fn(cityCode) => localizedCityNamefn(airportCode) => cityCode, localizedCityName, localizedAirportNameI have currently in the mongodb a collection of cities which contains, among other stuff, for each city, localized infos, and airports list :{cityCode:'lon',  localized:{            'en':{name:'london'},            'fr':{name:'londres'}            }, airports:[{code:'GTW', name:'Gatwick'}]  }I'm wondering what would be the best performant and scalable since :The pivotal format is json (so moving data from solution to another is easy)There are about 200 cities, but each city can contain a significant amount of data not related to our use)The data we need is rarely or never changing (gatwick airport will always be in london ...)There is need to localize a few cities at a time (20 to 100).the api is only on one server (with redis installed) but we hope to get one day to the point where clustering would be required.I was considering :Leave the data in MongoDB, and query as needed, and use index to optimise.Pros : data consistency, unique source for the queries.Cons : not performantRe-arrange my json, and store it to many files, by rearrange i mean having a assoc json array with cityCode as the key , and airportCode for the other filespros: Uber fastercons: no consistency, not scalable ??Re-arrange my json and store to a redis same as before except it's on a redis cache pros: Same as before except more scalable maybecons: need to read and parse the json (i couldn't really see anything else)NOw the questions :Do you have some other strategies to recommend ?Which one should i go for and why ?
Best strategy for storing static data : json file vs DB (mongo) vs redis
json;storage;redis
The most performant solution is in-memory, after that.. YMMV. For example, reading the data from file can be slower than reading from the DB. I wouldn't like to say which is better, so you'll have to test it. However, if redis is caching the file, then this will be faster (effectively in-memory!) so I'd go for that, but automated consistency is something worth having. So, I would generate the files from the data held in the DB. If you do this at startup (or reload of the application), you can ignore the file completely and apart from a delay between updating in the DB and writing to file (which I assume you'd schedule for a known release time) you're good to go. Obviously you could add a method to your administrative system to force a rewrite which might be even better.