DEV Community

Discussion on: Is writing to JSON an acceptable cache

Collapse
adam_cyclones profile image
Adam Crockett Author • Edited on

I could say it's complex or simple or intermediate, that doesn't matter, nor does what language or platform in all honesty. Perhaps I'm asking about JSON to disk vs redis or equivalent. What are the implications around perf and security. Assuming the file will be stored on a web server.

Collapse
tchaffee profile image
Todd Chaffee

There isn't enough information to make a decision. I don't know how big the file is, how many users will access it, what the security requirements are, etc. Do the simplest thing you can based on your specific requirements. When it doesn't work anymore due to increased traffic or some other new requirement, you cross that bridge when you get there. Premature optimization is just going to make things harder for you to debug and maintain: en.wikipedia.org/wiki/Program_opti...

Thread Thread
adam_cyclones profile image
Adam Crockett Author • Edited on

Your question does answer my question though.. I trickled my question and requirements because people take a lot for granted and read the requirements as they want. If I give you less information gradually, you have actually helped, think of it like counciling for developers.

How big are the files? this was unlimited until you mentioned it.

Do I need to cache at all? Yes probably, I need to get around the rate limit of 10 per minute