using ajax on website, make changes data through view. send data server it's saved. steps outlined below:
- user changes data on view.
- javascript triggers.
- before ajax call
- ajax call. server saves data.
- after ajax call
my question is: better, design-wise, update view in step 3 , update data , let data potentially out of sync until refresh or make ajax call, return data server , update view in step five?
i have first option implemented since little easier , "flowed" me better, second 1 seems better, since user up-to-date data server.
this availability vs consistency. depends on whether want more available or consistent. happens if goes wrong , information couldn't updated in server side, users angry? or maybe users angry if cannot see right value of content? have decide 1 or another. article situation consistency vs. availability: eventual consistency werner vogels
Comments
Post a Comment