Database design for database-agnostic applications

后端 未结 17 1774
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 14:15

What do I have to consider in database design for a new application which should be able to support the most common relational database systems (SQL Server, MyS

17条回答
  •  暖寄归人
    2021-02-02 14:36

    As well as taking into account the many good and sensible answers here, I'd also add that something like ActiveRecord migrations (from Ruby On Rails, but you can just use the library) might be useful. It abstracts stuff like table creation/alteration, appropriate column types, simpler index management and (to a certain amount) sequencing into a fairly simple descriptive language.

    Stored procedures and triggers are pretty much ignored, but if you're going cross-platform that kind of functionality should probably be in a code layer anyway.

    Out of curiosity I've switched between Oracle, MS SQL, MySQL and SQLite with the same set of migrations and the worst problem I had was discovering I had to ensure my column and table names were not in the union of reserved word lists across the DBs.

提交回复
热议问题