Ash*_*ani 3 c# sql-server nosql
我正在开发一个网站(如果成功的话)它将拥有一个快速增长的数据库(可能是太字节或更多).到目前为止我一直使用sql server并且对nosql一无所知.我刚刚发现nosql正在研究数据库大小,现在我不确定它是否能满足我的需求.我将拥有与sql-server相同的功能吗?
我的问题可能看起来很傻,因为我是nosql中的新手,但我只是想知道它是否不支持sql查询.我们怎么能这样做:
select *, (select name from cities where id = cityid) from users
Run Code Online (Sandbox Code Playgroud)
如何加入表格?使用类似存储过程,视图或类似的东西?
小智 6
Thats a big question. NoSQL is a broad term pretty much used to describe a bunch of non relational data stores. They can range from MongoDB, RavenDB (which are document stores) to things like Redis and other variants of key/value stores. They all operate very differently to SQL relational models (and the resulting T-SQL).
Document databases like Mongo or Raven typically have a C# driver that (in most cases) allows you to use LinQ queries across the datastore (Mongo example here on this thread and a RavenDB example on their documentation page). They are all specific to their engine and different.
All these engines are not specifically designed to address the 'space' issue you are describing but rather try and have a low friction way of interacting with a datastore, in a fast way. All these data stores will still grow in size in the same way SQL does when throwing massive amounts of data at it. SQL Server will handle massive databases, as will most of the document stores and other NoSQL variants. To be honest, I'd trust SQL Server more than the newer NoSQL stores simply because it has been field tested for longer however as already stated, these document stores (and other stores like Apache Cassandra) can all handle large volumes of data. My only suggestion is to look at how you want to query the data. Document stores typically dont have the concepts of relational integrity like foriegn keys and so normalisation rules do not apply. In addition, you need to assess your reporting needs as SQL typically has an advantage in this area with more tooling. You can also choose a hybrid approach using SQL for your relational data and document stores for other object blobs and the like.
我建议先研究一下如何访问您的数据,然后评估哪一个最适合您的需求.有一点需要注意的是,SQL有一些很棒的功能,但通常只在企业版本中.这花费了很多.文档数据库的许可费用往往较低,有些是免费的,许多公司提供托管服务,因此无需担心这一点.最后,如果使用SQL,我会建议从一开始就研究分片方法,因为这将使您处理的数据量更多,这将使其更易于管理,并且还可以提高查询性能.
| 归档时间: |
|
| 查看次数: |
1703 次 |
| 最近记录: |