Answer the question
In order to leave comments, you need to log in
How to integrate two systems (PHP framework and .NET WebApi)?
I understand that the question is asked a little incorrectly.
I will describe the situation.
There is a master base in the form of a CRM system written in .NET WebApi with a RESTFul API.
I am a PHP programmer with a focus on Laravel Framework.
My task is to write not so much an online store as a showcase for a CRM system.
Actually, the question is, which way of integration will be the most optimal?
Options:
1) It's stupid to use a direct connection to the CRM master base.
The main disadvantage is that it is very difficult to make friends with Laravel and, in general, PHP with MS SQL, and I feel that it will not do without bicycles.
2) Again, use Laravel as a baseless layer, but knock on CRM via the REST API.
The main disadvantage is the increase in latency for the enduser.
3) Use Laravel as a separate system with its own base.
Main disadvantage: out of sync, cron's, ...
4) ???
Share your experience and pitfalls. Thank you.
Answer the question
In order to leave comments, you need to log in
The 2nd option is simpler and more correct
. The 3rd option can be called an optimization of the first one due to caching. In this case, you can invalidate the cache from the main system (something like webhooks only through queues).
If the REST API is written well (cache, convenient data structures, understandable method signatures) and gives all the necessary information, then what is the question. You just take it and use it, and you don't need to integrate anything. If everything is bad, transfer the data to your database and write your system.
something tells me that your database structure is not quite correct, and in this case it is better to use the 3rd table for the link, and not produce a bunch of fields.
In general, plus rework , but if you solve the problem head-on - there are 2 ways:
either 2 requests (first we pull out the number, the second we select the desired field) or a request with a bunch of IF
The structure of the table with names is definitely wrong. I advise you to change it immediately.
Create a names table with fields (Number, Name) and populate it with records like ([1, Name for Number=1], [2, Name for Number=2], ... etc.). Then you can pull out the data you need with a simple query:
SELECT names.Name
FROM humans
JOIN names ON humans.Number = name.Number
WHERE humans.HumanID = 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question