Databases versus plain text

后端 未结 14 1713
我在风中等你
我在风中等你 2020-12-04 22:01

When dealing with small projects, what do you feel is the break even point for storing data in simple text files, hash tables, etc., versus using a real database? For small

14条回答
  •  余生分开走
    2020-12-04 22:48

    First, I'd consider:

    1. How large will the database initially be: # of tables, # of rows
    2. How quickly will it grow?
    3. Is the data frequently queried?

    If I were to create a personal recipe app, for example, I know I might add 50 favorite recipes to start and add no more than 5 recipes a year. With that being said, I could easily get by without a database since the size of the data store will have minimal impact on queries.

    That said, I would probably use a database for any application where data entry and queries occur (even a small personal recipe app). I don't think it adds a lot of overhead especially when your framework (e.g. Rails) allows you to keep your database dumb (primarily tables, indexes, and constraints). It alleviates the chance that I'll have to eventually port to a database if I decide to scale up.

提交回复
热议问题