✅ Saving api json data to db
So I'm not sure how to go about in saving data from a website that provides json data. Like what is the standard way ?
8 Replies
Depends where you want to store it?
This differs from use case to use case
So do we just typically write this data into a db/table? And that's it?
I'm not sure how we go about tracking what's changed if that makes sense..
imo, you would have an anti-corruption layer in your code to parse the json data into model(s) that your app can understand.
then when you save / pull the data, you can check what got changed, maybe put your own version tracking logic
You want to version your data or something?
If so, a separate history table would be one choice, a single table with additional
version
column or some such would be anotherIf you use Azure storage you can enable changes tracking
I believe it is available for the LTP (or smth like that) storage type
You could use JsonConvert to deserialize it into an object and save that to your database.
You can map the data from your deserialized model to your database entity
Thank you all!! All great suggestions! Love this discorf!!!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.