<@U0RQY0KK5> Is there a way to scale out prisma to...
# orm-help
m
@nilan Is there a way to scale out prisma to multiple instances in ECS? We used the standard prisma template and then added a second instance for redundancy and things crashed hard. But we really need a fallback because Prisma crashes all the time and there’s no redundancy with only one instance. It looks like the issue is with
Obtaining exclusive agent lock...
The second prisma instance can’t get the lock because there are 2 instances active and it crashes. Are there any plans to make prisma work with horizontal scaling? I understand that there are issues with using the cli-based
prisma deploy
model because it will only deploy to one server, but you could adopt a master/slave model where one server handles the management API and the other one just serves requests. That’s pretty much what Kubernetes does. Also, you could allow us to use prisma without the prisma CLI by just building a docker image with all our data models already included and then handling migrations separately through a CLI (likely in a one-off container/dyno) similar to
heroku run rake db:migrate
or
docker exec -t rake db:migrate
. That’s a probably easier for the prisma team to implement and it’s a little more devops work for your users, but anyone who wants to scale horizontally in the first place probably won’t mind the extra work.
👍 2
d
Prisma is stateless and horizontally scalable. Although, as you mentioned, deploy has to be done on each instance manually but Prisma generally, can be deployed on multiple instances. The error you refer to would require more investigation, can you please create an issue with all the details here:- https://github.com/prismagraphql/prisma/issues/new?template=bug_report.md
m
@divyendu You’re wrong. Prisma is not horizontally scalable. There is an EXPLICIT check in the code saying near where Prisma logs
Obtaining exclusive agent lock...
that does exactly that. It obtains an exclusive lock on the DB and only one Prisma instance can have that lock. The second Prisma server will refuse to start if there’s already one running. That’s how Prisma’s code works today. I’d appreciate a serious response from someone on the Prisma team rather than you telling me something that’s just not true.
d
Can you please create an issue with or without a reproduction? Once it is there, we will be able to address it better because we will have version number and more information about your exact setup 🙂 I will get back to you on the exact nature of this lock and ways to deploy Prisma horizontally. We use autoscaling internally already! 🙂
cc @Mike
m
@divyendu Here it is: https://github.com/prismagraphql/prisma/issues/2850 Please take a look and see if that’s correct. Thank you
👍 1
d
Looks good! Thanks! Let us persist further discussion on the issue itself 👍
m
@divyendu I haven’t gotten any response on the issue yet. Are you taking a look at it?
d
Not right now.. have notified the team, we will get back on it.. 🙂
t
@divyendu how can prisma be deployed on multiple instances? can you elucidate or point us to resources?
d
Sure! I will notify you on that once I have some information in consumable format 👍
https://github.com/prismagraphql/prisma/issues/2850#issuecomment-409868271 Please persist further queries on the github issue itself as it is easy for slack message to get lost 🙂👍 cc @Teri @Mike