You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Issue: Currently messages.worker.ts writes every single stroke/message to the database one by one. In a busy room, this will overwhelm Prisma/PostgreSQL.
Improvement: Message Batching.
Modify the worker to collect messages in a small buffer (e.g., for 500ms or until 50 messages) and use prisma.chatSchema.createMany() to save them in one go. Result: Drastically reduces the number of database connections and write operations.
Current Issue: Currently messages.worker.ts writes every single stroke/message to the database one by one. In a busy room, this will overwhelm Prisma/PostgreSQL.
Improvement: Message Batching.
Result: Drastically reduces the number of database connections and write operations.