c# - ORM for stateful application. Does EF fit? Or any? -


i need orm suitable stateful application. i'm going keep entities between requests in low-latency realtime game server persistent client connections. there 1 server instance connected database no data can changed "outside" , server can rely on cache.

when user remotely logs in server whole profile loaded server memory. several higher-level services created each user operate profile data , provide functionality. can have internal fields (state) store temporary data. when user wants change signature asks corresponding service so. service tracks how user changes signature , allows once per ten minutes (for example) - such short interval not tracked in db, temporary state. change should stored db executing 1 query: update users set signature = ... user_id = .... when user logs off it's unloaded server memory after minutes/hours of inactivity. db here storage. call stateful.

  1. some entities considered "static data" , loaded once @ application start. can referenced other "dynamic" entities. loading "dynamic" entity should not require reloading referenced "static data" entity.
  2. update/insert/delete should set/insert/delete changed properties/entities "detached" entity.
  3. write operations should not each time load data database (perform select) preliminary detect changes. (a state can tracked in dynamically generated inheritor.) have state locally, there no sense load anything. i want continue tracking changes outside of connection scope , "upload" changes when want.
  4. while performing operations references of persisted objects should not changed.
  5. dbconnection-per-user not going work. expected online thousands of users.
  6. entities "static data" can assigned "dynamic" enitity properties (which represent foreign keys) , update should handle correctly.

now i'm using nhibernate despite it's designed stateless applications. supports reattaching session looks uncommon usage, requires me use undocumented behavior , doesn't solve everything.

i'm not sure entity framework - can use way? or can suggest orm?

if server recreate (or reload) user objects each time user hits button eat cpu fast. cpu scales vertically expensively have small effect. contrary if out of ram can go , buy more - horizontal scaling easier code. if think approach should used here i'm ready discuss it.

yes, can use ef kind of application. please keep in mind, on heavy load have db errors time time. , typically, it's faster recover after errors, when application track changes, not ef. way, can use way nhibernate too.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -