P
Prisma•6d ago
SpicyCoder

Run Prisma In 2 different Process's

Gm/Gn PrismaClient: prisma-py DB: sqlite:file im running a TelegramBot and it uses prisma db now i want to build an API that needs to reach the same db the bot is using (i can't run the API and BOT in same proccess) So is it okay to use 2 proccess's, 1 for the Bot, and 1 for the API Without getting data/prisma conflicts ? + if possible, do i have to specify any other setting in the prisma schema or just plugNuse thanks
4 Replies
Prisma AI Help
Prisma AI Help•6d ago
Salutations, traveler! I'm the Prisma AI Help Bot. You've reached a fork in the road: one path leads to the wisdom of the human sages (ETA: sometime today), and the other to my instantaneous insights. Which way shall we go?
Unknown User
Unknown User•5d ago
Message Not Public
Sign In & Join Server To View
Nurul
Nurul•4d ago
Hey 👋 There’s no need for additional configuration in your Prisma schema for this setup. Just ensure that both processes are using the same connection string (i.e. the same SQLite file path). SQLite handles multiple concurrent reads very well, but writes are serialized. If your workload is primarily read-heavy or has low concurrent writes, you should be fine. With concurrent writes, SQLite may lock the database, leading to potential “database is locked” errors if one process is writing while another tries to write at the same time.
SpicyCoder
SpicyCoderOP•4d ago
thanks, i guess the correct way to use prisma-sqlite/sqlite in many process's is to setup a local db API to sever multiple applications thanks for replying, will do that

Did you find this page helpful?