Live data from Hacker News

Ask HN: How do you version your data?

news.ycombinator.com

11–20 of 58 posts

Re: Ask HN: How do you version your data?

#11
post #6

Our migrations have unique datetime stamps. Stamps and migration names go into a table. We do have a hash of all of the contents of the table, but the schema "version" is just the list of migrations that have been run. We run many different instances of our applications on several different "versions" and from time to time pull individual migrations back into earlier releases for hotfixes etc. The overall version is…

So, the versioning of the data is basically by the backup date (plus pointers to the relevant schema, etc.), correct?

Re: Ask HN: How do you version your data?

#12
ALL migrations insert major.minor.patch to the database. Migrations are committed to the database, and can be run anytime; they each have check code at the beginning to compare against what's in the database before executing the payload. Migrations won't execute if the version is semantically less or too far ahead from what's in the database.

It's worked reasonably well so far.

Re: Ask HN: How do you version your data?

#14

I suggest you look into schema migration tools. What I have done in the past is to prefer lazy migrations (migrate once you access an old record), rather than migrating everything in batch. Also a good idea to archive data that hasn't been used, moving it outside your primary database.

I am pretty familiar with several, such as Alembic, South, Django Migrations, etc.

I'm not just interested in versioning schema changes, but data changes as well.

Re: Ask HN: How do you version your data?

#17
Have seen two ways of doing in large organizations 1. Use tools like Optim (i think ibm) 2. Export CSV data, and export schema and drop it to Hadoop data store

Option 2 is preferred for very long time restore say after 15 years as there may not be a way to restore to Oracle/MS Products which may not have run time ecosystem after 15 years.

Re: Ask HN: How do you version your data?

#20
On a somewhat related note, I have an API that returns time series data. The API itself is versioned but not the data when it is added to since the endpoint is the same. How would I go about notifying consumers of the API that the data has been updated and they should call the API to get the latest data? Would versioning the data help with this?
Post reply on HN