Persist Editor Content in DB using Next.js and tRPC #6191
Unanswered
NiclasDev63
asked this question in
Questions & Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Does anyone have recommendations for effectively saving editor content with debounce (i.e. every few seconds when the user stopped typing)? Currently, I'm sending the entire editor content—which typically ranges from 500KB to 4MB—via tRPC to my Next.js backend, where it is then stored directly in a PostgreSQL database.
However, sending large JSON payloads through Next.js is generally discouraged, as it can risk self-inflicted DDoS attacks and extensive use of resources. An alternative solution might involve storing the editor content in separate blob storage, such as Amazon S3, and only storing the link to this content in the database. But this approach also appears inefficient and potentially error-prone if executed on every save.
Is there a more optimal approach for handling large editor content saves in a production environment?
Beta Was this translation helpful? Give feedback.
All reactions