存储应用程序持久性数据,平面文件或数据库的首选方法是什么? [英] What is the preferred method for storing application persistent data, a flat file or a database?

查看:73
本文介绍了存储应用程序持久性数据,平面文件或数据库的首选方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为我的Python程序存储特定于应用程序的参数(持久数据)的首选方法是什么?

What is the preferred way to store application-specific parameters (persistent data) for my Python program?

我正在创建一个Python程序,该程序需要存储一些参数:"project_name","start_year","max_value",...

I'm creating a Python program, which needs to store some parameters: "project_name", "start_year", "max_value", ...

我不知道哪种方法是存储这些数据的最佳方法(在进行计算和报告时必须重用它们):使用本地TXT文件,使用非常小巧的数据库(在Python中存在吗?我使用SQLite吗?),...

I don't know which is the best way to store these data (I must reuse them when making calculations and reports): using local TXT files, using a tiny-very-simple DB (does it exist in Python? shall I use SQLite?), ...

非常感谢您.

推荐答案

如果方案是固定的,则sqldb是最佳选择,例如sqlite3,再加上作为缓存的memcached. 如果关系经常变化,我认为灵活的数据可能会存储在文件中(哈希索引).

if scheme is fixed, sqldb is best choise, like sqlite3, plus memcached as cache. if relationship change often, i think flexible data may be stored in files(hash indexed).

这篇关于存储应用程序持久性数据,平面文件或数据库的首选方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆