哪个数据库更适合MVC [英] which database is better for MVC

查看:63
本文介绍了哪个数据库更适合MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



哪个数据库更适合MVC,mysql或ms sql server 12?我使用Mysql它与Asp.net webforms工作正常,但现在对于MVC哪一个更好?我搜索它,但答案不让我决定哪一个更好?

Hello,

Which database is better for MVC, mysql or ms sql server 12? I worked with Mysql it is work fine with Asp.net webforms but now for MVC which one is better? I search on it but answers not make me to decide which one better?

推荐答案

严格来说,数据库引擎的选择与MVC或任何其他无关ASP.NET上的框架。它足以与ADO.NET一起运行。此选择应考虑您未与我们分享的应用程序的要求。但请不要回答这个问题。这真的是你需要自己做的工作。



-SA
Strictly speaking, the choice of the database engine has nothing to do with MVC or any other framework on top of ASP.NET. It's enough that it worked well with ADO.NET. This choice should take into account the requirements of your application, which you did not share with us. But please don't do it in response to this answer. This is really the job you need to do by yourself.

—SA


已经指出有关数据库产品与您在前端使用的技术分开的问题。但是,基于你在其他答案上发表的评论我会考虑一些事情:



  • 数据库应该有一个快速存储引擎和一个
  • 它还应该能够在数据总量增长时对数据进行分区
  • 连接数据库的客户端库应该足够成熟,包括单行和批量操作
  • 数据库引擎应该具有良好的管理功能和实用程序
  • 并且很可能在某些时候需要一些支持以便可以使用
As already pointed out the question about the database product is separate from the technology you use in the front end. However, based on the comments you have posted on other answers I would consider few things:

  • the database should have a fast storing engine and a good optimizer
  • it also should be capable of partitioning data when the overall amount of data grows
  • the client side library connecting the database should be mature enough to include both single row and bulk operations
  • the database engine should have good administration capabilities and utilities
  • and most likely you'd need some support at some point of time so that should be available


最好不要将这两个组件视为不可分割的。更重要的是,设计模式,如存储库 [ ^ ]添加一个额外的层,以将业务逻辑与数据访问分开。当您需要选择时,这是一个很好的方法。当然,正如SA所提到的,如果你想使用.NET,那么数据存储的成熟ADO.NET驱动程序是必须的。如果你有Linq和EF驱动程序,那就比它更好 - 在某些情况下你将只有这些。

此时忘记表和关系模型一秒钟。

根据您的评论,您正在收集传感器数据。你没有谈到的是频率:每秒,每分钟或每小时读取一个巨大的差异。这是连续阅读7/24/365还是只是短时间?你能负担批量插入吗?如果没有,数据存储可以在性能方面处理连续的粒状插入。最后:您的数据库将增长多少(还要考虑您的索引,事务日志等)?如何随着时间的推移正确处理这个大小?

你必须考虑你的分析,你需要发出什么样的查询。

我认为你想要的时间序列数据库。不幸的是,很少有适用于Windows的专用TsDB,更不用说方便的驱动程序。

你也可以考虑使用NoSQL。其中许多实现都是企业级解决方案,即使是免费的广泛功能集也是如此。如果你为每个设备收集100个参数,并且频率不是太高,例如MongoDB或RavenDB可能是一个不错的选择。

当然,你也可以使用MySQL。在这种情况下,SQL Server更好,因为您可以选择较少的资源密集型存储引擎。但你也可以考虑像SQLite这样的低调引擎。低占地面积,高性能。如果您需要在应用程序中执行分析逻辑,这是一个不错的选择。
It is better not to think about these two components as inseparable. Even more, design patterns such as repository[^] add an extra layer, to separate business logic from data access. This is a good approach when you need to choose. Of course, as SA mentioned, if you want to use .NET a properly mature ADO.NET driver for that data store is a must. If you have Linq and EF driver, than it is even better - in some cases you will have only these.
And at this point forget tables and the relational model for a second.
Based on your comment you are collecting sensor data. What you haven't spoken about is the frequency: one reading per second, per minute or per hour make a huge difference. Is this continuous reading 7/24/365 or just for a short period? Can you afford batch inserts? If not, can the data store handle the continuous granular inserts in terms of performance. And finally: how big your database will grow (think also about your indexes, transaction logs, and so on)? How can you properly handle that size over time?
And you have to think about your analysis too, what kind of queries you need to issue.
As I see you want a time series database. Unfortunately, there are few dedicated TsDBs for Windows, even less with handy drivers.
You can also take NoSQL in consideration. Many of these implementations are enterprise grade solutions, even with extensive feature sets for free. If you collect 100 parameters per device, and the frequency is not too high, MongoDB or RavenDB for example can be a good choice.
Of course, you can use MySQL too. It is better in such a situation that SQL Server, as you have less resource intensive storage engines to choose from. But you can also think about low profile engines like SQLite. Low footprint, high performance. If you need to do the analysis logic in your application anyway, this is a good choice.


这篇关于哪个数据库更适合MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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