0

I am preparing the software architecture for my client project based on APIs REST The idea is that any data exchange between my client and his partner will be via API REST call

The specification is that my client have a large data store ( SQL database) which must me updated by data got from the partner

My question is :

  1. Should My client expose a POST API REST so that the partner invoke this POST HTTP and carry out the data in the payload to update our store (DB)

  2. Should the partner expose a GET HTTP API and my client just invoke the GET API (exposed by the partner) , the client get the data from the payload and update itself the store ?

Is there any criteria which I should consider when I decide in such scenarios ? regards

1 Answer 1

0

Who decides when the client's DB needs to be updated? Because that party will be the one sending the request.

Maybe the client only wants to update their database once. Maybe the client wants to receive every update the moment it is available. We can't know that.

This is something you have to analyze, to understand the requirements.

6
  • @BenhassineMohamed: There's your answer then.
    – Flater
    Jun 2, 2021 at 10:54
  • Thanks for your response When the partner has fresh data in his data store , HE DECIDES to push data to my client so the PARTNER IS THE ONE WHO DECIDE we have 2 solution : SOLUTION 1 : Partner expose GET API REST and SEND an event ( broker) to my client so the later is informed that he should GET the data from the PARTNER and update his DB SOLUTION2 : My Client Expose API POST and the Partner invoke the API POST ( published by my clinet ) to update data in client's DB what is the best solution and why ? Thanks Jun 2, 2021 at 11:01
  • @BenhassineMohamed: Re-read the first paragraph.
    – Flater
    Jun 2, 2021 at 11:01
  • so the Partner will send POST to CLIENT API according to you ? but here the partner may expose a GET and the client get informed and send request to get data from partner ? why not ? Jun 2, 2021 at 11:05
  • @BenhassineMohamed, KISS (Keep It Simple Stupid). The more complexity you add to your design, the harder it will be to reason about it and to maintain it. So, what is the simplest design that meets your requirements. Jun 2, 2021 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.