design patterns - model management in MVC -


i'm searching best practice making model in mvc.
i'm making socket server concurrent users.
understand, model in mvc has included business logic if model data access or maybe db sao.

how can model object updated when else has changed attribute in db ?

the first solution can think of attribute of model accessing database.
second 1 make model pool , modify reference.

any suggestion??

if have 1 server , 1 process, cache model (static variables or similiar) , have 1 model in memory mirrors database. scale bad (or better won't scale @ all). depending on how latency tolerate, have several servers , processes have own caches, updating database in regular intervals. of course mean data corruption. way if 1 server changes entity informs other servers via sockets invalidate entity in caches. midway servers cache in memory, every time object requested, timestamp (or version) pulled database decide wether cache date.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -