Is it possible to do a basic CRUD in JSON file?

1

I have the following scenario.

I have a news site on ASP.NET MVC that currently accessing it, all the information gets caught in the bank. I want to take these requests from Front.

I thought about making a file Data.json and every time a news item was registered it would save in the bank and in the archive upon necessity.

Ex: Every time the site is open I go to the bank and look for the last 5 news about Politics and Sports, as I already know how many news items from each editor I need to present to FrontEnd, I would only create what is needed in the file. >

But since it is not a bank, when you need to "Disable" a news item for example, you would have to go to the archive, remove that news item and put another one to avoid breaking the FrontEnd scheme.

Is it feasible to do a CRUD to do these operations in the JSON file? Does anyone know a better scheme to get to this point?

    
asked by anonymous 10.10.2014 / 01:43

1 answer

1

Despite the computational cost, an option for this case could be to work directly on the serialization and deserialization of instances of classes that materialize JSON via methods. CRUD's work would be in class instances and not in files that could generate an unwanted flow of I / O. It could have a background task to ensure the serialization of the data stream into memory for physical file.

    
04.11.2014 / 18:50