I’m building an AppSheet app where users press a “Start Task” button to assign themselves the task and set the status to “In Progress”. This works fine, until User A and User B both see the task as “available” (because one or both are offline or haven’t synced yet). They both press “Start”, and then after syncing we end up with two different people assigned or confusing status conflicts.
Sync is particularly slow… often 5-10 minutes…
How do you typically solve this problem? Should I force a “sync before” the action? Validate the assignment server-side with a bot? Or maybe cancel the second assignment if the task has already started? I’d love to hear any best practices or real-world examples you’ve used to avoid these collisions !
All you can do is minimize the impact of this problem. A force Sync may help eliminate some occurrences but you cannot completely eliminate them as long as there is potential for multiple users to update the same record at the same time.
The best solution is to avoid it altogether. If there is some way to change the employee process so that they don’t ever attempt to assign the same task, that would be simplest.
If you MUST leave it as is, then maybe a 2-step assignment process could be applied. First, apply “Requesting” and then “Assigned”. This might give time for a proper Sync to allow that the item was already assigned to someone else. I came up with this idea some time ago but have not needed it yet. So, I’m not certain of how well it might work.
However, Sync times of 5-10 minutes is an issue. You really should spend time getting that time down or otherwise users will just get aggravated - especially if you were to use a 2-step assignment. Sync times should never be more than 1 minute, IMHO, and I believe even the largest apps it can be well under 30 seconds.
Hey** @WillowMobileSys **, thanks for your response! Your two-step assignment idea with a forced sync is really interesting—I’ll give it some thought.
That said, sync speed is a serious concern for me. I’m building a workflow management app for a team of 10 people with ~30 tables linked together. The app relies heavily on actions and nested actions to handle things like cascading job creation, task dependencies, and status updates across tables.
I’ve applied AppSheet’s optimization tips (read-only static tables, performance monitoring, etc.), but sync times remain painfully slow. I use AppSheet’s native database and was hoping that once deployed, performance would improve, but it hasn’t.
Could upgrading from Core to a higher-tier plan help? Are there better ways to speed up workflows with complex dependencies?
I’m getting worried, as I’ve been developing for 3+ months, and I need to move into production soon. Any advice would be greatly appreciated!
While AppSheet can handle all of this functionality, it doesn’t always do so well. You may very well have to deviate from the more-common AppSheet design patterns to accomplish these goals. For instance, have you considered using the API to perform bulk table operations? Or could you use asynchronous bots?
I use AppSheet’s native database and was hoping that once deployed, performance would improve, but it hasn’t.
You’ll have to move to an SQL database to get better performance, which means upgrading your licenses.