[Opinions] is serverless viable? Vercel Postgres
Unanswered
Tomistoma posted this in #help-forum
TomistomaOP
I'm looking to build a solution that enables real-time synchronization of data between a Google Sheet and a specified database (e.g., MySQL, PostgreSQL). The solution should detect changes in the Google Sheet and update the database accordingly, and vice versa.
Is it possible to handle all these requirements in a serverless architecture?
Is it possible to handle all these requirements in a serverless architecture?
26 Replies
u probably need to read the google sheets api for doing something when a document changes
for example triggering a request to a edge function that updates the db
uhm
TomistomaOP
yup i need to use app script
vice versa
idk
TomistomaOP
but i need it to sync the other way too
yeah thats the issue
Im doubtful if this can be achieved serverless-ly
uhm a funny thing u could do is
setup a cronjob in your serverless platform if it supports it
and doing your logic there
looking for changes in the db for example
TomistomaOP
im using vercel
TomistomaOP
at that point would you just shift to a service like supabase which comes with all the features 😂
check this
TomistomaOP
Since the database is not accessible externally, I could just sync data every time a crud request is made. I'll also have polling implemented for principle's sake
and how are u suppose to sync from google drive?
TomistomaOP
i meant to say I wont allow direct external access from google sheets (can i even do this with vercel postgres?) since it goes through an API or middleware i wont have to worry about someone making changes to the db externally
im not understanding what u mean arent u suppose to call a "sync" endpoint? for example google sheets calls your sync endpoint, your endpoint retreaves your data from sheets on the serverside and updates the db
and vice versa. Vercel calls your sync endpoint for postgre, u get the data from postgre and update your sheets
TomistomaOP
ok that makes sense. I hit the sync endpoint everytime either nodes make a change and then proceed with my crud operations on the db