数据库设计中的会计年度处理策略 [英] Fiscal year handling strategies in database design

查看:108
本文介绍了数据库设计中的会计年度处理策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按财政年度,我指的是在特定年度发生的数据库(在所有表中)的所有数据。让我们说,我们正在建立一个允许用户从不同年份中选择的应用程序。

By fiscal year I mean all the data in the database (in all tables) that occurred in the particular year. Lets say that we are building an application that allows user to choose from different years.

你喜欢什么方法实现这个,为什么:

What way of implementing this would you prefer, and why:


  1. 基于多个单独的数据库实例分隔会计年度数据(例如,在每个会计年度开始时,您可以创建一个没有数据的新实例)

  2. 在一个数据库中存储所有数据,但具有自动将记录与不同年份分隔开的逻辑。

看到两种方法,我会选择第二种。我可以想到的第一种方法的唯一的参数是有较少的记录,如果这些是真正的大数据库 - 但仍然,你可以归档旧的记录通过连接在摘要或其他方式。

Personally, I have "seen" both methods, and I would choose the second. The only argument I can think of for the first method is to have less records in case that these are really big databases - but still, you could "archive" old records by joining them in summaries or by some other way. What do you think?

推荐答案


基于多个单独的数据库实例分隔会计年度数据,在每个会计年度开始,您可以创建一个没有数据的新实例)

Separate fiscal year data based on multiple separate database instances (for example, on every fiscal year start you could create a new instance with no data)

否。

除了不进行规范化之外,您还可以不必要地复制支持的数据库实例,数据库或表。基础设施:约束,触发器,存储过程&函数 必须更新以使用新的当前会计年度。

Besides not being normalized, you would be unnecessarily duplicating the supporting infrastructure: constraints, triggers, stored procedures & functions would all have to be updated to work with the new, current fiscal year. Which would also complicate data for future years for budgetting and planning.


在一个数据库中拥有所有内容,但具有自动将记录与不同的记录分开的逻辑年。

Have everything in one database, but with logic that automatically separates records from different years.

不需要分离,只需确保记录包含时间戳,然后可以用于确定什么会计年度它发生在。

There's no need for separation, just make sure that records contain a timestamp, which can then be used to determine what fiscal year it took place in.

这篇关于数据库设计中的会计年度处理策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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