简体   繁体   English

将网上商店存储移动到NoSQL解决方案

[英]Moving webshop storage to NoSQL solution

If you had a webshop solution based on SQL Server relational DB what would be the reasons, if any, to move to NoSQL storage ? 如果你有一个基于SQL Server关系数据库的网上商店解决方案,那么迁移到NoSQL存储的原因是什么? Does it even make sense to migrate datastores that rely on relations heavily to NoSQL? 将依赖关系的数据存储迁移到NoSQL甚至是否有意义? If starting from scratch, would you choose NoSQL solution over relational one for a webshop project, which will, after a while, again end up with a bunch of tables like Articles, Classifications, TaxRates, Pricelists etc. and a magnitude of relations between them? 如果从头开始,你会选择NoSQL解决方案而不是关系网络项目,这会在一段时间之后再次出现一堆表格,如文章,分类,税率,价目表等,以及它们之间的关系。 ?

What's the support like in .NET (4.0) for MongoDB or MongoDB's support for .NET 4.0? .NET(4.0)对MongoDB或MongoDB对.NET 4.0的支持有什么支持? Can I count on rich code generation tools similar to EF wizard, L2SQL wizard etc. for MongoDB? 对于MongoDB,我可以依靠类似于EF向导,L2SQL向导等的丰富代码生成工具吗?

Because as what I have read so far, NoSQL's are mostly suited for document storage, simpler object models. 因为就我到目前为止所读到的,NoSQL主要适用于文档存储,更简单的对象模型。

Your answer to this question will help me make the right infrastructure design decisions. 您对此问题的回答将帮助我做出正确的基础架构设计决策。

UPDATE: If I was developing my solution around ASP.NET MVC and rely heavily on Model classes, would it be the easiest way to go to choose DB4o to simply serialize and deserialize my objects to and from datastore? 更新:如果我正在围绕ASP.NET MVC开发我的解决方案并且严重依赖于Model类,那么选择DB4o来简单地将对象序列化和反序列化到数据存储区和从数据存储区反序列化是否是最简单的方法?

Well quite a open-ended question. 这是一个非常开放的问题。

Migration to a NoSQL-datastore for an existing software 迁移到现有软件的NoSQL数据存储区

Well often there's a lot of experience and knowledge for the existing relational technologies. 通常,现有的关系技术有很多经验和知识。 When you're application runs fine, its probably not worth the effort. 当你的应用程序运行良好时,它可能不值得努力。 However when you have unsolvable issues with the current solution, then it's an option. 但是,如果当前解决方案存在无法解决的问题,那么它是一个选项。

Does it even make sense to migrate datastores that rely on relations heavily to NoSQL? 将依赖关系的数据存储迁移到NoSQL甚至是否有意义?

Well you have to consider that the three technologies (Document-DB, RDBMS, Object Database) are very different from each other. 那么你必须考虑到三种技术(Document-DB,RDBMS,Object Database)彼此非常不同。

  • In the relational world you normalize data and join them at runtime together. 在关系世界中,您将数据标准化并在运行时将它们连接在一起。 This works fine, as long as the data-sizes are not to big. 只要数据大小不大,这种方法就可以正常工作。 Here often the issues starts: When you have lot of normalized data you need to do a lot of joins, which costs a lot of performance. 这里经常出现问题:当你有大量标准化数据时,你需要做很多连接,这会花费很多性能。 And of course mapping between your objects and your tables can be quite tricky. 当然,对象和表之间的映射可能非常棘手。
  • In a object-database the each object is stored individually and the 'relations' are stored in forms of pointers. 在对象数据库中,每个对象被单独存储,并且“关系”以指针的形式存储。 So when a object A has a reference to object B, the object-database stores this reference. 因此,当对象A具有对对象B的引用时,对象数据库存储此引用。 So to retrieve the 'relation', no join operations are necessary. 因此,要检索“关系”,不需要连接操作。 Therefore 'relations' are cheap. 因此,“关系”很便宜。 In conclusion object-databases are really good at handling relations. 总之,对象数据库非常善于处理关系。
  • In a document-database like MongoDB a complete object-graph is stored as a document. 在像MongoDB这样的文档数据库中,完整的对象图存储为文档。 The document-database works with a the document-level. 文档数据库与文档级一起使用。 So here there are no real 'relations'. 所以这里没有真正的“关系”。 You normally just store/load documents. 您通常只是存储/加载文档。 So when you can model you scenarios so that most of your operations only work on a single document, it's very performant and easy. 因此,当您可以为场景建模以便大多数操作仅在单个文档上工作时,它非常高效且简单。

Here's a good blog-post which compares the design-difference of MongoDB (document database) and db4o (object-database) 这是一篇很好的博客文章 ,它比较了MongoDB(文档数据库)和db4o(对象数据库)的设计差异

In the end you model should fit to your database. 最后,您的模型应该适合您的数据库。 For example, don't try to use a model for a relation database and store it 1:1 in a document database. 例如,不要尝试将模型用于关系数据库,并将其以1:1的形式存储在文档数据库中。 See also Ayende's blog about modeling for a object-database . 另见Ayende的博客,关于对象数据库的建模

What's the support like in .NET (4.0) for MongoDB or MongoDB's support for .NET 4.0? .NET(4.0)对MongoDB或MongoDB对.NET 4.0的支持有什么支持?

Gates VP has already answered this for MongoDB . 盖茨副总裁已经为MongoDB做了回答 The .NET 4.0-version of db4o is in development. .NET 4.0版本的db4o正在开发中。 Meanwhile the 3.5 version also works fine on the 4.0 framework. 同时3.5版本也适用于4.0框架。

Can I count on rich code generation tools similar to EF wizard, L2SQL wizard etc. for MongoDB? 对于MongoDB,我可以依靠类似于EF向导,L2SQL向导等的丰富代码生成工具吗?

For both, MongoDB and db4o you don't need to generate code. 对于MongoDB和db4o,您不需要生成代码。 Your classes are the schema. 您的类是架构。 You just store you objects and the database takes care of the rest. 您只需存储对象,数据库将处理剩下的事情。 See also Gates VP answer 另见盖茨VP答案

Because as what I have read so far, NoSQL's are mostly suited for document storage, simpler object models. 因为就我到目前为止所读到的,NoSQL主要适用于文档存储,更简单的对象模型。

Well the range is quite big. 那么范围很大。 From really simple key-value-stores, to more advanced document-databases, colum-oriented-databases, graph-databases and object-databases. 从非常简单的键值存储,到更高级的文档数据库,面向colum的数据库,图形数据库和对象数据库。

Of course the document-database work excellent when you have store document-like data (for example a blog-software). 当然,当您拥有类似文档的数据(例如博客软件)时,文档数据库的工作非常出色。 While graph- and object-databases are good at handling extreme complex data structures. 而图形和对象数据库擅长处理极端复杂的数据结构。

OK, that's a lot of questions, let's see which ones I can really address. 好的,这是很多问题,让我们看看我能真正解决哪些问题。

Does it make sense to migrate existing relational datastores? 迁移现有的关系数据存储是否有意义?

Not unless you have a really big performance problem. 除非你有一个非常大的性能问题。 Here's the deal, "web-scale" performance problems are typically solved by denormalization. 这是交易,“网络规模”的性能问题通常通过非规范化来解决。 MongoDB is an inherently denormalized database. MongoDB是一个固有的非规范化数据库。

If starting from scratch, would you choose NoSQL solution over relational one for a webshop project... 如果从头开始,你会选择NoSQL解决方案而不是关系网络项目...

Yes. 是。 MongoDB is a very natural fit for typical web-based projects. MongoDB非常适合典型的基于Web的项目。 However, if you have lots of SQL experience, you'll probably find the reporting a little awkward. 但是,如果您有很多SQL经验,那么您可能会发现报告有点尴尬。

.NET 4.0 support? .NET 4.0支持? Can I count on rich code generation tools similar to EF wizard, L2SQL wizard etc. for MongoDB? 对于MongoDB,我可以依靠类似于EF向导,L2SQL向导等的丰富代码生成工具吗?

Mongo has a driver available for .NET. Mongo有一个可用于.NET的驱动程序。

There's no L2SQL or EF wizard for Mongo, but there really shouldn't be. Mongo没有L2SQL或EF向导,但真的不应该。 Honestly, what you'll probably miss most is Enterprise Manager for analyzing the DB. 老实说,你可能最想念的是用于分析数据库的企业管理器。

MongoDB doesn't really need an EF wizard. MongoDB并不真正需要EF向导。 EF is MS's solution for the "impedance mismatch" between DBs and objects. EF是MS针对DB和对象之间“阻抗不匹配”的解决方案。 MongoDB doesn't have the "impedance mismatch", just stuff the objects in the DB and go. MongoDB没有“阻抗不匹配”,只是填充数据库中的对象然后去。 Much of the same goes for L2SQL. L2SQL的情况大致相同。 People have built some Linq support (just a quick google), but things like joins won't work b/c Mongo doesn't do joins. 人们已经建立了一些Linq支持(只是一个快速的谷歌),但像连接这样的东西将无法工作b / c Mongo不会加入。

From a "data objects" standpoint, Mongo only needs a very lightweight framework. 从“数据对象”的角度来看,Mongo只需要一个非常轻量级的框架。 Honestly it's as simple as stuffing the properties into the DB. 老实说,这就像将属性填充到数据库中一样简单。 If you want to "add a column", you simply add the property to your object and it starts saving in the DB. 如果要“添加列”,只需将属性添加到对象中,它就会开始保存在数据库中。 So things like L2SQL start becoming really unecessary. 所以像L2SQL这样的东西开始变得非常不必要。

Don't get me wrong, there's room for a different querying paradigm, but in that regards you're in new territory. 不要误解我的意思,有不同的查询范式,但在这方面,你处于新的领域。 (you will be for all key-value and document-oriented stores). (您将成为所有键值和面向文档的商店)。

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

相关问题 有关将SQL Server数据移至NoSQL或ES / Solr的建议 - Suggestions on moving SQL Server data to NoSQL or ES/Solr 高性能大文本存储解决方案 - High performance large text storage solution 大量或非规范化记录的存储解决方案 - Storage solution for large number or denormalized records 在Silverlight应用程序中,哪种简单有效的数据存储解决方案? - What would be a good simple solution for data storage in a Silverlight application? WinForms应用程序设计 - 将文档从SQL Server移动到文件存储 - WinForms application design - moving documents from SQL Server to file storage 从派生表移动到临时表解决方案时,为什么性能会提高? - Why is performance increased when moving from a derived table to a temp table solution? 对于负载均衡的ASP.NET应用程序,文件存储的最佳解决方案是什么? - What's the best solution for file storage for a load-balanced ASP.NET app? 将 NoSQL 与 SQL 同步 - Sync NoSQL with SQL 使用Amazon EC2将SQL Server备份移至异地存储? - Moving SQL Server backups to off-site storage with Amazon EC2? 使用 ADF 为内部部署和数据湖存储 gen2 构建 Azure 云解决方案作为源 - Build Azure cloud solution for onpremise and datalake storage gen2 as source using ADF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM