Trying to implement an API extraction that dumps the results from JSON apis daily in a postgres db. The goal for these data is to be used in analysis. Afterwards I will handle those using dbt to do the modeling part (extracting the JSON values).
Example JSON values from an object representing a task on a task management system:
{
gid: 1234, // Unique id for the resource
updated_at: "Wed, 22 Mar 2023 08:53:46 GMT",
... rest of the attributes
}
My current strategy is storing those in tables with this schema
gid | info::jsonb | updated_at::timestamp |
---|---|---|
12345 | {...} | Wed, 22 Mar 2023 08:53:46 GMT |
If the extraction is to happen once a day every day, does the strategy of surrogate key of (gid, updated_at) sound ok to judge if the insert should happen or not ?