Lookup Tables Best Practices: DB Tables… or Enumerations

后端 未结 9 1845
忘掉有多难
忘掉有多难 2020-12-07 09:27

If we have to store the available positions at a company (i.e. Manager, Team Lead, ... etc). What are the best practices for storing it? I have two opinions with comments...

9条回答
  •  一个人的身影
    2020-12-07 09:56

    Is the only thing you are planning on putting into a db this list of employers?

    If yes, drop it in a file, and be done with it.

    DBs are great, but if you need a simple key-value, they are overkill. They give you a lot of stuff. But they also do a lot of stuff behind the scenes, they are one more thing you need to support... if you can get away with a single file with 20 tab-delimited lines, go with simplicity.

    If you have a lot of things that require these kinds of lookups, or if you think you might need to update them while a client is trying to read them, or if you might want to cross-reference things later on -- then go for the DB.

提交回复
热议问题