New answers tagged

0

I can see #3 introducing some potentially nasty race conditions, and even #1 could suffer from a race condition if the schema update happens right after another instance has connected to the database. If you borrow a technique from Active Record migrations and designate a table to keep track of the schema version, not only can you safely lock on that table, ...


3

Only option three Carefully wrapping each non-idempotent statement in checks. has any appeal for me. This option is the only one that doesn't require the script to depend on anything else (hardware, software or otherwise) for its proper function.


1

A good rule is to avoid having objects that are in a illegal state. Therefore creating objects based on data from the database that is illegal (or indeed has become illegal because you have changed the rules) without anyone knowing about it would be bad. It would of course also be bad if noone were able to start your system because one record somewhere ...


0

If data is coming out of your database, then you can [usually] assume that it's correct. It wil have gone through a lot of checking to make it through in the first place, so re-checking it on the way out again is [usually] overkill. Note the peppering of 'usually's in the above. Not all of the data that gets into your database does so through ...


1

When you only needed to deal with Transactions, then a single Transactions table was sufficient. Now you need to know about summarisations at the Account level. Yes, you could calculate these dynamically, but this will get progressively slower the more Transactions you have to trawl through. This isn't a User Experience decision. How often will a User ...


6

It depends on what you're willing to do in terms of architectural/performance payoffs. It sounds like at the core you're doing a kind of Event Sourcing, which actually makes a lot of sense when you start talking about domains where it's important to have audit-trails for exactly what happened. I think a key-point for avoiding "code rot" is to make sure that ...



Top 50 recent answers are included