3

I currently have a website running PHP laravel. We came to a point where we want to add a user-backend -- where users sign-up and can access functions when logging in.

My question is; Is it possible to build a backend running Ruby and Ruby on Rails, while still keeping the front-end website in PHP Laravel? Would we have convert it? Or are we good running multiple languages?

3 Answers 3

8

The usual way to support multiple languages is to find some way for the two to talk to each other. This is very common in the web world; you might have a ROR site talking to an Android application. The conduit being used there is XML or JSON web services.

3

One way is to explore micro-services.

In this case, you can have part of your application written in, for instance, PHP, and other part of the application written in RoR. These two applications communicate through HTTP, probably using REST.

1
  • By talking about microservices and REST, you are being too specific. More generally, every SOA approach would work, and could use both REST and SOAP. Of course, SOA is only one of the multiple approaches: there are also RPC, message queue services, etc. Mar 27, 2016 at 9:57
1

It's very common to split web applications so that one part serves HTML, CSS, JS, images and so forth, while another part serves exclusively JSON through asynchronous javascript requests through some sort of API. It's usually easy to configure that to use a separate domain (api.example.com), but a different directory can work too (www.example.com/api). That way the division between the two parts (or in your case, languages) retains a logical organization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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