Search code examples
restweb-servicesdatabase-design

Share information between web site and API


I have a REST API providing a service to my users. And I also have a website to allow my users to get some information and register to use the API.

So far, both my web site and my API are totally decoupled (2 separate app with 2 separate databases). However, now I need to share information between them.

I think of 2 solutions :

  1. Exposing the data I need to share from app_1 through a small API used by app_2.

  2. Merging the 2 apps and more precisely the 2 databases.

But I can't decide which could be the best solution.


Solution

  • The trend at the moment is to use method 1. Do some research on the Micro Services pattern and that will explain more. This also helps you scale your applications components independently should one have more load than another.