M
M
Maxim Kudryavtsev2015-05-03 22:58:53
Apache HTTP Server
Maxim Kudryavtsev, 2015-05-03 22:58:53

How to combine a PHP library and a Rails application?

Good day to all.
Given an application in Ruby on Rails. Wonderfully written (from my point of view), works great, etc. As a web server apache + mod__rails from passenger.
Also, there is a third-party library written in PHP, which perfectly does what you need, in a particular case, collecting, organizing and uploading data. If it matters, this is some kind of news aggregator, which counts the number of mentions (city, full name of a person, name of an enterprise, etc.) from different sources, and on this basis displays some coefficients. They are clear to the customer, I did not go into them.
A Rails application has an admin panel, its own settings, and so on. and also requires data from the PHP lib for its work. In the current version of the PHP lib, it collects the necessary information, then it turns into something there and sends the result of its work to the soap (there is a long service email for this whole thing). The Rails application checks the mail every N minutes and, if there is a letter from the PHP lib, it processes this information (checking for integrity and correctness, no more) and enters it into the database.
As we all see, this is a crutch. The most correct decision here is to take this very PHP lib and rewrite it under Rails, but then I definitely won’t fit into the dead line (the option to move the dead line is not yet considered).
The problem I'm trying to solve is to speed up the application, because. the owner of this solution has more data and the whole structure described above by me is already starting to slow down pretty much.
The most logical conclusion is to remove email from this chain by combining both parts of the application on one web server. This is where I have all the problems, because I have no idea how this can be done. Google / Yandex are silent on this request, or I write something wrong there.
Actually tell me in which direction to dig at all? Are there any manuals on this topic, or at least throw off the keywords for Google, because I'm now at a dead end.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
marazmiki, 2015-05-03
@kumaxim

The key word is API :)
Let the rails application be, for example, a server and wait for incoming data at a specified address. And the php application, instead of sending an email, sends an HTTP request to the rails server.

V
Viktor Vsk, 2015-05-03
@viktorvsk

It is difficult to imagine where the email came from in the chain.
If you don’t need to change the business logic of the “php-lib”, and you are also satisfied with its speed, then what’s the problem, so that after the completion of the “php-lib” it would not send the content to the mail, but to some special API in rails ?

M
M1Anderson, 2015-05-04
@M1Anderson

The most correct solution here is to take this very PHP lib and rewrite it under Rails

You have already answered the question. It seems to me that it will be even faster than looking for perverted paths.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question