Does KVM match testing follow the top down paradigm used elsewhere in Edge?

We need the KVM operations to try matching the key in a top-down order (first kvm element to last kvm element).

Can you confirm or deny this is true?

Thank you.

===================================================================

Solved Solved
0 4 262
1 ACCEPTED SOLUTION

No I don't think so.

But,.... I don't know what you mean by "matching the key in top down order". Maybe you can explain with an illustration?

The KVM Get does a lookup on a key, which may be a composite value. The lookup either succeeds or does not succeed. There is no cascade, as far as I know, by which Apigee Edge will try looking up something else, in some other map, or using some other key.

Maybe I've misunderstood your question.

View solution in original post

4 REPLIES 4

No I don't think so.

But,.... I don't know what you mean by "matching the key in top down order". Maybe you can explain with an illustration?

The KVM Get does a lookup on a key, which may be a composite value. The lookup either succeeds or does not succeed. There is no cascade, as far as I know, by which Apigee Edge will try looking up something else, in some other map, or using some other key.

Maybe I've misunderstood your question.

@Dino-at-Google - There is nothing like first match or top-down order in KVM. It works like a hash map right? I am also confused by this question


"The KVM Get does a lookup on a key, which may be a composite value. The lookup either succeeds or does not succeed."

The lookup succeeds or does not depending if a match to the Key is found in the Key field of the KVM table. The Key value elements of the table can be compared to in various orders, depending on the algorithm used (linear, binary, etc.)

We need to understand that algorithm to determine if the KVM is suitable for a particular scenario.

Thanks for the responses.

As an example, the fundamental "categorization" algorithm for URL base paths will order the paths in its lookup table such that in a linear search, a longer path with a similar component will match before a shorter one. Eg. a URL such as /pp1/pp2/pp3 will match basepath "/pp1/pp2" before matching basepath "/pp1". This is fundamental to determining the selection of which proxy within a org-env will be chosen to process a particular request.

If the KVM is ordered such that a key of 123456 is compared to a KVM key value of 1234, before a key value of 123, then the success of the match will be to the key,value pair where the key is 1234. A key of 123579, however, will only successfully compare to the key value 123, skipping the key value 1234, as that comparison is done 1st of the 2 values.

How the comparison algorithm works can determine the suitability of the KVM for particular scenarios.