简体   繁体   English

在会话中存储数据与将数据发送到数据库

[英]Storing Data in Session vs Sending Data into Database

I am newbie in PHP and coding, I am developing a Webb App where I am collecting User Data, Form has 25-30 Different Field and data type, Can Anyone Tell me which would be more feasible for situation when we have large userbase. 我是PHP和编码方面的新手,我正在开发一个Webb应用程序,用于收集用户数据,表单具有25-30种不同的字段和数据类型,有人可以告诉我,如果我们有大量的用户群,这将更可行。 1. Keeping all data in Session and then after final submission sending all fields data to Database 2. Sending each Field data one after another to database 1.将所有数据保留在会话中,然后在最终提交后将所有字段数据发送到数据库2.将每个字段数据一个接一个地发送到数据库

Context is about making it feasible for resource usage in situation of large userbase. 上下文是关于在大用户群的情况下使资源使用变得可行。 I am using mongodb. 我正在使用mongodb。

Thanks for Your Answers. 感谢您的回答。

Personally I try to keep everything on the server's load as much as possible, so clients have a lesser chance of catching an error. 我个人尝试尽可能将所有内容保持在服务器的负载上,因此客户端捕获错误的机会较小。 So your second option would be my choice, it's more work, but I think it's the safer choice. 因此,您的第二个选择将是我的选择,这需要更多工作,但我认为这是更安全的选择。

Ps: This is my opinion, but since I can't comment on your question directly I had to write it in an answer. 附言:这是我的看法,但是由于我无法直接评论您的问题,因此我不得不在答案中写出来。

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

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