vendredi 13 mars 2020

What is design pattern to store JSON objects in C++?

A co-worker and I have been discussed the best way to store data in memory within our C++ server. Basically, we need to store all requisitions made by clients. Those requisitions come as JSONs objects, so each requisition may have different number of parameters. Later, clients can ask the server for a list of those requisitions.

The total number of requisitions is small (order of 10^3). Clients ask for the list of requisitions using pagination.

So my question is what is the standard way of doing that?

1) Create a class that stores every JSON and then, when requested, send the list of those JSONs.

2) Deserialize the JSON, store it in a class then serialize the data again when requested.

If 2, what is the best way of doing that in modern C++?

3) Another option?

Thank you.

Aucun commentaire:

Enregistrer un commentaire