简体   繁体   English

具有版本的动态数据存储-ASP.NET

[英]Dynamic data storage with version - asp.net

My requirements are as follows, 我的要求如下

The User will upload excel file contains metadata tables with data.Excel file can have multiple sheets and each sheet corresponds to a table. 用户将上载包含数据的元数据表的excel文件.Excel文件可以有多个工作表,每个工作表对应一个表。 These are dynamic contents and using the sheet name we have to check such a table already exists or new table. 这些是动态内容,使用表名我们必须检查这样的表是否已经存在或是否有新表。 These table information need to be stored in the server and displayed later. 这些表信息需要存储在服务器中,并在以后显示。

Storage consists of two stages such as common/Personal. 存储包括两个阶段,例如普通/个人。 Common stage, all tables are common for all users and In personal each user will be having their own set of tables. 在公用阶段,所有表对于所有用户都是公用的,个人而言,每个用户将拥有自己的一组表。

The common stage requires version control for tables, such as whenever there is a modification; 公用阶段需要对表进行版本控制,例如每当有修改时; such as edit table/new table, user having provision to overwrite to existing version, or create new version. 例如编辑表/新表,用户准备覆盖现有版本或创建新版本。

My question is: how can we store these data in the server? 我的问题是: 我们如何将这些数据存储在服务器中?

Constraints are: Different versions in Common stage can have same table names and different users can have same table in Personal stage. 约束是:在Common阶段,不同版本可以具有相同的表名,而在Personal阶段,不同的用户可以具有相同的表。

Is it OK to proceed with SQL schema or should I can go for XML to store the data and structure/ Any other thoughts? 可以继续进行SQL模式吗?还是应该可以使用XML存储数据和结构?还有其他想法吗?

As the schema of the worksheets are likely to change, you're better off looking at a NoSQL database (also known as Document Database) such as CouchDB , MongoDB or RavenDB (there are others). 由于工作表的架构可能会更改,因此最好查看NoSQL数据库(也称为文档数据库),例如CouchDBMongoDBRavenDB (还有其他数据库)。 Document Databases do not have a schema, like relational databases (SqlServer, Oracle, MySQL, etc) so they store any data of any shape. 文档数据库没有关系数据库(SqlServer,Oracle,MySQL等)之类的架构,因此它们存储任何形状的数据。

You will need to write some code that opens the Excel sheet. 您将需要编写一些代码来打开Excel工作表。 Check to see if the data is XLS (old Excel), XLSX (new Excel) or CSV (common format), because that will change which library you use to open them. 检查数据是否为XLS(旧Excel),XLSX(新Excel)或CSV(通用格式),因为这将更改您用来打开它们的库。 Once you have the worksheet in memory, you should be able to save it straight the document database, making it common or personal as necessary. 一旦将工作表存储在内存中,您就应该能够直接将其保存在文档数据库中,并在必要时使其变得通用或个性化。

I would avoid XML files because it is likely that you will need to search across the data or at least perform some sort of a lookup. 我会避免使用XML文件,因为您可能需要在数据中进行搜索或至少执行某种查找。 This would be difficult with XML files and you might end up writing a database that does the same as a document DB! 对于XML文件,这将是困难的,并且您可能最终编写了与文档DB相同的数据库!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM