Multi instance model portability

Chris Merrick · Friday Demos · April 4, 2025 · 4:51

A new admin console for moving data models between environments - best for multi-region deployments or dev-prod workflows.

Try it yourselfThe full week on docsadministrationmodeling

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. Um, all right. I was been working on something that I've been thinking about for a while. Um, so let's say I have one organization. I'm just getting it set up. Uh, and I have uh a second organization could be in a different region. Could be sort of like dev QA, you know, any of these things. Uh, but importantly definitely could be in a different region.

  2. Um, so what if I want to keep these things in sync? So we now have a way to do that. So let's say in this model, you know, I've created a topic, right? And I set up the same connection over here and I haven't set I haven't done anything. I just ran the schema sync. So this model has a few things in it.

  3. This one does not. Uh, I'm going to open up this new sync page. I'm going to create a new sync target. That target is going to be called my other org. Uh, the URL to that or I'm going to create an API key for this. So, let's go over here. So, I'm going to create an API key in the target org.

  4. uh sync key. Copy that. Paste it. Okay. So I now have a sync target. Now I need to create a model mapping. So I'm going to select my target. I'm going to select the only model I have. And now I need to select a target model ID. So I'm going to select the model that I schema synced u but does not have any topics or anything else in it.

  5. I'm going to paste the model ID in here. create a mapping. Uh, and then I'm going to press sync and cross my fingers. Cool. Sync complete. Pop back over here. Hey, my topic showed up. Cool. Um, proof of concept. Do any model stuff that you can imagine, but uh I need to sort of layer in branching and a lot of other fun stuff here uh to kind of make this fully comprehensive.

  6. And then of course uh it would be useful for this to be able to do the same thing to content as well. So uh I think that's a natural extension here. Uh Colin, you are muted. Thank you for recognizing that. Uh is this act is this pushing from one to the other? So one is a recipient of like a core model and what happens if you start touching the other one?

  7. And I assume it overwrites next time you hit the sync. Yeah, it's doing a full write of the model extension. So the shared layer. Yep. Okay. And like use cases for this Chris. Did maybe you said this is like multi- region things I assume or like dev to prod type setups of going to do development in one environment but I need to go push it to my four regions.

  8. Yep. And yeah, I think we need to think a little bit about um you know, right now this is sort of you know, I did the simplest thing. It's like per model you hit sync. Would be trivial to add a button to sync all uh but we probably you know, we're think about how it interplays with git and PRs and branches.

  9. Um, and uh, you know, it feels like there would be a nice workflow here to create a branch in the in the source and sort of then sync all the stuff from that branch into both your local and the the targets. So there there's a lot of opportunity here, but I just laid a little bit of uh, PC groundwork.

  10. I think this to me I I sort of view this as the start of the like enterprise like multiorg control plane. Yeah, that's cool. I'm curious um what h how you're move are you just reading the JSON from the database or are you how are you actually transferring the info? Uh I am using all existing stuff. I only had to kind of hack through one little thing here that I'll come talk to you about.

  11. Um, but yeah, it's basically it's getting the model extension JSON, like the raw JSON from the database, uh, and then pushing that over to the patch model/model ID route uh, in the target, which I you I wrapped a remix API over. Okay, cool. Yeah, we should sync. Yeah. Yeah, I'll I'll shoot you the PR to take a peek at.

  12. We can talk a little bit about the details. Uh, definitely little ways away from uh, being in production here. Just uh starting the conversation.