We solved this differently. We needed to maintain a two DB solution (two-state solution as some of my team has called it). For this, we took advantage of RethinkDB's changefeeds to deal with the foreign key constraints. We have some Elixir supervisors that link to it's direct dependencies. So e.g. a Comment can't exist without a Post, so the Comment changefeeds don't start until the Posts insert changefeed caught up with at least upserting the IDs. We then have a followup task that makes sure the data is also up to date. This has allowed us to keep our FKs, while allowing functionality to be moved over as we needed it to. As new_app became the writer, changefeed was removed, and the process continued. If one dies for whatever reason, it kills the dependent changefeed listener processess and the VM restarts the process at that point.