I want to save a lengthy form's inputs at the server. But I don't think making db calls on each auto-save action is the best approach to go for.
What would constitute as a good approach to solve this?
Another problem is that I have 3 app servers. So in memory cache wouldn't work.
I was thinking keeping the data in redis and updating it on every call and finally updating the db. But since I have 3 servers how do I make sure the calls are in queue?
Can anyone help with the architecture?
AutoSave is a new feature available in Excel, Word, and PowerPoint for Microsoft 365 subscribers that saves your file automatically, every few seconds, as you work. AutoSave is enabled by default in Microsoft 365 when a file is stored on OneDrive, OneDrive for Business, or SharePoint Online.
Figma is a vector-based design tool that is gaining popularity in the design community. One of the features that sets Figma apart from other design tools is its auto-save feature. Figma automatically saves your work as you go, so you never have to worry about losing your progress.
verb (used without object), au·to·saved, au·to·sav·ing. to be automatically saved: Most video games autosave after each new level.
Figma saves your work by adding checkpoints to the file's version history. Figma records a new checkpoint after 30 minutes of inactivity in the file.
But I don't think making db calls on each auto-save action is the best approach to go for.
That's the real question, let's start with that. Why would you think that? You want auto-save, right? This is the only thing that saves user work.
All the other options you listed (memcached/redis, in-process caching) - not only do they not save user work, they're ticking time bombs. Think of all things that can fail there: redis dies, network is split, the whole data center is hit by lightning.
Why create all the complexity when you can just... save? You may find out that it's not that slow (if this was your concern).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With