请帮助有关临时表 [英] Please help about Temporary Tables

查看:58
本文介绍了请帮助有关临时表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,请帮我解决这个问题.我有一个使用ASP.NET MVC3和实体框架的项目.我的问题是客户的购物车.当客户登录后,他们在他/她的购物车中添加了一些商品.我要存储它们,直到他们订购或取消它.那么我应该为每个客户的购物车使用临时表还是其他?
请帮助我:D.非常感谢.

Hey guys, plz help me about this. I have a project using ASP.NET MVC3 and Entity Framework. My problem is customer''s cart. When a customer login and they add some goods in his/her cart. I want to store them until they order it or cancel it. So should i use Temporary Table for each customer''s cart or anything?.
Plz help me:D. Thank you very much.

推荐答案

以下是选择选项时还应考虑的一些标准:

1.持续性要求?您是否要保留购物车的信息以进行多次登录?
2.预期负载是多少?在任何给定时间点将存储多少用户和购物车?

以下是我的建议:
1.修改会话以使用Sql来存储会话并将购物车保留在会话中.
2.使用ASPNet会话状态服务将会话修改为out proc,并将购物车数据保留在会话中.
3.设计sql表架构以将购物车存储在数据库中而不是temp db中,我不建议将其存储在tempdb中,因为它会增加DBA活动,例如要求您增加tempdb的大小,并且清理temp table对您来说很棘手一旦您失去会议.这是最棘手的实现,需要大量编码.

根据条件1和2的答复选择选项1或2.

-Rohit
Following are some criteria to also consider while choosing the option:

1. Persistence requirement? Do you want to persist the information of cart for multiple log-ins?
2. What is expected load? how many users and cart would be storing at any given point of time?

Following are my suggestions:
1. Modify session to use Sql to store session and keep cart in session.
2. Modify session to out proc with ASPNet Session state service and keep cart data in session.
3. Design sql table schema to store the cart in database not the temp db, I would not suggest to store in tempdb as it would increase DBA activity like require you to increase the tempdb size and, cleanup of temp table would be tricky for you once you loose the session. This is the most tricky implementation and requires lot of coding.

Choose either option 1 or 2 based on the reply of criteria 1 & 2.

-Rohit


这篇关于请帮助有关临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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