I am attempting to learn rails, and in doing so am planning on making a little app/website where people can look up nhl stats. I am assuming the best way to do this is to have the stats stored in a database.
From the examples and tutorials I have looked at, it seems databases are always being updated from users interacting with the site. Ie. a twitter-like site where users submit posts that are stored in the database.
For the stats site however, the database would be updated once per day, from "outside" the app and then used essentially as a look-up table.
What is the best practice for updating a stats database like this? Is it ok to update a database externally?
Hopefully these questions makes sense.
1 thought on “database usage question”
I don’t think you’d want to update the database externally, by which I interpret as ‘push to my db from another site’.
You’d want to schedule a process/task to pull the information you need, from whichever sites you’re getting the stats from.
Here is a quick example I found on StackOverflow: https://stackoverflow.com/questions/40994581/rails-5-scheduler-to-update-database-once-a-day
Hope this helps!