cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco direct database access

pkanuri
Champ on-the-rise
Champ on-the-rise
Hi ,

Apologies if this has been asked before, is it okay to access Alfresco's database directly for <strong><em>read</em></strong> operations only.
One of our requirements is to be able to run around 100000 queries on Alfresco . It seems that the query time would be much reduced
if the queries were made on the tables directly instead of going through the API.

I am given to understand that Alfresco doesn't publish the schema.

Please advise.

Thanks,
Phani
1 ACCEPTED ANSWER

pkanuri
Champ on-the-rise
Champ on-the-rise
Thank You both Axel and Krishna. The queries are needed to fetch information of metadata only. The UUID and some metadata properties(like cm:created, cm:modified and other custom metadata) are the only ones that need to be queried for.

So, going by your answers I gather that DB queries can be made in this case.

Kindly confirm.

Thanks,
Phani

View answer in original post

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator
You should indicate what kind of queries you need to run. Some queries might not even need database access and could be covered by pure index / SOLR queries.

But aside from that it is fine to access the DB for read-only operations outside of the Alfresco application context. Alfresco doesn't provide documentation about the schema if that is what you mean by "publish the schema", but it is publicly accessible as part of the source code and open to anyone to analyze / query.

gawadesk
Star Contributor
Star Contributor
As Alex suggested many things are possible with pure index / SOLR queries and it is always advisable to use them.

If you still wish to query in database then go for stored procedure/function as Alfresco database is normalized and you will have to perform multiple join to get data which can make life even more difficult.

Let me know what kind of query you want to perform.

pkanuri
Champ on-the-rise
Champ on-the-rise
Thank You both Axel and Krishna. The queries are needed to fetch information of metadata only. The UUID and some metadata properties(like cm:created, cm:modified and other custom metadata) are the only ones that need to be queried for.

So, going by your answers I gather that DB queries can be made in this case.

Kindly confirm.

Thanks,
Phani