3 ms·
Anyone who've used web.py and Bottle (for a real project) and care to comment on the pros/cons of both? I'm quite familiar with web.py but not so much with Bott
by zyfo 15y ago
Anyone who've used web.py and Bottle (for a real project) and care to comment on the pros/cons of both? I'm quite familiar with web.py but not so much with Bottle.
- famousactress 15y agoUsed it early and extensively for a pretty good sized project. In my experience what really happens on a long-lived project is that you end up writing and assembling your own framework on top of the basics that are provided. Not a bad thing if you think you're gonna end up growing a lot of your own infra anyways.. I think mostly I'd use microframeworks like this in the future to do small projects and early prototyping.. or if I thought the project had special needs that was going to make using something like Django a particularly challenging match.
- andybak 15y agoIt's an interesting dynamic. I'm going through a similar thought process except one level of abstraction higher (at the pseudo-CMS level on top of Django). I'm sure similar debates happen at lower levels of abstraction too. You've got to decide for yourself where your 'reinventing the wheel' cutoff point is. For some people it's flipping binary bits, for others, anything lower level than configuring Drupal modules is just a waste of time.
- rmk 15y agoI used this thing in a desktop app that consumed a RESTful API service and received notifications (HTTP POSTs) from the API service. At a high rate, bottle just dies. So if you have a situation where you are making many requests to it, be careful; your mileage may vary.
- grncdr 15y agoWhat WSGI server were you deploying on? I'm thinking of using Bottle for some providing some REST services, so any details you can provide would be helpful.
- brandon 15y agoI can't speak for the parent poster, but I deployed bottle with the grandparent poster without any significant performance issues*. This was first under mod_wsgi, then paste.deploy once mod_wsgi got to be a headache, and now I'm looking at gunicorn as a simpler alternative to paste.deploy. So, why the asterisk next to "no issues"? I was able to wedge our app once by doing frequent, unbuffered, blocking socket.reads for one byte at a time in our RPC library... the GIL is a fearsome thing and it didn't play well with this strategy under highly concurrent request loads. I don't see that as a bottle problem, though. If you're anticipating high loads, though, I wholly recommend looking at Brubeck (http://brubeck.io/ http://brubeck.io/) or Tornado (http://www.tornadoweb.org/ http://www.tornadoweb.org/)
- famousactress 15y agoI'd be curious for the details other asked for (define high rate, and how did you serve bottle)... Bottle services requests admirably. Not much there other than regexing your path and calling your function. If you had scalability issues I'd be tempted to believe it wasn't bottle code that was causing your problem (assuming you were using a real webserver to serve bottle workers).
- ArchD 15y agoI was considering using it for an internal webpage in my company. In my particular use case, I would have needed a separate backend thread that watches some files and gives some data to the server thread(s) with proper synchronization. However, because of the GIL, I decided that using threads like this only adds complexity to my code without improving performance. In the end, I chose Twisted, which supports async. Using Twisted also allows me to use hanging GETs without worrying about needing too many server threads. I would have been happy to use Bottle if i) it had a feature that lets me specify FDs to watch and associated callbacks, like what I could do if I directly controlled the server select loop and ii) Python had built-in support for reader-writer locks. Twisted had async support but it's documentation could be more comprehensive. I understood the programming model, classes and methods well enough to use it for my project only after tinkering with code, not from just reading documentation or looking at examples.
- defnull 15y agohttp://bottlepy.org/docs/dev/async.html http://bottlepy.org/docs/dev/async.html might be interesting for you.
- dcreemer 15y agoI use bottle on top of gevent for two RESTful services, one of which sees peak 100's of requests per second. Bottle is perfect for my use case: basic routing, and a simple management / monitoring UI. I'm quite satisfied.