Ask HK: How do you design a sql table schema when you expect it to change?
I would normally use nosql or postgresql and put them in a jsonb. However, in this scenario I am stuck with mysql 5.5-5.6 without ORMs
I would normally use nosql or postgresql and put them in a jsonb. However, in this scenario I am stuck with mysql 5.5-5.6 without ORMs
A great example of this for me was with payments where it may be paypal, amazon payments or cc via another vendor. In this way, I don't need a bunch of custom fields that I'll never query on, just a generic additional field. In this way, I'll often write an abstraction class against my ORM to handle this, and then have properties that get/set against the underlying JSON data/object field.
This is what you've done here... that said, any specific features of a single platform will mean pain in migration. If you must support multiple backends, then you should create an abstraction and a factory as appropriate. As much as I hated MS Enterprise Library's Data Application Blocks, supporting multiple backends was a problem it did help resolve.
As nibs mentions, you should probably use an ORM that takes care of most of the differences between backends.
TBH though, depending on the type of data you're using, I might start with a simple record store nosql server (rethinkdb, for example), and only migrate if/when needed.
2. Would be write really strong tests and migrate the test server database before you push update to production
I am by no means an expert, but doing these things helped me successfully address database model iterations.
Using a load balancer will be a complementary with #2