Does Adobe recommend XPath query over SQL2 Queries ? If so why ?

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

484 likes

Total Posts

1,048 posts

Correct reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

484 likes

Total Posts

1,048 posts

Correct reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

21-07-2021

Hi All

 

     Recently I happened to attend an interview where, along with lot other architectural questions, I was asked which query is best ? . AFAIK , there is not much difference between them performance wise, as at the end everything get compiled and converted to SQL2. When I gave this answer the interviewer said "Adobe recommends XPath. why?" . I am not sure. I went and checked the documentation for query builder and I can see (recommended) against XPATH. I searched the forum and got this https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/xpath-or-sql2/qaq-p/279447 . But then here @Jörg_Hoh clearly mentions that XPath is deprecated , but still supported by OAK. I am bit confused . Can someone guide me ? 

 

Thanks

Veena

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

21-07-2021

I don't think that there is clear recommendation which query language to use. In the end the they are executed both within the same query engine, and the result and the performance are the same. Also Adobe-internally I can say that we use both query languages without really being in favor of any.

 

Historically there's been a favor of xpath (I don't know the reason why), and xpath has been deprecated during the standardization of JCR2 (as not only Day Software was involved, but also other companies which were favoring SQL/SQL-2). But xpath support has never been removed from Jackrabbit and Oak, and it's still fully supported.

 

So regarding your interview question, I think that statement of the interviewer was not really correct.

Answers (0)