Anyone know of any issues with directly querying the Tridion CM database? I have used both direct queries and the core service. I like direct queries better because it seems to be faster and much easier to get what I want. The queries are select only.
2 Answers
Reasons to use Core Service over SQL queries
- You do not need access to the database server to run Core Service. Often an issue in production environments.
- Data manipulation - Depending on your requirements it is easy to manipulate/format data as you wish using C#, whether it be save as Excel or Email to a group.
- Core Service, if built into web application, can be exposed as a custom page making it very easy to be re-used by others within the organization
- Future proofing, as per Raj
- Understanding the database model, as per Raj
-
+1. For #5 the positive for the Core Service is not needing to understand the database model. Commented Jul 15, 2014 at 21:48
-
I believe in using the best tool for the job. SQL queries are quicker if using a stored procedure. Correct me if I am wrong core service connections use WCF and do not make a direct connection to the database. I do use core service for many things. However, unless I am looking in the wrong place, there isn't much information for core service API and how to actually use the methods.– BryanDCommented Jul 24, 2014 at 18:13
-
Lots of Core Service information available in online documentation: bit.ly/1nY8zn9 [Login Required]. On that page, you will find a link to downloadable API documentation. Commented Jul 24, 2014 at 18:50
Direct queries are not future proof, In future upgrade your queries might not work, extra effort will go to resolve those. using Select queries You have to understand the DB structure, if you are fine and getting expected results with it, logically i don't see any issue using that. But Core service is SDL recommended approach for all. Never, ever run update queries.
-
1Adding to what Raj has said, you can use net tcp binding with core services to make it faster Commented Jul 15, 2014 at 16:49