User Rights Storage Issues

Source: Internet
Author: User
The current design pattern is
User and role associations
Roles and menus, manipulating associations
That is, a field in a role is a heap of numeric IDs.
Because of the large-scale ERP system, the menu and operation is very
So the number of fields stored in the role is very large.

The current practice is to save the role ID session, each time the database read, and now want to put this heap of numbers into the session, look at the next 16k, afraid to save the session inside the server pressure caused too much.

There is no good solution.

Reply content:

The current design pattern is
User and role associations
Roles and menus, manipulating associations
That is, a field in a role is a heap of numeric IDs.
Because of the large-scale ERP system, the menu and operation is very
So the number of fields stored in the role is very large.

The current practice is to save the role ID session, each time the database read, and now want to put this heap of numbers into the session, look at the next 16k, afraid to save the session inside the server pressure caused too much.

There is no good solution.

Do I think the design itself has to be modified? 16k If the Java Long data can be stored 2000 is this a little bit more?

If for other reasons can not be changed, then if the role of the function ID is relatively fixed, you can consider the data cache in the application server, the session only store the user's role ID, each request come through the role ID to get the corresponding function ID list, and then the rest of the judgment can be

Consider memcached or Redis to store the session if the IO is too stressful for the server.

  • 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.