If I use Payload CMS, I get a admin interface, GraphQL and REST APIs for free, migrations handled, etc.
Can I still use Drizzle or Mongoose directly to update data, or do I need to exclusively use Payload's tooling for changes? I think this is the case but wanted to be sure.
Absolutely you can! Drizzle and Mongoose is fully exposed by payload - you can find it inside of
payload.db
thanks, looking forward to playing with payload!
Would it be faster using payload.db to update or create data ?
payload.db is faster, but it lacks support for lots of things like access control and hooks. It's basically a direct database call with very little payload other than where queries and pagination
Okay makes sense. It’s exactly what I was looking for
I had another question, if I run payload in a nodejs cluster is there anything I need to keep in mind or best practices?
Did you end up trying this? If so how did you configure it?
It’s quite simple. You can use payload.db anywhere you need with the local api.
I’ll try and find you an example when I get back
Oh wait, are you referencing the cluster setup? I did set it up
I used pm2 to create a cluster, I’ve also implemented on railway using their cluster implementation (replicas)
So I actually had a huge performance boost just spawning multiple workers in
server.ts
I saw a 3-4x increase overall without using PM2!
Ooh nice
@778799229988110337, I’ve done that as well. I use them for intensive cronjobs. What are you using for workers to do ?
Just serving lots of web requests!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.