Hello! I have successfully configured a developmen...
# prisma-data-platform
s
Hello! I have successfully configured a development and production environment using Prisma Data Platform, PlanetScale for the DB, and Vercel for deployment. I wanted to recreate this setup for an article and video tutorial so others can do the same, but my production data and development data are linked via PlanetScale's connection string for each respective branch (i.e development branch in PlanetScale links to the development environment in Prisma Data Platform and same for production). While attempting to recreate my initial successful set-up, the development and production environments share the same data (i,e I create a new user in development, and that new user is also created in production). This is obviously not the intended behaviour and while the setup is nearly identical, the main difference I've seen in my tutorial project is the listed development environment has a Data Proxy with AWS and a Database with MySQL and the same is for production. Now, with my successfully set up project, the development environment has a Data Proxy with AWS and a Database with MySQL and the production environment has a Data Proxy with AWS and a Database with PlanetScale MySQL. Now the reason for this is during the creation of the tutorial project, it tried to automatically provision a PlanetScale DB, but I couldn't as it thought I was using my other PlanetScale account (I wasn't even signed into that one so maybe there's a cache issue?) and I hit my limit of 1 database. So I just chose the Use my own database option and provide the PlanetScale connection string. So despite providing a connection string for each respective PlanetScale branch, my current theory is that the connection string is the same for each environment, which is why each environment is bleeding data to each other. I'll provide photos for more context, but if there are any Prisma Developer advocates who want to look further into this, feel free to DM and I'll be more than happy to discuss or even show it via a Zoom call.
👀 1
a
Hello Stefan, I will start off by saying I am not intimately familiar with PS so take anything I say with a grain of salt. AFAIK PS branches are meant to be used to evolve the schema but they are not isolated databases that are meant to be used to long term as such. I think the PS workflow is expected to be: 1. starting off main “production” schema branch, create a new branch for feature X 2. make changes to the schema in branch X 3. preview schema changes in branch X 4. merge branch X into main branch, applying the schema changes to production I think when the branch is created, it’s initially empty or it used to be initially empty and perhaps now they copy data from main. If you delete data from development, does it disappear as well in prod? If it happens, I would suspect both environments are pointing to the same branch instead of different ones. If this is just the side effect of data from production making it once into development when the branch is created, you could try purging it once after that.
BTW, I work on the product team at Prisma. Besides creating this tutorial, are you using Prisma professionally? If so, I’d love to setup a call if you have some time.
@Stefan Trivuncic Sorry about the delayed response, BTW.
s
Hello @Alberto Perdomo 👋 ! No worries and thank you for your response - much appreciated as I know my question was longwinded 😅 Your explanation of PS is spot on and you are correct, if I create or delete data from development, it also appears/disappears in production. The part that I am confused about is I've done this exact same set-up with a different project I'm working on (outside of the tutorial), but my development and production data do not affect each other. I've gone through different settings and the only difference I see, as stated above with the attached photos, is the project that is currently working as intended is the production environment's DB set to PlanetScale and the development environment's DB set to MySQL (also pointing to PlanetScale, but when I created the development branch, I created a new connection string and passed it in the settings under
Connection String
. I did the same for this test project for the tutorial, but the difference is both the production and development environment's DB's are only showing MySQL and not PlanetScale, despite both getting fed a connection string via PlanetScale. While I am not using Prisma professionally (trying to convince the use of Prisma at my current workplace), I am using it to build my startup while also wanting to create tutorial videos of Prisma Data Platform, Prisma Client, and other features surrounding Prisma. Either way, I am more than happy to have a call in regards to this but I also understand if it only pertains to if I was using Prisma professionally.