3 ms·
Ask HN: Is there a db migration tool with a similar philosophy as K8s
I'm not an k8s expert by any means but one of the philosophies (if I understand correctly) of that tool is that you declare your desired final state and then let k8s figure out how to get it there.
Is there a similar type of tool for db migrations? I've used a variety of migration tools like the one in Rails but I'm wondering if there is a similar one that uses the declarative idea.
- verdverm 5y agoI'm most of the way to one, if you mean declarative and the system figures out what needs to be changed. hof/dm https://docs.hofstadter.io/first-example/adding-a-datamodel/ https://docs.hofstadter.io/first-example/adding-a-datamodel/ Join our slack if you'd like to know more
- xrd 5y agoYour description fits what I was thinking about exactly. Is there a quick-start or example of the db migration? At first glance this left me feeling worried I would have to learn a new language (CUE?) and a bunch of new concepts. That's fair if that's what is necessary, but if I could leverage my existing knowledge of sql and other db migration tools that would make me feel less stressed.
- verdverm 5y agoThe hard part is detecting what has changed in the user's declarative desired state. What are they writing their desired state description in? At least it's not HCL?! We're building CUE powered dev tools, so our users and descriptions start with CUE, but we also keep you close to the underlying tech / lang. There are a number of options for declarative, but I haven't found any that handle the change detection and subsequent migration diff needed. They all seem to be whole schema. This is why I'm working on something for this problem, but also our declarative data models are for more than DBs, and they are composable and sharable.