Thanks for that Perrin - I wasn't aware of the ::Managed version of memcached, and it looks like it could solve some other issues in my system, but probably not for privileges.

Privileges may not change that frequently, but when they do change, they can have a far reaching effect, so it makes more sense to take the hit of working out which cached values to expire at the moment that something changes, rather than working out the namespaces right from the beginning.

However, I think your suggestion of using a memory table in MySQL for the privilege cache is probably spot on. It'd be fast, centralised and easy to manage, and comes with the indexes I need to expire the changed values intelligently.

The only problem I can see is the possibility of two processes interacting, where one caches a value low down in the privilege tree, while the other is changing a value higher up - I'll probably need to work through that with locking... which should be fine because these are all fast simple queries.

thanks - heart more at rest now...


In reply to Re^2: Optimising a flexibile privilege system by clinton
in thread Optimising a flexibile privilege system by clinton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.