What are the preferred solutions for:
* an RDBMS ORM?
* forms?
* templates?
* authentication?
* permissions?
* file storages?
* sessions?
* REST?
* internationalization and localization?
* caching?
* logging?
* mail?
* sitemaps?
* RSS/ATOM feeds?
and security: * XSS?
* CSRF?
* clickjacking?
* SQL injection?
* ensure secure connections and cookies?
I mostly use Django because I want to get stuff done, and with Node (as of a few years ago) it seems you have to rewrite the world.Both projects had (probably still have) a culture where if someone needed something, they'd first google for an npm, pick something, and just npm install that. Bleeding edge was viewed as a good thing. Kind of reminds me of the times when a new jQuery plugin was added for every little thing.
Soon, both projects will be using a large number of abandoned or obsolete npm packages which have been superseded by even more bleeding edge stuff.
Some day the dust will settle and preferred solutions will emerge for most things. But right now, man, it's a wild west.
Maybe Im being ignorant, but I don't remember even Rails being this crazy in its early heyday :)
From there, Node isn't that big -- it's a few libraries for interacting with the system. The assorted framework stacks and whatever haven't really sorted themselves out yet.
From a technical standpoint, what Node does well is that it's basically async-IO-by-default, which is very nice for real world performance, whereas in most-every other environment I've worked with async-IO feels like an unwieldy addon where example code is hard to come by.
Also, 3 to 5 years from now is where I'm aiming at (JS will be "stable but still cool").
I think Node today can solve these 4 problems well enough.
All in all, I've always been a Django advocate. I know people hate the "batteries included" approach, but it guarantees that all parts work together well, and you'd be surprised how much of it is easily replaceable/removable. I've even used Django as a bare-bones router/request handler framework with great results.
I should go back to Django again, I started out with 0.90 when I first learned about MVC with Python.
Unless you need to extend or modify the behavior in an unsupported manner.
Django got much better since early 1.x versions, and gets better with every release, but I still find myself monkey-patching its internals (or copy-pasting classes with some minor changes) once in a few months.
forms : I gave up on form builders few years back, write them by hand
templates : EJS(prefer personally), Jade
authentication : passport.js, just works
file storage : node's fs module for local file's, aws node's sdk for s3
sessions : express-session with redis client and all
REST : express.js (supported by IBM, of all companies, heh), and restify, built over express
internationalization and localization : No idea, haven't had to do this one yet
caching : depends on the use-case, for request-response level caching, check out express middleware for the same, use ioredis for other things
logging : metalogger
mail : I mostly use a mandrill client, but I bet you'd find a few really good mailing implementations. You have an industry grade mail-server (haraka) in node world, so finding a mailing lib shouldn't be hard
sitemaps : Again, haven't needed them yet
RSS/ATOM feeds : haven't needed them yet
XSS : tackled by EJS, Jade etc templating engines
CSRF : express-csrf middleware ftw
clickjacking : helmet
SQL injection : knex.js
Secure connection and cookies : express + express-cookies middleware.
Finding each of these libs is a matter of 10-15 min of research, looking at number of downloads, frequency of downloads, contributors etc. And they just fit together really well.
You mostly don't need all the features you listed in all of your projects. Using node's libraries, with some effort, you can build a framework tailor-made for your project.
Hope that helps.
I'm going to get a lot of hell for this since this is startup-land-latest-and-greatest-just-graduated-from-Stanford territory, but WebSphere and J2EE really got everything down for a god damn reliable infrastructure, REST or WSDL compatible, authentication/authorization via any provider you want ranging from Novell Netware to LDAP or AD, caching can be thrown in _every level_, if an appserver goes down, another node picks up the abandoned client sessions, you're getting high availability at just an absolutely remarkable level. Hate on maven (I've been down in the trenches with Scons and the GNU autotools set, you can get far worse) all you want but the ability to freeze and clone all of your dependencies into a local .m2 repository allows you to be 100% confident if an upgrade breaks functionality, regress & problem solved. I'm not even a J2EE advocate, more of a "please just work, I don't have the mental capacity to learn 60 packages + 15 workaround shims until all browsers are ES6 compatible.
I really like a lot of the options of node out there. Tons of packages are really useful and innovative (as opposed to Yet-another-templating-system). There are quite a few interactive projects that the v8 platform lends itself to, especially with socket.io, a lot more flexibility that didn't exist before. But between ReactJS, Flow, JSX (which confuses me even more when I context shift because I write C# with TypeScript), and 50 other packages out there, I'm completely lost.
From a managerial perspective, its going to be hell to maintain those projects 3 years down the line when all of your 22 year old engineers have moved onto their own startups/friends startups/across the country because their long-time-partner got into Harvard med/etc. You'll be left searching for someone with expertise in Jade, Express, Node, Mongoose, Nginx, Socket.io, JSX, [insert 10 other modules which will become critical to your architecture as time goes on]. It's great for the engineer who lands inherits that project on a 1099 capacity because they'll be able to bill whatever they want, but absolutely terrible in terms of long-term maintainability (and yes, I realize technical debt is often a "bond-offering" (heh) worth making in exchange for a faster MVP in some cases).
- Joel Spolsky in Things You Should Never Do, Part I [1], saying source code doesn't rust.
- Old Code Rusts [2], arguing that source code doesn't change by itself in the way that a car can rust "by itself", but the environment in which the code is used is always changing
So maybe Django is already old fart technology? Well if it is, then it's a pretty powerful, solid, productive, reliable piece of old fart technology standing upon other pieces of old fart technology that, despite environmental changes (as defined in [2]), remain powerful, solid, productive, reliable tech powering many websites. I'd just cheer with young_dev to party on, Wayne, and go with whatever floats his/her boat.
[1] http://www.joelonsoftware.com/articles/fog0000000069.html
Bad news: I'm obviously kidding here, but it's based on a true story.
We just got done migrating five complete websites to new hardware. In that process one had to be completely re-written from scratch and the other four had various levels of tweaking, adjusting and fixing.
The process was smooth as silk. No problems at all with deployment, live site testing, etc.
Oh, yes, these were all PHP sites.
I don't want to go into a Python vs. PHP discussion here. I'll simply say I am not a fan of PHP and by far prefer Python for most web (and other) work.
And still, I have to say, when it is time to deploy a Python site we have to go through a checklist to make sure every little gizmo that needs to be in place is in place. Well, now we have Ansible scripts, but that's besides the point. With PHP we just FTP from our local repository to the live server and it's up and running with almost no setup.
I also have to generalize and say that most of the Python/Django sites we've worked on are far, far more complex and involved than the typical PHP sites we see. This is where, to me at least, Python/Django shine.
Anyhow, maybe we are being lazy. Don't know. It'd be interesting to hear from others who might do a lot of Python/Django work.
Setting up some routes, the virtual environment, and env variables is a breeze. It's easy to test locally to see if it's breaking, and trivial to restart.
uWSGI is a pretty amazing piece of tech. A small binary which can do practically everything you need out a web server, really fast, and simple to configure.
Technically you can do that with Python as well depending on your setup. Although you may need an extra step such as "touching" your wsgi.py file. If you aren't caching your templates[1] (which you should in production though), you can upload template files and see instant changes.
[1] https://docs.djangoproject.com/en/1.8/ref/templates/api/#dja...
Also, I find deploying with mod_wsgi or uwsgi not any more difficult or time consuming than getting PHP-FPM set up and running.
I repeatedly use this for all my deployments and refer to my own notes during deployment.
My notes here: http://blog.busilogic.com/deploy-python-uwsgi-app-to-digital...
It's not as easy as deploying a PHP app, but overall the python/django stack with uwsgi feels right with enough options built in to suit your needs.
Yes, if you have a brochureware site with a few bits of database interactivity, you can just FTP a few files somewhere and have your PHP app up and running. The moment you start to introduce elements such as background queues, or more than a few developers on the team, you start to get into the realms of needing something more robust and doing config management.
Facebook uses PHP. I very much doubt their deployment process is to FTP a few files to the right place.
Setup the post_update git hook script to checkout to the webserver path and run django admin commands to collect static files and sync the database.
You can also setup a test environment to run your tests first, before updating production.
Coming from a .NET background, where everything is done through the point-and-click IDE, I find it couldn't be easier and pain-free than that.
This may not be the venue for me to surface this, but I've been trying to wrap my head around the MEAN stack for about a month now, and it doesn't really even register to me as the same language. I'm using Angular on the front end and ExpressJS plus Mongoose (MongoDB) on the back end, so yeah, it's all technically Javascript, but the real learning curve was in working out how to get these big frameworks to do what I wanted. I sincerely believe that if I was using an Angular frontend to call a Django REST service, I'd have had the exact same amount of trouble grokking what was going on (async calls being the obvious exception).
Am I thinking about this the wrong way?
You only spend some time grokking the basic syntax of the language.
Most of the time is spent getting the frameworks working and talking to one another. The frameworks having the same underlying language does not gives you much advantage.
The reason I reach for Node on a project is to handle my websockets. I use Django REST Framework + Ember as my main tools (super fast to build with) but, based on my testing, Python can't hold a candle to Node when working with thousands of websockets. It works great for what it was designed for.
I'm building a side project right now and I'm using Django running inside Tornado (it's pretty simple to setup, really) so I can both have my cake and eat it (easy APIs, and a layer I can use to maintain websockets.) I wonder if the performance would be comparable to Node?
Although Ember really feels like idiomatic Javascript to me and they try hard to adhere to new web standards (e.g. web components, ES6 modules) it is also very opinionated about what should go where and how.
The guy is just more uninformed about the web development landscape than you are. He's like the Java or Microsoft of 2000's, that only knew their own part of the development landscape. In other words, Blub to the bone.
[0] http://gilesbowkett.blogspot.com/2012/02/rails-went-off-rail...
Young dev: "So, what's your backend?"
Me: "Django"
Young dev: "What?"
Me: "Django, a Python framework."
Young dev: "Oh, right, that old framework. It must suck to support a legacy app that's written in something so outdated."
Me: "Well, we kinda use Django for everything."
Young dev: "Wow, doesn't everyone just use JS these days?"
Btw, I'm 36.