Hacker News new | ask | show | jobs
by ionrock 5750 days ago
Personally, I'd avoid node.js. It is most definitely cool, interesting and has been proving itself useful, but (!) there are a lot of details that won't come up until you really need them. If you're focusing on business logic and you already have a rather large set of applications that are relatively "bleeding edge", then I'd stick to a language that has a bit more history on the basics.

It is the really simple things like form parsing and cookies/sessions that may not be fully fleshed out in Node.js. Not that it won't be soon, but it is a nightmare to spend time on low level issues when you don't have to. This has always been the issue trying new languages and frameworks for projects. I get part of the way there and realize that some basic aspect of web development hasn't been done. Sometimes I start to handle the issues, but if the project is something I want to finish, it usually ends up with me turning back to Python. This might be a bad reflection on myself, but when you want to get something done that doesn't need the latest/greatest tech, it is nothing but frustrating to hit your head against a wall doing basics.

Just my two cents!

2 comments

Thanks for the warning. Any efficient front end could replace node.js in this design. I'm not wedded to it and it is the most recent component added.

I was trying to get out a huge concept in my head, and probably wasn't very clear. The real "web development" will be happening in CouchApp. I'm just putting node.js in front to provide a couple services, each of which I expect to be very small.

I'm expecting to write well less than 100 lines of node.js code to interface in front of CouchApp. Basically, it will just provide a quick lookup into the routes, and switch between two CouchApp handlers for certain pages depending on if the user is authenticated (Eg: if you look at profile of user Y, it woudl be good to know if you're logged in as user Y and thus can edit the profile, or are some other user, and thus see only the public info for user Y.) Also, to pull results from a couple lists or shows and compose them into a single page, which has to be done outside of CouchApp... but really isn't very complicated.

The caching bit will simply be checking to see if the etag for a page in couchapp is in redis, if it is, update its TTL to keep it fresh and send it to the user, if it isn't then get the full/new page from CouchApp, push it into redis and send it along. This will be problematic if the APIs for redis and couchapp are sychronous in their node.js drivers. Will have to check on that.

Anyway, like I said, I'd be interested in hearing of a good replacement for node.js.

Just need something I can write a simple caching, routing code in... have looked at webmachine a bit, and it might be better... not sure I can pull erlang out of the couch an run it, though.

Twisted may also be a possibility.

If you can clear your mind of all the attractive tech that could potentially fill gaps, it may help isolate the essential needs you have. After reading your description I didn't have a solid idea of what you were working to accomplish so it's tough to judge.

Then add technology as necessary. I bet you'd be surprised what you could accomplish with couchdb, or node/express+a DB alone.

I'm wet behind the ears with web development (just started late last year), but look forward to seeing how you and your team makes out.

Further investigation reveals that node.js is probably not ready for prime time, which is too bad given that it is trying to do the right thing. This shouldn't be too bad because powerDNS has been around a long time, and webmachine or another framework in front of the couch should let me composite multiple shows and lists. I think I may end up writing even less code now.

Also, looks like redis has some nice features, but memcached is what I really want. Want that built in LRU for expiring objects from the cache.