Integrating scientific python into an existing Rails webapp

Go To StackoverFlow.com

4

I'm a fan of using the right tool for the job.

At my company, the data analysts (incl myself) primarily use Python because of the powerful scientific libraries; the web people downstairs use Ruby on Rails for building our own HR management webapp as well as maintaining our online presence.

We would like to have the two teams working a little closer together allowing the development of scientific webapps but are unsure about how to proceed.

We have significant investment in both technologies with a substantial codebase that we would need to continue to use.

Are there any suggestions about the best way to integrate the two domains of scientific programming and web apps using the two separate languages?

2012-04-04 23:55
by jbbiomed


1

In lieu of substantially hacking apart either codebase to fit the other, I would first propose you evaluate an SOA solution.

e.g. create an API interface to your Python system, and have the Rails app call that API for what the HR and public-site systems require.

2012-04-05 00:26
by crftr
This sounds like the best paradigm to follow. Now I just need to work out how to open my code base into an API.. - jbbiomed 2012-04-05 12:52
I've done a little research into this now. Given the scientific data is not designed for the web, (but simply to analyse client data) do you have recommendations on a simple way to create this API? Any opinions on this article i found on bottle and mongodb? http://myadventuresincoding.wordpress.com/2011/01/02/creating-a-rest-api-in-python-using-bottle-and-mongodb - jbbiomed 2012-04-05 13:40


0

I assume that the Python part is a stack of back-end libraries/modules of scientific functions while the Ruby-on-Rail part is mostly as front-end. Then an relatively simple solution would be wrap those Python modules/libraries into services and let the Ruby-on-Rail-built front-end functions call those services.

To build the Python services, you can use xmlrpc for simple implementation, or some sophisticated framework such as twisted for larger scale implementation. You can also created only one portal service that hosts all your Python modules/libraries, that would basically give you an application server that handles all the requests form the Ruby-on-Rails front-end. Using which strategy depends on the scale and complexity of your Python libraries/modules.

2012-04-05 02:16
by Will Cheng
Ads