سؤال

I am considering to use python serving json based web services, my priorities are, in order:

  • maintainability
  • easy of coding
  • high availability
  • performance

Apache->AJP->Flup->Python seems ok to me, would you recommend another setup or is this ok ?

هل كانت مفيدة؟

المحلول

What would AJP do in that setup? The only "flup" I can find is a package with a "Random assortment of WSGI servers", which doesn't seem very helpful.

I'd recommend you to look at Pyramid and Django. Two Python web frameworks with different philosophies that both fulfill your requirements. Then pick the one that you like best.

نصائح أخرى

That setup will work, if you already know flup. There are about a million other configs, including using some pure python server (and Apache ProxyPass). If you need Tomcat, then this is totally reasonable. I recommend adding paste into the mix for managing the configuration.

Choose any WSGI-compatible framework (like already mentioned Pyramid, Django or Pylons, to name a few) and you will have plenty of deployment possibilities. There is a nice benchmark of WSGI servers, nginx + uWSGI seems like a good solution.

You don't give enough information to answer this question. What is your web service doing (apart from serving JSON)? Where does the data come from? How many different types of output are there? How dynamic is it? What sort of processing is required? Does it need authentication? Does it need a database connection? Will it be REST? Does it need to handle POSTs as well as just GETs? And so on, and on.

Your proposed solution might be good (although like Lennart I don't understand what AJP is doing in there), if you just very simple requirements to serve a few different types of content on a read-only basis. Again, though, if you have anything more complex you may want to look into Django + Piston, running on Apache + mod_wsgi.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top