简体   繁体   English

实体框架远程 SQL 服务器

[英]Entity Framework Remote SQL Server

I have 2 machines, one that have an SQL Server with all the data in it, and another one that has the client dashboard.我有 2 台机器,一台有 SQL 服务器,其中包含所有数据,另一台有客户端仪表板。

Both machines are not physically in the same location, so the Entity Framework queries are done over the internet.两台机器在物理上不在同一位置,因此实体框架查询是通过 Internet 完成的。

The client can log in the "Client Dashboard" and download large size data (say 500MB in 1 query).客户端可以登录“客户端仪表板”并下载大型数据(例如 500MB 在 1 个查询中)。

My question is, when the client downloads a 500 MB worth of rows (using Entity Framework C# to process this command), which machine out of these 2 will need to have better CPU/Memory power?我的问题是,当客户端下载 500 MB 的行时(使用实体框架 C# 来处理此命令),这 2 台机器中的哪台机器需要更好的 CPU/内存能力? The machine with the dashboard or the machine with the database?带有仪表板的机器还是带有数据库的机器?

I assume that, the machine with the SQL Server will need to have higher CPU/RAM that the one with just the client dashboard?我假设,带有 SQL 服务器的机器需要比只有客户端仪表板的机器具有更高的 CPU/RAM? or am I wrong?还是我错了?

which machine out of these 2 will need to have better CPU/Memory这 2 台机器中的哪台机器需要更好的 CPU/内存

Assuming the queries that are sent are simple, and don't require joins or sorting on SQL Server, SQL Server won't be heavily taxed.假设发送的查询很简单,并且不需要在 SQL 服务器上进行连接或排序,SQL 服务器不会被重税。

The one downloading the 500MB data set, loading it into managed entities and doing stuff with it will require several GB of memory and will use lots of CPU.下载 500MB 数据集,将其加载到托管实体并使用它进行操作将需要几 GB 的 memory 并且将使用大量 CPU。

SQL Server will fetch the data from disk and send it over the network without requiring lots of memory or CPU. SQL 服务器将从磁盘获取数据并通过网络发送,而不需要大量的 memory 或 CPU。

However, this然而,这

The client can log in the "Client Dashboard" and download large size data (say 500MB in 1 query).客户端可以登录“客户端仪表板”并下载大型数据(例如 500MB 在 1 个查询中)。

Is generally considered bad design, as downloading and manipulating large datasets on the client will typically be very slow in addition to requiring large of amounts of memory and CPU.通常被认为是糟糕的设计,因为除了需要大量的 memory 和 CPU 之外,在客户端上下载和操作大型数据集通常会非常慢。 You would normally design the "Client Dashboard" to retrieve only small subsets or aggregates of the data at a time.您通常会设计“客户端仪表板”来一次仅检索数据的小子集或聚合。

SQL Server will keep all your data in RAM if it has enough, and is built to provide very efficient query processing over large and complex data sets. SQL 如果有足够的数据,服务器会将您的所有数据保存在 RAM 中,并且旨在为大型和复杂的数据集提供非常有效的查询处理。 And it's operating over local data, not having to fetch it from across the network.而且它在本地数据上运行,而不必从网络上获取它。

And in that case the SQL Server might need to be bigger.在这种情况下,SQL 服务器可能需要更大。

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

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