1 (edited by iain 26-04-2013 20:40:22)

Topic: report service v data service

Hi

Up until now I've been fetching data from the entities by way of the data service which seemed like the obvious way of doing this when I first started out with Indicia. Now I'm thinking the more sensible plan is using reports, simply as this appears to be a more structured approach to achieving the same thing - which for me is a json list of 'somethings'. Does that seem a fair assessment, or is there any instance maybe where the data service would be used for populating forms (or panels or grids or whatever else..) as a preferred method over reports?

I assume both methods work in a similar fashion and create a SQL query to hit the database and so my guess is performance differences would be minimal?

Ta

Iain

2

Re: report service v data service

I'll try to summarise the differences as I seem them.
When using the reporting services, the queries are defined by the XML file and can fully leverage the facilities of PostgreSQL and PostGIS. In data services requests, the queries available are created using the Kohana database builder and are therefore not able to use PostgreSQL or PostGIS specifics.
This means that data services requests would continue to work OK if we were ever to port the warehouse to another database platform, but most reports wouldn't. This isn't currently on the cards so this may not be a consideration.
As parsing report files can be more complex than handling a data service request, there is a small overhead for using a report call rather than a data services call. However it is my understanding that the actual database hit is more significant than the PHP code required to parse the XML file.

Where there is a need for a fast search on the data, e.g. when looking up taxon names, I think using data services to access a table such as cache_taxon_searchterms is preferable over a report. For other scenarios I think using reports is likely to work well and will be more flexible.

Cheers
John

John van Breda
Biodiverse IT

3

Re: report service v data service

Thanks for the explanation John, it's pretty much along the lines of what I concluded after a bit of guddling about...

Ta

Iain