Live data from Hacker News

Atlas – Terraform but for Database Migrations

atlasgo.io

1–10 of 92 posts

Re: Atlas – Terraform but for Database Migrations

#2
The dream for any kind of tool like this is to only have to define your data structures once, and use the tool to "generate" related code rather than try to keep two different artifacts in sync (e.g. a GraphQL schema and this DDL).

How far along that path has this project progressed? I can't really tell from the main page.

Re: Atlas – Terraform but for Database Migrations

#3

The dream for any kind of tool like this is to only have to define your data structures once, and use the tool to "generate" related code rather than try to keep two different artifacts in sync (e.g. a GraphQL schema and this DDL). How far along that path has this project progressed? I can't really tell from the main page.

You might find something like Hasura interesting.

https://hasura.io/

It is a GraphQL server that sits on top of your Postgres DB and the schema reflects the table schema. It's quite powerful right out of the box.

If you combine that on the front-end with Apollo and a Typescript types code generator, you end up with strong typing all the way from your database to the front-end.

Re: Atlas – Terraform but for Database Migrations

#4

The dream for any kind of tool like this is to only have to define your data structures once, and use the tool to "generate" related code rather than try to keep two different artifacts in sync (e.g. a GraphQL schema and this DDL). How far along that path has this project progressed? I can't really tell from the main page.

You might find something like Hasura interesting. https://hasura.io/ It is a GraphQL server that sits on top of your Postgres DB and the schema reflects the table schema. It's quite powerful right out of the box. If you combine that on the front-end with Apollo and a Typescript types code generator, you end up with strong typing all the way from your database to the front-end.

I went with Prisma + Nexus + Pal.js + Apollo, which was probably at least two layers too complex.

I'm looking, still, for an all-in-one solution to this, though I do need more control over my queries/mutations than what Hasura would give me.

Re: Atlas – Terraform but for Database Migrations

#5
I'll never be comfortable with any tool for that automatically generates schema changes, as I'm just never sure at what point it decides to delete parts of my prod db.

All of my migrations are dumb DDL statements rolled up into a version. I know exactly what the final state is as it gets run and used when integration testing, staging etc.

It's boring but pretty bulletproof. I can rename a table and be confident it'll work, rather than some tool that might decide to drop and create a new table.

I can also continue to use SQL and not have to learn HCl for databases. This is useful when I want to control how updates are done, if I want index updates to be done concurrently Vs locking the table.

Re: Atlas – Terraform but for Database Migrations

#8
post #6

When documenting a migration tool, show an example of renaming a column before working on the logo.

This is always my only question when the salesperson is finished pitching some new provisioning or identity management tool.

“Can I rename users when they change their name?”

“Does that happen that often?”

“Half the staff here are female and may change their surname when they get married.”

“Err.. umm… I think that’s a work in progress.”

“It’s fundamentally impossible with your architecture and it’s the thing that we need most help automating.”

“Err…”

“Thank your for your presentation, we may or may not be in touch.”

Re: Atlas – Terraform but for Database Migrations

#9
Is it just me or I hate to learn new configuration languages that may disappear in no time after having invested time and effort learning them? Not just the syntax but all the nuances and the configuration options that come with it. If it was a migration tool using ANSI SQL as a configuration language I would have been happy to try it out. You can probably achieve the same declarative style by using SQL and running a diff between the expected state and the current state. So not sure why the custom language is needed
Post reply on HN