2

我从我的同事(<-spelling)那里继承了一些编程职责,我得到了一个这样的用户表:

userID BigInt (1,1)
Username Nvarchar(100)
UserPass Nvarchar(100)
Profile  Nvarchar(max)

他们已经为用户名/密码编写了所有逻辑,客户回过头来告诉他们“我们现在需要用户配置文件”。由于客户端已经控制了数据库,我们不允许修改现有的存储对象,但是,它们确实为我们提供了新的 Profile 字段。

我想知道的是:什么对性能更好......?任何地方都有基准吗?

A)Storing profile data as XML
B)Storing profile data as JSON
C)Storing profile data as a comma-delimited list
D)Other that I have not thought of...maybe store a XML file in the filesystem tied to the userID?

对于上述任何一项,我将输入并分解为对象。我个人会说 JSON,我可以使用 JSON.Net 库

ps 这将在 Win2k8 R2 服务器上的 .Net 4 和 SQL 2008 R2 中(这是他们个人的,并且非常强大)

4

1 回答 1

2

我认为在这种情况下 XML 和 Json 都是可以接受的,因为您被迫以这种方式存储配置文件。

我过去曾为此使用 XML,主要是为了在查找相关配置文件属性时的结构和可读性。

如果您担心它的大小(我想它会非常小),请将 xml 存储在压缩状态。

于 2012-11-30T13:39:10.547 回答