7 ms·
Django is falling behind
- dedsm 14y agowhy on earth would you want to have mongo as main database to emulate relations?
- GuiA 14y agoWhy, to make it to the HN frontpage of course! :)
- kennu 14y agoI have used MongoDB as the main database for many small/mid-size web projects and found it to be very flexible compared to MySQL/Postgres: - No manual database/user creation needed - No manual table creation needed - No schema migrations needed - No nested relations needed, because typical web app data structures fit well as dictionaries/lists - No extra caching layer needed because of previous point So basically, your app is simpler, and when you give it to a co-developer who has MongoDB installed, he can just start using it. And when you develop further, you don't have to mess with the schema migrations either with co-workers or when deploying to the server.
- kungfooey 14y agoHow did this get on the front page? - The headline is sensational (goes from "Django doesn't support NoSQL" to "Django is falling behind"). - Author says Django "claimed to be SQL-agnostic" then goes on to conclude that it isn't because it doesn't support NoSQL data housing. What? SQL-agnostic doesn't mean storage agnostic. It means /SQL/-agnostic.
- kennu 14y agoYou might be right that the "SQL-agnostic" argument was not well formed. I basically meant that the Django ORM has always been very object-oriented, and it has avoided SQL-specific concepts like WHERE clauses as much as possible. And because of this, it wouldn't be so hard to make it work with MongoDB, except for more complex relations. In fact, this has already been done by django-nonrel for 1.3. If anybody thinks the article was satire, it was not. In fact it was written during a MongoDB conference. ;-) I really am worried that as MongoDB has passed the hype phase and is now becoming a regular and supported part of web technology stacks, Rails is the only heavy-weight framework/ecosystem that really supports it. I also think that MongoDB currently adds most value to small/mid-size web projects, whose development speed can benefit from the schemalessness and other flexibility compared to RDBMSs. It's not that relevant whether it can actually be used to build the next Facebook or Twitter. (I wrote the original article.)
- Pewpewarrows 14y agoAt the core developer Q&A during DjangoCon US this year, it was pretty much universally agreed upon that non-relational database support for the core of your app was too much of an edge-case to bother finishing work on. I used MongoDB for a year and a half. For 99% of projects that I see on HN and hear about IRL, I'm comfortable saying that you don't need that as your core database. Consider it for the portion of your domain that actually needs nonrel benefits (such as analytics), along with others like Couch, Redis, or Riak. Your thinly-veiled CRUD app with a social layer doesn't need MongoDB. Here's a nickel, go use a real relational system like Postgres that makes sense for the meat of your data.
- pewarrowspew 14y agoYour narrow-minded approach fails to consider the fact that his web application might need to be web scale.
- johndagostino 14y agonot sure if you're trolling - please define "web scale"?
- CWilliams1013 14y agoWell since his username is a slight variant on the parent's username, he's probably trolling and making reference to http://www.youtube.com/watch?v=b2F-DItXtZs http://www.youtube.com/watch?v=b2F-DItXtZs
- maak 14y agoThe tone of your comment was not necessary. Keep it constructive and positive.
- endgame 14y ago"Django doesn't have the feature I want, so it's doomed to irrelevance." Rails will win, driving a ruby-tipped stake through Django and nobody will be able to use it for anything any more.
- deleted 14y ago[deleted]
- beatpanda 14y agoWhat about http://django-mongodb.org/ http://django-mongodb.org/?
- misiti3780 14y agothat is django-norel, which he mentions in the post https://github.com/django-nonrel/django-nonrel https://github.com/django-nonrel/django-nonrel
- famousactress 14y agoNoSQL support is one of the least interesting ways that I find Django failing to keep up. I'd much rather see catching up with regard to ORM/SQL efficiency improvements, cache infrastructure usefulness, resolving the manager/queryset/model-method wackiness, or a half dozen other things where I feel like I don't have much argument to make w/ Rails folks when it comes to comparing the frameworks.
- richardlblair 14y agoImprovement to the ORM should be the #1 priority IMO. This is my single biggest pain point with Django.
- czbond 14y agoAgreed. I keep looking for reasons to use Django for anything other than small/medium complexity apps - but Rails keeps winning for these..... yet I prefer Python but have to construct in Ruby.
- nilsbunger 14y agoI've never tried this, but is using SQLAlchemy with Django relatively easy and production-worthy?
- codewright 14y agoNothing about SQLAlchemy has ever been easy, in Django, Flask, or raw WebOb Python apps I've worked on. It's production-worthy, but the tax it levies on your soul probably isn't worth it. https://github.com/coleifer/peewee https://github.com/coleifer/peewee
- kenneth_reitz 14y agoYou can use SQLAlchemy's connection pooling in conjunction with the Django ORM: https://github.com/kennethreitz/django-postgrespool https://github.com/kennethreitz/django-postgrespool
- freyrs3 14y agoIt's only falling behind if you consider MongoDB to be a forward technology. I don't.
- fduran 14y agoFalling behind != default support for MongoDB Besides, adding mongodb support (including admin) to Django is trivial with pip install django-mongodb-engine pymongo.
- xxiao 14y agoa naive question, while javascript etc are used for client side, php/ruby for server side frameworks, what's the point of python these days? I noticed python guys are keen on attacking php specifically, never the other way around though, why is that? it's said ruby can not scale well comparing to python for large deployments, is that still true? what's the place for python, do we really need it at all these days? maybe the django-is-falling-behind is just a sign of python getting irrelevant?
- zeeg 14y agoI assume that anyone who agrees with this post doesn't actually do programming, and would struggle to instantiate a Redis client and then use it in the simplest manner. You cant have a RELATIONAL mapper without a RELATIONAL database, and you break nearly all of the constraints with many of these "NoSQL" solutions that the Django ORM relies on. If you want to use NoSQL, use it. There's no reason the Django ORM needs to support it. Programming isn't hard.
- kennu 14y agoI would claim thare are benefits in a framework having a similar API for both for SQL-ORM and NoSQL-ODM. This has already been done in the Ruby on Rails world, where ActiveRecord and Mongoid exist in parallel and have similar interfaces. This makes it much easier for third party modules to support both of them. Perhaps ideally, the ORM API is a superset of the ODM API with added support for transactions and deeper relations etc. Apps that don't need those features can then easily support both.
- zeeg 14y agoWhat benefits? They're completely different technologies. They share very few characteristics, and many apps which are built on SQL using the ORM would not "just work" on a NoSQL engine. You also are only talking about MongoDB. Who cares about MongoDB? Maybe you do. What about the guy using Cassandra? Or Redis? Or Couchbase? etc etc etc They all have very different properties, and the only thing they have in common is that they store data, and some of them allow you to query on the data.
- wiremine 14y agoThe headline is sensational, and Mongodb support is a poor yardstick. And, using Rails as _the_ benchmark is another poor choice. That said, as a full-time Django developer, the headline resinated with me, although I can't put my finger on exactly why. It feels like the last 3 releases (1.3, 1.4, the 1.5 betas) have been lacking in terms of their vision and scope. Some things I'd appreciate seeing: * Cleaning out django.contrib, and shifting to a more modular methodology for not-quite-core functionality. * The default settings.py is just downright laughable compared to what one typically uses for production. Rolling your own environment-specific files (ala local_settings.py) could also use some attention. * Django admin is still a killer app, but the visual design is long in the tooth. Integrating twitter bootstrap, Zurb's foundation (or any modern HTML/CSS framework) would be a huge improvement. * Merging South (or any db migration system) into core would be great. * Revisiting management commands (both the layout and the features) would be great. * Easier/cleaner support for eventlet or gevent would be nice. At least at the routing and view level. * PKs with some sort of UUID * A vision for loosely coupling apps together. 1.5 will be including custom User models, which is handy, but doing something globally would be great. It will always be up to individual app developers to get to the last mile, but some sort of plumbing in Django core would be very handy.
- jacobian 14y agoFunny, your TODO list looks a lot like mine.
- qiller 14y agohttps://github.com/sehmaschine/django-grappelli https://github.com/sehmaschine/django-grappelli is a quite nice theme for admin
- wiremine 14y agodjango-grappelli is very nice. However, something like Bootstrap has a lot more going for it in terms of a ecosystem, which would be a really nice side effect if it was brought into Django.
- 14y ago
- pydanny 14y agoCheck out my project http://pypi.python.org/pypi/django-mongonaut http://pypi.python.org/pypi/django-mongonaut / https://github.com/pydanny/django-mongonaut https://github.com/pydanny/django-mongonaut which which when tied with MongoEngine provides you with a stable interface for building django.contrib.admin-like UIs just as easily. Also, why not just use Postgres with Hstore? All the benefits of MongoDB, but with the bonus of being in a mature, stable database. And integration with Django is trivial.
- peterbe 14y agoNo it's not. By the way, if you're interested in being agnostic on your NoSQL backend, take a look at Schematics https://github.com/j2labs/schematics https://github.com/j2labs/schematics