Frank Poo wrote:
I'm building something akin to Google Analytics and currently I'm doing
real time database updates. However this isn't really scaling anymore,
so I need to stop doing synchronous DB operations. In the short term,
I'm trying to reduce DB writes, so I'm thinking about a global hash (say
declared in environment.rb) that is accessible from my controllers and
models that I can write to in lieu of writing to the DB. [...]
1) Does this sound reasonable?
No! Databases should scale as much as you need them to -- that's what
they are designed for. If your DB is not scaling, there is something
wrong, either in your DB setup or in the way the app is using the DB.
Find the problem and fix it rather than ripping out the DB.