gpt4 book ai didi

c# - sql存储过程与代码,对于大量数据,哪个更好?

转载 作者:搜寻专家 更新时间:2023-10-30 19:55:57 25 4
gpt4 key购买 nike

<分区>

我正在用 MVC 创建一个 Web 应用程序的架构,Web 应用程序将为电子商务类的东西维护数据。两种方法之间会出现一些混淆,

1.

Should I keep all code of calculation/Data access in class file(Model) which will be using EDM for accessing DATA. This accessed data thru EDM will be refined by code available in MODEL file and access by controller. In this approach I will have to create only few models, rest models will be created by EDM and can be bound directly to Views.

Should I keep all code of calculation/Data access in Stored procedure which will be using SQL queries for accessing DATA. This accessed data thru SQL queries in stored procedure will be used directly by code available in MODEL file and access by controller. In this approach I will have to create many models as i will have to set parameters of STORED procedure.

问题来了,

  • 哪种方法最适合客户,第一种还是第二种?为什么?

  • 这两种方法之间会有任何性能差异吗?怎么样?

  • 哪种方法实现起来更快?

  • 哪种方法更安全?

提前谢谢你。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com