I'm about to start a small personal project that would expose an API about my stock portfolio. To achieve that I would have to fetch data from 3 APIs(My stock broker, one stats API and one to get extended hour prices of stocks) on a schedule, then calculate certain stats and expose them with via REST service, which would be the final goal. I'm planning to separate the app into two services. The first one would communicate with the external APIs and store their information into a DB and the other would calculate the stats I need and expose the REST service.
I imagine it would look something like this:
The blue part would be my two microservices.
I initially thought that this looks like a good design. The two services have two separate concerns and if each of them fails, the other would be completely usable. However, since they both would work with the same DB tables that would mean that I will have the same domain classes in both of my services. I don't like that repetition of code and then I thought that whatever kind of data that I would like to share between those two services should be replicated in both of them.
I have no experience in such architectures and I'm really curious how you've solved similar problems before.