DEV Community

kajasumanie
kajasumanie

Posted on

How can i generate report in a micro service project

Hi all,I am creating a micro service project. now i am creating a report service to generate daily,monthly and yearly sells and profit information for a vendor(from vendor service).
So i need to get the data from vendor service to report service(in vendor service data can change time to time).i am planing to use elastic search to keep the real data in kibana. is it a recommended way ?
please give me idea. thanks in advance.

Top comments (1)

Collapse
 
zakwillis profile image
zakwillis

Hmmm. I have to say, I don't like the sound of this approach unless you really need to use Kibana and Elastic Search? Unless everything needs to be real time. We already know the answer, it can't be when you are doing daily, monthly, and yearly reporting?

I happen to be writing a data publication solution for my property platform right now, which does the following;

  1. Open a library namespace.
  2. Iterate through reflection to return each classes' IEnumerable. (This is not expensive, so please don't say how terrible reflection is). This means I don't care what the data source is (SQL/Oracle/MongoDB)
  3. Save them as JSON.
  4. Publish via FTP.
  5. Send a notification to an end point.
  6. The end point will then invoke loading the publications into cache.
  7. Application/Service end points then have that data available.

We could change these steps, not use FTP etc BUT...
I would rarely take the above approach if I was doing this in an enterprise. I would simply build reports in SSRS and call the report server web service with a request stream. In the above example, I am developing software for a much more specific requirement than described but it is too bespoke for standard staff to support.

I would build a proper data warehouse or reporting database.

It always concerning vendor data can change time to time. This provides a risk of changing grain, meaning the more code you write to produce reports, the more risk there is in terms of maintenance.

My feeling is you need to be very careful not to try and build the solution you are describing just because it satisfies a high degree of technical expertise. There needs to be a genuine reason. Now, nothing is stopping you building a data warehouse or using SSRS to publish to a location where the data can end up in Elastic Search but be careful.