Please tell me a newbie. There is a task when it is necessary to load, for example, a list of user posts, cache it into a local database and after some time request modified data indicating the date of the last synchronization. The question is how best to proceed in this case? to create a sync date field in the database for each post entry? the table? or store the date somewhere separate from the database?

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants of Streletz , aleksandr barakin , cheops , user207618, Bald 13 Sep '16 at 3:49 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Store it in the database. How - depends on the degree of granularity of synchronization. If in general - keep close to the data that is a unit of synchronization. For example, if you sync one post at a time, store it as part of a post entry. If you synchronize all the posts of the user at once, put them to the user or in a separate table that will refer to the user. If you synchronize all the posts at once, store them in a separate table (if there are many synchronized entities, you can create a general table for all).