存储复杂信息的最有效方法? [英] Most efficient way to store complex information?

查看:78
本文介绍了存储复杂信息的最有效方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能会问这个问题是错的,请告诉我是否有更好的方法来制定这个问题。



背景:

我正在制作.net应用程序来处理销售促销东西的公司的产品信息。它们需要多种变体单一产品,多种价格基于客户,价格历史等等。我看到了XML的一些优点,但我没有像这样的复杂数据存储的经验。基本上有5'000个基本产品,有些有30个尺寸变体,然后每个尺寸有多种颜色变体,适用于普通客户的变体(印刷标识等),然后有至少5个价格,然后这些需求有一个价格历史。



我通过在SQL数据库中使用大量的表来制作一些杂乱无章的东西,但是50个产品测试,带有有限数量的变种,导致34个表创建,(根据需要制作表格)。



我是以错误的方式解决这个问题,认为是单一的数据库可以存储这么多数据吗?



简化数据结构

I might be asking this question wrong, please let me know if there's a better way of formulating this question.

background:
I am making .net application to handle the product information for a company selling promotional "stuff". They require many variants a single product, multiple prices based on customer, price history, and much much more. I see some advantages with XML for this, but I have no experience with "complex" data-storage like this. Essentially there are 5'000 base products, some have 30 size-variants, then there are multiple colour variants for each size, variants that are for regular customers (printed logos etc.), then there are minimum 5 prices, and then these needs to have a price history.

I made something that was messy and buggy, by using loads of tables in a SQL-database, but a 50 product test, with a limited number of variants, resulted in 34 tables created, (had it making tables as needed).

Am I going at this problem the wrong way, thinking that a single database could hold so much data?

Simplified data-structure

<products>
	<product name="Nice Shirt" prodno="12345">
		<prices>
			<retailprice val="299">
				<history>
					<price val="99" date="2014.09.01" /> 
				</history>
			</retailprice>
		</prices>
		<variants>
			<colours>
				<colour val="red" />
			</colours>
			<sizes>
				<size val="XL" pricemod="0" />
			</sizes>
		</variants>
	</product>
</products>



这只是一个用XML编写的简化数据结构,用于演示我的想法



底线

如何更好地存储这样的数据?我不期待一些成品,但我急需轻推,才能继续推进这个项目。



谢谢!



Frank


This is just a simplified data-structure, written in XML, to demonstrate my thinking

Bottom line
How is the better way of storing data like this? I don't expect some finished product, but I'm in dire need of a nudge, to get moving on this project.

thanks!

Frank

推荐答案

一般使用 json 而不是 xml ,因为它更简洁,更易于解析和使用: fastJSON [ ^ ]



如果要存储blob表示,那么请查看文档数据库引擎,而不是存储在SQL Server等的关系表中:

RaptorDB - 文档存储 [ ^ ]
Generally use json instead of xml, since it is more concise, easier to parse and work with : fastJSON[^]

If you are storing "blob" representations, then look at Document Database engines instead of storing in relational tables of SQL Server etc. :
RaptorDB - the Document Store[^]


所以这不是文件da tabase要求,它需要一个直接的关系数据库结构。



如果您正在创建表格,则表明您的设计存在根本性错误。我相信你可能需要34个或更多的表,但它们必须正确结构,一旦创建,除了添加STRUCTURE之外,表数不太可能会改变。



如果你正在努力定义一个数据结构,它是一个复杂的,然后进入一个专业人士,与他坐在一起,了解他为什么要整合数据结构。这应该允许您在开发过程中扩展结构。
So this is not a document database requirement, it requires a straight relational database structure.

If you are creating tables on the fly you are making a fundamental error in your design. I can believe you may need 34 or more tables but they must be structured correctly and once created it is unlikely the table count will change except to add STRUCTURE.

If you are struggling to define a data structure, and it is a complex on, then get in a professional, sit with him and understand why he is putting together the data structure. This should allow you to extend the structure as development progresses.


这篇关于存储复杂信息的最有效方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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