Should this information be calculated in real time or stored in a seperate database? -



Should this information be calculated in real time or stored in a seperate database? -

i working on grouping project , having give-and-take whether calculate info want existing database , store in new database query later, or calculate info existing database every time need utilize it. wondering pros , cons may either implementation. there advice give?

edit: here more elaborate explanation. have big database has lot of info beingness submitted daily. building scheme track points of data. example, getting count of how many times user entered in database. using illustration (are actual thought bit more complex), discussing methods of getting count of actions per users. first method create database stores users , action count, , query database every time need action count. sec method query big database , count actions per user every time need utilize it. hope explanation helps explain. thoughts?

edit 2: 2 more things may useful point out 1: have read access big database , 2: ultimate goal display info on web page end users.

this generic question optimization caching. next reply same question. though question provided bunch of different details, none of them specific plenty merit non-generic reply either:

the more want calculate @ query time, more want views, calculated columns , stored or user routines. more want calculate @ normalized base of operations update time, more want cascades , triggers. more want calculate @ other (scheduled or advertisement hoc) time, more utilize snapshots aka materialized views , updated denormalized bases. can combine these. time database accessed can enabled , restricted stored routines or other api.

until can show in adequate, views , calculated columns simplest.

the whole thought of dbms store representation of application state database (which normalization reduces redundancy of) , query , allow dbms implement , optimize calculation of answer. haven't presented reason not doing in straightforward way possible.

[sic]

always create sure application reading own personal ("external") database view of "the" ("conceptual") database when alter implemention of former (plus rest of combined interfact) latter (plus rest of compbined mechanisms) applications not have alter ("logical independence"). here applications users' , trackers'.

ultimately must instrument , guestimate. when worth start caching. preferably much possible in terms of high-level notions views , snapshots , little possible in non-dbms code. 1 of benefits of relational model is easy describe strightforward relational interface in terms of straightforward relational interface. protect applications alter offering interface hides secrets of implementation or of family of interfaces current one.

database database-design database-schema

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -