为什么是一个坏主意,使用会话存储在高流量网站的状态呢? [英] Why is it a bad idea to use Session to store state in high traffic websites?

查看:155
本文介绍了为什么是一个坏主意,使用会话存储在高流量网站的状态呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看ASP.NET学习上的视频asp.net/learn。在本教程中,他们正在建设一个测验引擎。在一个点上,解说员解释说,我们要使用Session对象,以保持每个页面之间的状态(每个页面都包含一个问题和四个答案)。他说:因为这是一个低流量的网站它是好的使用会话,他没有实现更复杂的方法的时间。

I am watching the ASP.NET learn videos on asp.net/learn. In this tutorial, they are building a quiz engine. At one point, the narrator explains that we are going to use the Session object to maintain the state between each page (each page contains a question and four answers). He says that "since this is a low traffic website" it is okay to use Session and that he doesn't have the time to implement a more sophisticated method.

我只是想知道另一种方法(s)是他在暗示?为什么是会议一个高流量的网站一个不错的选择?

I am just wondering what alternate method(s) is he hinting at? And why is session a bad choice for a high traffic website?

推荐答案

将数据存储在数据库中,或者在饼干或其他方法不直接占用Web服务器的内存。

Storing data in a database, or in cookies or some other method that is not directly tying up web server memory.

在除装载,会议还提出了问题,利用农场,因为你要么需要在服务器场同步会话,或者使会话粘性的能力,这会影响可扩展性。

In addition to load, session also raises issues with the ability to use farms since you would either need to synchronize the session across the farm, or make sessions sticky, which can impact scalability.

这篇关于为什么是一个坏主意,使用会话存储在高流量网站的状态呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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