News for hackers. Stuff that matters.
Re:The Trello Tech Stack by edw519 on Thursday January 19, 2012 @01:09PM (#3485729)
Use things that are going to work great in two years.

This is one of those remarks that is obvious to someone who knows what it means but mysterious to someone who doesn't. So what does it really mean?

- Don't use a technology that, no matter how good, is just too niche for widespread adoption?

- Don't use a technology that we'll have trouble finding programmers to support?

- Look for stuff that will take better advantage of impending improvements in hardware and communications?

- Avoid frameworks for which support may wane?

- Avoid technology that we may have to support ourselves?

- Avoid anything proprietary whose owner may disappear?

- Make sure that whatever you choose, it will work well on mobile technologies, even as native apps?

- Choose technologies abstract enough to minimize our costs but not too abstract to be inefficient?

- Any combination of the above?

- What considerations have I missed?

Re:The Trello Tech Stack by frabcus on Thursday January 19, 2012 @01:19PM (#3485784)
My (minimal) criteria is it has to be packaged in Debian.

A couple years ago I considered both MongoDB and CouchDB immature for that reason. The recent confusion of CouchDB/Couchbase etc. shows that was a reasonable view.

Re:The Trello Tech Stack by mnutt on Thursday January 19, 2012 @01:31PM (#3485853)
I'm not sure when they started, but 10gen now packages and distributes their own MongoDB Debian and Redhat packages. It seems like the right move, so that they're not beholden to the update schedule of the distros.
Re:The Trello Tech Stack by wavetossed on Thursday January 19, 2012 @10:30PM (#3488172)
Yes!!! The development cycle of software like MongoDB, RabbitMQ and so on, is much faster than that of Debian or any other Linux distro. The Debian package is fine for dabbling or low volume use, but for any serious app, you MUST go direct to the developers and use their latest stable release. That is what they support best on their mailing lists, and that is where most bugs are already fixed.

A lot of software development teams are releasing their own RPM and .DEB Linux binary packages for just that reason, to encourage people to use up to date packages instead of the stale OS distro packages.

In a way, it's rather like security updates. Who would refuse to install security updates because it's not part of the Ubuntu 10.4 LTS release? Almost nobody even thinks of doing that. So why would you use old obsolete releases of mission critical software?

Re:The Trello Tech Stack by meatmanek on Friday January 20, 2012 @01:08AM (#3488560)
> why would you use old obsolete releases of mission critical software?

"If it ain't broke, don't fix it"

Because it's mission critical, and you can't afford for it to break. Once you hit a certain complexity, upgrades almost always break something:

APIs change. Undefined behavior changes. New bugs are introduced. A feature critical to your app starts performing worse. The above changes break something else you depend on (libraries, proxies, etc.)

Upgrading to a significantly changed version of a mission-critical app/library/language is a lot of work, and is sometimes impossible: many projects couldn't be reasonably ported to Python 3 if they wanted to; a lot of important libraries don't work on Python 3.

This is exactly why bug and security fixes are often backported into old versions. Python 2.5 is still receiving security patches. Apache 1.3 was maintained for years after 2.0 was considered stable.

Re:The Trello Tech Stack by mnutt on Friday January 20, 2012 @03:45PM (#3491139)
Yes, especially with a database you can't just pull in new updates and expect them to work. It involves reading the release notes and doing a lot of testing. (much of it is automated)
Re:The Trello Tech Stack by alexchamberlain on Friday January 20, 2012 @10:33AM (#3489762)
Equally APIs are backwards compatible, behaviour is defined, bugs are fixed, performance is improved and software becomes more compatible with other software.
Re:The Trello Tech Stack by jonknee on Thursday January 19, 2012 @01:15PM (#3485766)
I have a feeling that Javascript based NoSQL backed web development is going to be just fine in two years. Quite possibly the standard stack for a large percentage of projects.
Re:The Trello Tech Stack by gbog on Friday January 20, 2012 @10:55AM (#3489866)
I have the opposite feeling. I understand very well the reasons some are pushed away from relational data and data normalization, and set theory formalism. Some are need for change. Some are fears of over engineering. Some are because the trend is to Twitter-like blobs. A big reason is because doing things right is a pain in the...

And come the only valid reason, from my POV: We have to denormalize and avoid using the powers of relational data sometime because we do not know how to store (read and write) conveniently huge amounts of relational data; yet. Notice the "yet"? Well, I think it is a technical problem, that may not be so far to find its solution.

One example of a solution showing its nose recently: "Google plus with your world". It do strike me that the fact that any query I make to the closest Google server respond /instantly/ to any random word with a join on a very possibly monstruous matrix of all the likes of all my circled users.

I don't know how they do store this, where and how they denormalize, but in any case it seems to me to be just "relational data as usual".

So in two years, if there is a "bigreldata" software allowing to have a Postgres sitting happily on 1000 T of relational data with instant reads and writes, I would certainly use that with a layer of python glue on the server feeding a slim client than a blob datastore with NoSQL handcuffs and a fat client with 20 libs of third party Javascript code.

I may be wrong, however, and would love more insights on this.

Re:The Trello Tech Stack by jonknee on Friday January 20, 2012 @11:49AM (#3490090)
Google is not using a RDBMS to get Google Plus content on SERPs. What makes you think they are? It works just like the rest of Google on their leading edge kit: bigtable, GFS, etc. Amazon is able to personalize their site for each customer quite a bit more than Google is and relies on similarly horizontally scalable architecture.

Google talked a little about how personalized search works in a paper about BigTable, it's worth a review:

http://static.googleusercontent.com/external_content/untrust...

> Personalized Search stores each user's data in Bigtable. Each user has a unique userid and is assigned a row named by that userid. All user actions are stored in a table. A separate column family is reserved for each type of action (for example, there is a column family that stores all web queries). Each data element uses as its Bigtable timestamp the time at which the corresponding user action occurred. Personalized Search generates user profiles using a MapReduce over Bigtable. These user profiles are used to personalize live search results.

Regardless, even in your scenario with the perfect RDBMS, the future web stack wouldn't change much. You still have the same issues with blocking and different languages for client and server. As a developer myself, it doesn't matter at all to me if my call to a method is backed by a relational, document or key/value database. It's all an abstraction somewhere. It just needs to come back quickly and be easy to scale up.

The big change we're seeing is the client becoming primarily JS driven and the server more or less relegated to sending/receiving JSON. It's a much richer experience, but a pain when the toolsets on either end are completely different.

Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @01:31PM (#3485856)
I took it to mean "be forward-thinking rather than conservative."
Re:The Trello Tech Stack by jcromartie on Thursday January 19, 2012 @01:54PM (#3486006)
It might also include things that don't work so great now, but show promise, and will work great in 2 years at their current rate of development.
Re:The Trello Tech Stack by Haul4ss on Friday January 20, 2012 @09:31AM (#3489541)
This is how I read it. He was saying it's alright to go with bleeding-edge technologies, even if they're a little shaky now. As long as they have a good dev community behind them, they'll get better.
Re:The Trello Tech Stack by shasta on Thursday January 19, 2012 @08:22PM (#3487823)
"Use software that will work great in two years" is the reason we're looking at using Trello.
Re:The Trello Tech Stack by davesims on Thursday January 19, 2012 @04:04PM (#3486695)
Not to pick on him, because I think the overall received wisdom on new tech has shifted and morphed a great deal over the last few years, no doubt including Joel's...but I can't resist pointing out that, my how times have changed...

http://www.joelonsoftware.com/items/2006/09/01.html

In other words, it's nice to see Joel greenlight something like this, I'd say it's kind of a sign of the times in terms of the industry's overall comfort level with what would be termed 'hip' technology, or 'new' or whatever moniker you want to attach to it.

Re:The Trello Tech Stack by bigiain on Friday January 20, 2012 @01:52AM (#3488641)
To Joel's credit, that was over 5 years ago - which is, like, 35 dog-years ago (which are even shorter than tech-years).
Re:The Trello Tech Stack by davesims on Friday January 20, 2012 @11:08AM (#3489916)
Agreed, completely, just pointing out, again, time's is different...
Re:The Trello Tech Stack by lrobb on Friday January 20, 2012 @08:18AM (#3489337)
It's also weird to see fc have a "get big, then figure out how to make money" mentality.
Re:The Trello Tech Stack by nirvdrum on Thursday January 19, 2012 @03:35PM (#3486556)
This part caught my eye:

"The Socket.io server currently has some problems with scaling up to more than 10K simultaneous client connections when using multiple processes and the Redis store, and the client has some issues that can cause it to open multiple connections to the same server, or not know that its connection has been severed."

I wonder if they ran into redis's hard-coded 10k connection upper-limit. As it turns out, their configuration for "unlimited" connections actually has a cap of 10k. I believe in master this is going away, but if you need more than 10k connections on redis <= 2.4, you need to manually patch the daemon, in case anyone else runs into this.

Re:The Trello Tech Stack by trotsky on Thursday January 19, 2012 @01:50PM (#3485974)
How vulnerable are all javascript approaches in terms of injection type attacks? Do apps like node and mongo effectively prevent them, or is it still possible to shoot yourself in the foot? I've read some off hand comments along the lines of "as long as you're not a total moron you have nothing to worry about", but that sounds a lot like what was said about sql injections and xss before exploiting them went mainstream and it turned out everyones apps were filled with them. Has anyone audited a real world app built with a stack like this and come away with any experience to share?
Re:The Trello Tech Stack by radagaisus on Thursday January 19, 2012 @03:21PM (#3486475)
You CAN do injections to MongoDB code. An injection is basically 'allow user input to interfere with code' so for mongoDB assuming the query is a string you can do '{name: ' + user_input + '}'. and user_input, without sanitizing it (which is simpler, just converting it to a string) could be: {'$where': ...}

http://www.mongodb.org/display/DOCS/Do+I+Have+to+Worry+About...

Re:The Trello Tech Stack by rjrodger on Thursday January 19, 2012 @05:59PM (#3487309)
Unlike SQL, which you have to build as a string, the natural approach in JavaScript (even for junior devs) is to use an object literal to build the query. And then you get escaping for free.
Re:The Trello Tech Stack by JoachimSchipper on Thursday January 19, 2012 @03:31PM (#3486529)
See http://news.ycombinator.com/item?id=3369876. Summary: people seem to be ignoring security.

Also note stuff like https://news.ycombinator.com/item?id=3419693: node.js is not free of issues itself. (To be fair, lots of people got that wrong and it was patched quickly.)

Re:The Trello Tech Stack by trotsky on Thursday January 19, 2012 @07:49PM (#3487734)
Thanks very much!
Re:The Trello Tech Stack by brown9-2 on Thursday January 19, 2012 @01:55PM (#3486014)
What would be the difference in how you would handle this in a single-page JS app like Trello versus a traditional Java/Python/Ruby-based multi-page backend that mostly serves HTML pages?

It seems like at the end of the day you still need to validate and sanitize user input before doing anything with it.

Re:The Trello Tech Stack by trotsky on Thursday January 19, 2012 @02:11PM (#3486074)
I was inquiring more about the backend js use in node and mongo.

You might, for instance, find that simply sanitizing user input isn't enough when you're using the same interpreted language at multiple stages. If an attacker could cause the right front end code to be executed on the app server, or backend code to be executed in the database you could potentially compromise a lot.

Re:The Trello Tech Stack by radagaisus on Thursday January 19, 2012 @01:01PM (#3485685)
Just had to share this:

Our stack is Redis, MongoDB, Nginx, SCSS, HAML, Coffee, Rails and NodeJS. I'm extremely happy with these choices.

Recently me and a friend did a small weekend project: www.bubblefap.com (nsfw) The design and code is a homage to ugliness. We only used PHP-ActiveRecord and that's it. and I had so much fun!

I just hacked away! I was cowboy coding, hacking away, and I didn't need to think about frameworks and architecture and integration with fog and hacking Rack to support flash uploads. Oh, good times :-)

Re:The Trello Tech Stack by jcromartie on Thursday January 19, 2012 @01:15PM (#3485764)
Node.js, Redis, and MongoDB? They've gone full web-scale!

In all seriousness, though, it looks like they are using Redis for exactly the right reasons, and the larger architecture is pretty much the definition of a sane forward-looking design.

Re:The Trello Tech Stack by padobson on Thursday January 19, 2012 @12:17PM (#3485423)
I think this is the best write-up I've seen of a full Javascript/CoffeeScript stack.

I've always been hesitant to get too far away from my LAPP(ython) stack, but I'll almost certainly be hacking something together with these components to see how I like writing everything in CoffeeScript.

Re:The Trello Tech Stack by DanielBMarkham on Thursday January 19, 2012 @12:26PM (#3485483)
Nice job, guys. I love this architecture. This looks a lot like my dream stack for future web work.

Would love to hear some more about the "bleeding" experiences you've had.

Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @01:37PM (#3485887)
Re:The Trello Tech Stack by jashkenas on Thursday January 19, 2012 @01:55PM (#3486010)
dodger: I'd be curious to know where y'all bled over CoffeeScript or Backbone, if you don't mind sharing.
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @02:17PM (#3486115)
Actually, those have been great (and thank you for making them)! We had an outage during beta because somebody forgot to wrap an array comprehension assignment (CoffeeScript) and we didn't test right. Backbone has been really good, and while we had some complaints, I think many have been resolved in more recent versions - we're on something ancient.
Re:The Trello Tech Stack by robocat on Thursday January 19, 2012 @08:51PM (#3487906)
> "we're on something ancient"

Isn't that one of the major drawbacks of using a bleeding edge Tech Stack? Albeit mitigated by choosing to use code that is easy to comprehend/maintain (like backbone!)

What do you think you will do? E.g. With backbone: Merge up, status quo -- maintain your branch, change libraries, or something else?

Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @09:17PM (#3487977)
Agreed, it made some necessary, non-backward-compatible changes as a result of being such a young project. I think it is likely that we will upgrade to a newer version soon.
Re:The Trello Tech Stack by slewis on Thursday January 19, 2012 @02:15PM (#3486104)
The MongoDB one is a real cliffhanger. What happened?
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @02:19PM (#3486134)
We worked around the bug (which only happened when we were doing REALLLY long queries when we disconnected a client) and moved to Linux, where the bug does not exist. Awesome sysadmin Tim GDB'd into Mongo and figured out that it was an issue with SpiderMonkey, fixed in later versions.
Re:The Trello Tech Stack by drewda on Thursday January 19, 2012 @01:13PM (#3485752)
"We custom-built a client-side Model cache to handle updates and simplify client-side Model reuse."

Is this related at all to backbone.iosync.js?* Or, if not, is it something that Fog Creek will be open to sharing in the future?

* https://github.com/logicalparadox/backbone.iobind

Re:The Trello Tech Stack by techscruggs on Thursday January 19, 2012 @02:17PM (#3486113)
Question: They tout MongoDB's "generally fast" read speed. Any idea what this is in relation to? In "fast", are they suggesting that it is faster than a typical RDBMS? If so, does anyone know of any supporting benchmarks or breakdowns of how they accomplish this and to what extent?

Its news to me.

Re:The Trello Tech Stack by geekfactor on Thursday January 19, 2012 @12:19PM (#3485445)
Does anyone know of any open-source projects out there using a similar stack? I'm particularly interested in learning more about client-side view rendering with Backbone and Mustache... server side can be any of Node, Rails or Django.
Re:The Trello Tech Stack by jwarzech on Thursday January 19, 2012 @12:58PM (#3485666)
I've been using CoffeScript and backbone.js a lot lately, it really has changed my approach to web apps (keep the server light, just transfer json back and forth). The approach that has worked the best for me is to keep pages such as the landing and authentication as traditional rendered pages and save the client side rendering for the user-authenticated 'meaty' parts of the app.

If you want to look a couple really-small examples I have a couple apps on github I used for learning backbone.js/coffeescript. They both use the underscore.js template engine.

https://github.com/jwarzech/realtime_hn Backend is sinatra, takes a HN story url and polls the comments in reverse chronological order.

https://github.com/jwarzech/inspire_board Backend is rails, polls images from dribbble and lets you save your favorites.

Re:The Trello Tech Stack by randito on Thursday January 19, 2012 @04:26PM (#3486819)
I like the idea of doing authentication and OpenId in a traditional web stack, while doing the "app" portion in a javascript backbonejs stack.

That lets you use existing libraries (Devise, etc.) for the authentication and once that's out of the way, you can go have "fun" with coffeescript and mustache. :)

Re:The Trello Tech Stack by praxxis on Thursday January 19, 2012 @12:06PM (#3485361)
"We use a really excellent async library"

Does anyone happen to know if this is an open source or in house library?

Re:The Trello Tech Stack by gecko on Thursday January 19, 2012 @12:07PM (#3485374)
Re:The Trello Tech Stack by wildmXranat on Thursday January 19, 2012 @01:30PM (#3485848)
Yes, I've seen it on HN before and it's the bee's knees.
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @12:09PM (#3485384)
I meant to link that. Now it's linked in the post, and it's here: https://github.com/caolan/async
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @12:11PM (#3485394)
Funny story, I found this particular lib the same day as Daniel wrote some code that was an exact drop-in replacement for its 'parallel' function. So he says 'Yes, let's use that one, as I understand and approve of its approach.'
Re:The Trello Tech Stack by alexhaefner on Thursday January 19, 2012 @01:48PM (#3485944)
This is a great write up. We have a very similar stack for a separate team based project we're working on. The only difference is the front end stack, and we have tornado sitting back on the backend to serve http requests when needed. What's the benefit of Mustache/Backbone over just writing your own client side templating, in a practical sense? Last time I used a KVO framework, there was a performance penalty that I did not like. Does Backbone have any performance issues? Or even mustache? What's the trade off of having these frameworks versus generating custom tempting code?
Re:The Trello Tech Stack by apg on Thursday January 19, 2012 @12:17PM (#3485429)
This post raises a few questions for me... and perhaps some one more versed in these stacks can provide answers.

- Does the use of CoffeeScript alleviate the MC Escher-esque quality of callbacks within closures involved in working with Javascript on both the server and client (and the data store)? I can totally see the appeal of CoffeeScript's syntax. Giving the programmers something different to look (and learn) at probably provides some cognitive benefit as well.

- Is there an acronym/name (ala LAMP) for the Node/MongoDB/Redis stack?

Re:The Trello Tech Stack by jeswin on Thursday January 19, 2012 @01:21PM (#3485794)
1. CoffeeScript doesn't alleviate this yet. I doubt will be much progress on this until we find a good way to implement defer/async. https://github.com/jashkenas/coffee-script/issues/350#issuec...

I am writing a sizable Node app myself. In the end, you just get used to the callback style.

Re:The Trello Tech Stack by apg on Thursday January 19, 2012 @01:33PM (#3485867)
I am assuming that CoffeeScript should be able to add new syntax where the need arises, as the number of CoffeeScript users is probably still pretty low and able to adapt to change.

From what I can tell, CoffeeScript - and the Javascript/Node world - would really benefit from something like F#'s workflow/computation-expression syntax, which will take a fairly straight-forward readable statement and behind the scenes de-sugar the hell out of it into a bunch of closures.

http://en.wikibooks.org/wiki/F_Sharp_Programming/Computation...

EDIT: search for "De-sugared syntax" on this page for an example.

Re:The Trello Tech Stack by jashkenas on Thursday January 19, 2012 @01:53PM (#3485992)
That's correct -- because we compile to "standard" JavaScript, we're at least somewhat comfortable introducing significant changes (even to the syntax) where desirable. Even if you never get around to updating older pieces of code, all of the compiled JS continues to be fully compatible and interoperable with the newer stuff.
Re:The Trello Tech Stack by ufo on Thursday January 19, 2012 @09:36PM (#3488032)
Where is the love for [Deferreds?](http://www.sitepen.com/blog/2010/05/03/robust-promises-with-...)?

Deferreds are * Mostly monadic (creating a deferred is "return", the "then" method is "fmap" and "bind"). * Can be implemented as a library, without a separate compilation step or having to patch the runtime. * Avoids most of the CPS inversion of control madness. You can return and store promises and you can also add callbacks after the fact so code is much more flwxible. (writing sequential async loops is still annoying though)

Re:The Trello Tech Stack by robocat on Thursday January 19, 2012 @08:19PM (#3487811)
I think the following links are relevant for those of us that know much less than you:

I liked this article that discusses three different solutions to callbacks with different compromises: http://blog.willconant.com/post/7523275566/continuations-in-...

Jeremy discusses #350 and tamejs here: http://news.ycombinator.com/item?id=2777196

Tamejs have a great writeup about the callback spaghetti problem here: http://tamejs.org/

Re:The Trello Tech Stack by apg on Thursday January 19, 2012 @01:41PM (#3485910)
After reading that ticket, I think the solution is going to have to involve more than one keyword. It's curious to see that the objection is to the hideous mass of js that "defer" compiles down into. I kind of thought that was the point of CoffeeScript.
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @12:38PM (#3485555)
- Daniel is going to write another post detailing this. The answer is that when you combine CoffeeScript and a good async library, you can indeed get rid of that stuff.

- MoNsteR? =)

Re:The Trello Tech Stack by jeswin on Thursday January 19, 2012 @01:30PM (#3485851)
when you combine CoffeeScript and a good async library, you can indeed get rid of that stuff

My experience has been that you could only do this in few cases. Not an issue that can be worked around elegantly in libraries, you need language support. http://tamejs.org/

Re:The Trello Tech Stack by bluesnowmonkey on Thursday January 19, 2012 @12:51PM (#3485626)
LNMR... um... LaMiNaR? RoMuLaN?
Re:The Trello Tech Stack by apg on Thursday January 19, 2012 @01:51PM (#3485980)
I just ran the letters modb-re-nojs-li through my handy word_solver and came up with some candidates: MoRN, NoRM, ModeRN, NiMRod, ReMiNd, MeRLiN, LiMNeR, NiMbLeR
Re:The Trello Tech Stack by prodigal_erik on Thursday January 19, 2012 @03:08PM (#3486399)
"Client-side MVC" is kind of unfair to backbone.js. I haven't confirmed it myself, but I've seen people explaining how it's also suited to server-side rendering, which means it's not ruled out for competent authors doing progressive enhancement.

http://lostechies.com/derickbailey/2011/09/26/seo-and-access...

Re:The Trello Tech Stack by djb_hackernews on Thursday January 19, 2012 @12:31PM (#3485518)
Great write up. Hopefully that ephemeral data in Redis can scale.

They could have used something like Pusher for about half of their implementation (the websockets, message pushing, polling, etc)

I bring this up because I built an OSS Pusher clone[1], for those people that want to deploy their own, built on the Play! framework.

[1] https://github.com/danbeaulieu/PushPlay

Re:The Trello Tech Stack by jurre on Thursday January 19, 2012 @12:38PM (#3485554)
There's also this ruby implementation that plays nice with all the pusher libs https://github.com/stevegraham/slanger
Re:The Trello Tech Stack by djb_hackernews on Thursday January 19, 2012 @12:56PM (#3485657)
Yes, I built my version almost in tandem with Steve. Pusher hosts their js lib on github under the MIT license which made building these things supremely easy.
Re:The Trello Tech Stack by eaurouge on Thursday January 19, 2012 @12:53PM (#3485636)
If you could do this over again, would you still choose socket.io for websockets, or would you go with something else like PusherApp?
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @01:00PM (#3485680)
Today I'd consider going with a service, but first I'd see how https://github.com/LearnBoost/websocket.io looks. Most of our problems have been with abstractions in the socket.io client and scaling issues with server process chatter. The chatter shouldn't be necessary with websockets-only.
Re:The Trello Tech Stack by Rauchg on Thursday January 19, 2012 @01:06PM (#3485717)
With https://github.com/LearnBoost/engine.io the abstractions are greatly simplified, which is what I'm announcing today.

The socket.io codebase has been shrunk dramatically, and it's as a result easier to scale/maintain.

Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @09:21PM (#3487985)
That's great!
Re:The Trello Tech Stack by wowzer on Thursday January 19, 2012 @01:29PM (#3485840)
When I first saw Trello I "felt" that something cool was going on under the hood. So I did a little poking to see what JS technologies you guys were using. The piece I was most excited to learn about was backbone. Had never seen it before and was really impressed by the space it was filling and what it's capable of. Thanks for the write up.
Re:The Trello Tech Stack by barmstrong on Thursday January 19, 2012 @03:30PM (#3486516)
Great writeup!

Can you guys share what (if any) test suites were used? Was curious on this point.

Re:The Trello Tech Stack by karterk on Thursday January 19, 2012 @12:23PM (#3485457)
I have read about various issues in using HAProxy and socket-io (websockets mode). I am currently working on a project that's heading towards that direction - anyone has anything to share on that front?
Re:The Trello Tech Stack by feralmoan on Thursday January 19, 2012 @12:32PM (#3485523)
nginx supports http1.1 reverse proxying as of a few weeks ago http://wiki.nginx.org/HttpProxyModule

Mikito Takada (Zendesk) has some really helpful information regarding socket.io + haproxy specific workarounds via http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-soc...

Re:The Trello Tech Stack by karterk on Thursday January 19, 2012 @12:54PM (#3485641)
Thanks. Looks like it's available only on the development version - I wonder if it's production ready...

Also - I took a look at the article - it does not mention using a total node approach of using something like node-http-proxy for load balancing. Any idea on such a set-up? I need HTTPS as well.

Re:The Trello Tech Stack by mixu on Thursday January 19, 2012 @02:46PM (#3486263)
A pure-Node approach is a lot simpler: you can just use Node's HTTPS (if you don't care about load balancing) and attach Socket.io to it. Just don't put your Socket.io server behind Nginx if you want WebSockets support.

With load balancing, I would recommend going with Stud/Stunnel and HAProxy. Terminating SSL with a specialized piece of software is nicer (separate SSL overhead to another box), and using a separate load balancer allows for more flexible options, e.g. serving static assets from Nginx. There is nothing wrong with node-http-proxy, it's just that these two projects have been around for longer and are better understood from an ops perspective.

You cannot use round robin load balancing, you need to have at least IP-based stickiness with Socket.io for now. Well, you can round robin if you use the Redis store but you'll run into inefficiencies with https://github.com/LearnBoost/socket.io/issues/686 . I'll do a bit more coverage on other SIO deployment-related issues once I get the chapter on Socket.io finished for my (free) book in a few weeks.

If I were starting now, I'd just ignore the Flash sockets transport since it makes the whole stack more complex due to not looking like HTTP to load balancers, and start with Engine.io / WebSocket.io to take advantage of their simplicity.

Re:The Trello Tech Stack by jslabaugh on Thursday January 19, 2012 @12:18PM (#3485433)
Great write-up... It made me want to go play with these exact components!
Re:The Trello Tech Stack by jroseattle on Thursday January 19, 2012 @12:57PM (#3485660)
Love the stack, already working on something similar (mine involves nginx, though.) Given we haven't deployed, it's refreshing to see a similar diagram from those already out in front.
Re:The Trello Tech Stack by wuher on Friday January 20, 2012 @05:46AM (#3489059)
Great writeup, I wish more companies did this: be open about their tech stack and experiences.

This inspired me to write about how I think, they could've gone even further: http://wuher-random.blogspot.com/2012/01/single-page-web-app...

Re:The Trello Tech Stack by dodger on Friday January 20, 2012 @09:28AM (#3489531)
Yep! We intend to use our shiny, well-organized REST API for future development and probably port existing functionality to it, too!
Re:The Trello Tech Stack by Smrchy on Thursday January 19, 2012 @01:49PM (#3485955)
I am wondering where and how you terminate the HTTPS connections for websockets. Can you share some details on that?
Re:The Trello Tech Stack by strictfp on Friday January 20, 2012 @02:49AM (#3488741)
" sending changes to Models down to browser clients". _Down_ to the client? He draws the stack with the client on top and the storage at the bottom, and then says 'down to the client'? I have a collegue who also does this. I never figured out why. Can anyone explain possoble reasoning behind this wording?
Re:The Trello Tech Stack by Flenser on Friday January 20, 2012 @10:24AM (#3489729)
Because from the client downloads assets and we are more used to thinking about what happens from the client's pov.

Alternatively, it could be for the same reason people usually say they're going "up" to a big city, regardless of the direction of travel. The server is the hub and all the clients are down from it. This possibly dates back to when towns/fortifications were usually located on hills.

Re:The Trello Tech Stack by roel_v on Friday January 20, 2012 @10:25AM (#3489732)
Because the client DOWNloads stuff, presumably. To me it makes perfect sense, servers send stuff 'down' to clients, regardless of a stack figure where stuff is arranged otherwise. Those two are orthogonal.
Re:The Trello Tech Stack by sifi on Thursday January 19, 2012 @12:45PM (#3485597)
Awesome job guys. I'm really digging this stack. It is giving me motivation to learn more about Backbone.js
Re:The Trello Tech Stack by crescentfresh on Friday January 20, 2012 @05:13AM (#3488986)
Does it just go without saying these days that jQuery is required? Trello uses it, as well as jQuery UI, date.js, and highcharts.js far as I can tell.

I mention it because they mention other parts of the client stack (Backbone.js for ex), but not said libs.

Re:The Trello Tech Stack by swah on Thursday January 19, 2012 @12:42PM (#3485587)
It seems Socket.io has not had any contenders yet..
Re:The Trello Tech Stack by yesbabyyes on Thursday January 19, 2012 @12:55PM (#3485649)
Socket.io is a great library. When it comes to a contender, I see Server-side Events [1] as a contender to WebSockets. I feel it's a simpler architecture which fits HTTP/REST better than WebSockets in the general case. I built a couple of small experiments/examples using CoffeeScript and Redis [2]; the middleware.coffee in particular is designed to be used together with REST, where if you send "Accept: text/event-stream" you will get updates to the resource(s) on that URL.

1: http://dev.w3.org/html5/eventsource/ 2: https://gist.github.com/1560654

Re:The Trello Tech Stack by josephg on Thursday January 19, 2012 @05:19PM (#3487108)
Unfortunately, eventsource isn't supported by any current version of IE. It'll be awhile before ES can replace your AJAX/websocket libraries.

http://caniuse.com/#search=eventsource

Re:The Trello Tech Stack by yesbabyyes on Friday January 20, 2012 @08:55AM (#3489443)
On the plus side, it's supported by Opera Mini and iOS.

For IE and others (Android, I'm looking at you!), I have yet to try it and so can't vouch for it, but there exists a polyfill: https://github.com/Yaffle/EventSource

Re:The Trello Tech Stack by josephg on Thursday January 19, 2012 @05:16PM (#3487091)
There are a few, but none of them are widely known about. Socket.io's problems only become visible once you've been working with it for awhile.

The three alternatives I know about are SockJS: http://sockjs.org

Faye - which implements the Bayeux pubsub protocol: http://faye.jcoglan.com/

And node-browserchannel (mine) which implements google's browserchannel protocol: https://github.com/josephg/node-browserchannel (BrowserChannel works all the way down to IE5.5!)

Re:The Trello Tech Stack by skeletonjelly on Thursday January 19, 2012 @07:53PM (#3487746)
Surprised that they didn't incorporate any ASP.NET MVC in there. I was under the impression they were a Microsoft shop?
Re:The Trello Tech Stack by sandwiches on Friday January 20, 2012 @02:24AM (#3488700)
Pretty cool; any insight as to how they deploy code to production servers?
Re:The Trello Tech Stack by nigma on Thursday January 19, 2012 @01:00PM (#3485677)
Very cool. What do you use for search?
Re:The Trello Tech Stack by dodger on Thursday January 19, 2012 @01:02PM (#3485690)
Right now? Just what we can get out of MongoDB. We need better search, and it should be coming soon. Vote it up! https://trello.com/card/board/better-search/4d5ea62fd76aa113...
Re:The Trello Tech Stack by jeswin on Thursday January 19, 2012 @12:14PM (#3485410)
The UI could be less cluttered.