"State" management for asp.net mvc multi partial view + ajax app -


i trying convert asp.net mvc4 app, had heavy use of sessionstate, stateless app. understand can store information in db, , intend so.

my question, though, particular architecture. app has main 'page' consisting of number of partial view panels, each have actions in them can affect other panels. i've been doing storing entire state of viewmodel (lots of inter-related ef list collections , 'record' objects) in session, , been working great. except when session randomly dies.

so, need data out of session, , db can rebuild thing @ need. concern that, if store info in database, every single action done on screen might affect 3-5 different panels, each own state updates, thats minimum of 10 round trips db every interaction!

what strategies can use make idea more scalable?

extra info

the view in question here sort of pos shopping cart system. there panels selecting events, selecting/adding items cart, editing cart items, selecting contacts, editing contacts, displaying cart items, displaying cart 'subtotals', , finally, panel [checkout] button.

selecting new event change list of available items. selecting item add cart change cart item list, subtotals, checkout panel. same editing cart item.

the main concern how recover lost session, i've found built-in asp.net session code unreliable. testers have encountered issues sessions timing out, , app not having kind of recovery process. when installed on 1500 sites, each average of 10 users, going plague of lost session issues, , need combat before becomes real problem.

i agree i'm not going stateless...wrong choice of words used in rush. i'm trying move state form can rely on past session failure. main idea presently continue using session local cache viewmodel data, have fallback operation can rebuild viewmodel db if session 1 lost somehow.

you shouldn't using database store (what sounds like) data needs persisted in short term.

if these changes other partials relevant in context of current "master view," suggest using jquery ajax send off requests, parse response json , update other views. tutorials on jquery ajax , asp.net mvc easy find, if don't have knowledge:

http://www.codeproject.com/articles/41828/jquery-ajax-with-asp-net-mvc

this way, don't need make bunch of round trips. if changes need persisted beyond context of current view, make 1 round trip database perform update , update of other partials in-memory response ajax call.

you don't need read secondary storage multiple times when have of information need in-memory. reading , writing once.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -