Session save in file and memory what's the difference

Source: Internet
Author: User
I used to do projects are stored in the default session to the file, and the new company user data is stored in memory, please friends, what is the difference between these two? What are the pros and cons of each approach?

Reply content:

I used to do projects are stored in the default session to the file, and the new company user data is stored in memory, please friends, what is the difference between these two? What are the pros and cons of each approach?

Personally, two points are different, the 1th is security. Save to the file, there may be other programs or Trojan to obtain, people feel that there is a risk. Saved to memory, when the computer shuts down or stops the program, the memory data disappears and the latter is more secure. The 2nd is performance, no matter what language, IO operation time must be greater than the time of the operation of memory, that is, the same order of magnitude operation, IO performance than memory operation performance is lower. Because the landlord is stored in a file, that is, IO operation. So the individual feels the memory will be better.

can be saved in relational or non-relational database, not only solves the memory session is easy to lose, but also enables multiple hosts and processes to share the session

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.