Hacker News new | ask | show | jobs
by sul4bh 3993 days ago
The article mentions using a different database for each service. Which means, you cannot join table between different databases and you lose the 'relational' aspect of RDBMS. How is this problem solved by people using micro-services? For example, how do you related trip data and driver data for reporting purpose?
4 comments

One pattern I've seen is having an OLTP database per service and an ETL process to stream each service's data to a central warehouse or OLAP database that would satisfy reporting requirements.
> How is this problem solved by people using micro-services? For example, how do you related trip data and driver data for reporting purpose?

There are a couple of different ways that are obvious:

1) The act of scheduling a trip requires the trip service to get information from the driver service related to the driver for the trip (the action might be triggered from either service). While information about the driver in the driver service might change, the information about the driver that was recorded with that trip is fixed. All the information necessary to answer queries about involved drivers that are within the scope of the trip service is stored in the datastore for that service. The same thing is generally true of all services.

2) For generalized reporting, information required to support that function is sent by various services to a separate reporting service, which aggregates historical data for reporting purposes. (Even non-microservice architectures often involve this, having transactional operational databases export data into a analytical database, with different schema and capabilities, for reporting purposes, rather than using one datastore for operational and reporting use.)

One alternative is using "data virtualization" tools like Denodo Virtual DataPort, that create the illusion of a single relational RDBMS and let you perform joins between different databases (disclosure: I work at Denodo).

I wrote about it here: http://productivedetour.blogspot.com.es/2014/12/connecting-t...

Thanks for your answers. I see that data warehousing is an important aspect of microservice architecture. I wish it was highlighted more often on microservice discussions.