I do not see the value in knowing how it got to the database. For me I see only 2 cases. First where it does exist, and second where it doesn't. If you can say more than that might help for better ideas on how to do this.
How to sync data from (sports) API with local database
Hi Everybody
I am currently working on integrating with a football API to provide data about matches, venues, competitions etc. The API will provide data for my own database, which can also be populated by manually entered data.
I am struggling a bit with how to match data coming from the API with data in my own database?
I need to be able to check whether the entity coming from the database already exists in the database. In this case three scenarios exist.
- The entity doesn't exist
- The entity exist and have been manually created
- The entity exist and have been synced from the API
To be able to handle scenario 1 and 2 I need to have a way to lookup data - I guess I need to identify fields for each entity that could be used to identify them.
To handle scenario 3 I am thinking about creating an alias table to connect local ID's with API id's.
Anyone have any tips, ideas, experiences og ressources to share how to handle this?
Please or to participate in this conversation.