Viacheslav Chumushuk
Viacheslav Chumushuk

Reputation: 144

Multi tier architecture implementation on Python

I need to create web application, which can be reached by user as regular web site and as XML-RPC web service. Also web site should have mobile version. I'm planning to use next technologies:

Later other projects can reach this data and providing logic, so I think it is better to make two tiers. I see it in next way:

For communication between this tiers I'm planning to use XML-RPC protocol. In this case it will be easy to scale it and add new front end application or connect another projects to this (I believe it).

I have main question, -- what can I use to make it easy build first tier? Maybe there is some framework good for that? And what do you think about this whole architecture. Because I'm filling that I'm thinking in Java terms developing in Python. Maybe there is some another idioms in Python world for such situations.

Thanks for you time and help.

P. S. Some links for reading are welcome.

Upvotes: 0

Views: 3853

Answers (2)

Daniel Roseman
Daniel Roseman

Reputation: 599788

This architecture really makes no sense. You're using Django, a full-stack web framework, for the front end, but not using it for the database. And you're using Pyramid, another full-stack web framework, for the web service side, thus ensuring that you duplicate all the business logic.

Much as I am an advocate of Django, I would say it has no place in your architecture. It looks like the only thing you're really using it for is URL routing and templates, both of which Pyramid does itself fine - you can even use Jinja2, which is based on Django's template language, as the template language in Pyramid if you like.

Doing it this way means that you can share the business logic between the front-end and web service code, since you'll almost certainly find that a lot of it will be the same.

I must say also that I don't understand the division into tiers, which you have described as separate from the front-end/web service division. To me, the web service is the second tier. It makes no sense to have a further division.

Upvotes: 4

Paul Rigor
Paul Rigor

Reputation: 1026

You should checkout the Turbogears framework as it is composed of several popular components: ORM with sqlalchemy, pylons for logic and support for WSGI, permits support for several templating engines for the frontend... endless.

I use it for several web-services behind AJAX-enabled front-ends (like Flex-based apps, among others). You can front end the TG2-based webapp with apache or your favorite WSGI-enabled web server too.

Checkout their website since they have a tutorial to setup a wiki in 20 minutes.

Cheers!

Upvotes: 0

Related Questions