Technology stack choices?

(Chris Bridgett) #1

Hello world,

Maybe this isn’t the intention of this forum (or maybe it is), but it will probably fall in-front of the right eyes to bring me up to speed.

What was the reasoning behind the team’s choice to roll with emberjs/Ruby/Postgre?

I have no doubt that Discourse is for sure going to cause a stir in the ‘forum industiry’/‘online community industry’ given the people behind it and the innovative new concepts it brings to the table.


Wouldn’t it have been better built in PHP/MySql. Don’t shoot me. I know that probably sounds blasphemous to the ‘purist’ (or ‘moderately competent’ :smiley: ) programmers out there, but think about it. The PHP community dwarfs the Ruby community, as a result of which the availability of web hosts offering PHP/MySql at ‘small business prices’ dwarfs those supporting the technology stack for Discourse.

Or was it a business desicion? Will you sell more of your upcoming hosting offerings by using a more obscure technology stack?

(Or I’m guessing the real answer is it’s probably the language the founding members were more profficient in - aside from Jeff, as I read in his blog… or on the about page… somewhere).

tl;dr - Wouldn’t the uptake have been quicker in terms of both community input and Discourse installations if Discourse were written in a more popular technology stack (e.g. Php/MySql).

I’m not a PHP advocate nor trying to start a holy war, just curious.

Why was emberjs chosen for Discourse?
Is it possible to change into mysql
Social features and why not PHP based?
(Brandon Rampersad) #2

I think this will be more of a hosted app for small users than having them install it themselves.

(Michel Billard) #3

If people keep making open-source software using PHP/MySql for that sole reason then it’s never gonna change. Ruby on Rails is very easy to learn and to me much more enjoyable to work with. There are a number of easy solutions (ex: Heroku) already available that make it much more powerful than PHP/MySql. Getting the whole thing to run on Heroku costs more than a Wordpress install somewhere else, but Discourse appears to have more powerful features than simply listing posts.

As more people develop open-source solutions in Rails, I’m sure the options will get better.

(Chris Bridgett) #4


(Mike Weller) #5

Postgres is also superior to MySQL in many ways. You just have to see how MySQL handles defaulting NULLABLE column types on an INSERT to understand why using it is simply dangerous.

See this link for some details. Postgres is a solid choice.

edit: As for PHP, it’s basically everywhere. But Jeff and his team are developing forum software for the next decade. PHP is already a legacy platform as far as many developers are concerned. The design of the language has many issues, the standard library is a mishmash of inconsistent naming, and if it’s going to be open source, the last thing you want is inexperienced developers hacking away at a PHP code base and sharing that crud with the world. We’ve all seen the kind of code I’m talking about and it’s not a pretty thing.

(jcolebrand) #6

Because you must not understand how these things work, do you? Traditionally PHP requires Apache and only operates via cgi-style interfaces. Ruby, however, with Rails, is a completely standalone engine. Because of that you have reduced the operational complexity, and allowed people to make the stack more optimized for what you’re trying to accomplish.

As for the db storage choices, you have to evaluate the needs, and in this case, the choice was likely MySQL (part of Oracle now, so it’s dubious that there will be everlasting free support), MariaDB (forked from MySQL so likely to also have issues in the future, such as a divergent API from MySQL which will confuse people who think this should be fit for MySQL) and Postgres. Postgres is more robust than MySQL in a fair number of ways, and requires less overhead.

So they chose the simpler, and simpler, and simpler choices for webstack, db, cache-engine and moved forward with writing their code.

Which would you choose in each situation? More complex or simpler? That’s what they did.

(Brandon Rampersad) #7

I wonder if they even considered nosql choices like mongo or couch.

(jcolebrand) #8

They’re too intelligent of a team not to have considered that.

You do realize most of the core of this team also has StackOverflow/StackExchange style experience, right?

(Chris Bridgett) #9

No need to attack me, I was only initializing a discussion in attempts to improve my understanding - i.e. a key function that forums serve.

(jcolebrand) #10

Ah, but to question the choices and name specific alternatives, you must understand them. Otherwise you should leave out the challenging bits about “shouldn’t they have done it in”

Sticking to “why didn’t they” was sufficient to learn the reasons why. Proposing alternatives for reasons that you assume to be “better” when you don’t understand them is not really socially responsible.

So, I’m sorry if I actively offended you, but yes, I did mean to call you out on making suggestions without understanding.

(Chris Bridgett) #11

Fair enough, maybe I should have just left it at ‘Why not something else?’. I’ve always found I explain points/concepts better by illustrating them with examples. I must have chosen a poor example in this case. :slight_smile:

(Why not?) #12

Why Ruby and not Python?

(Brandon Rampersad) #13

Why Python and not Node.JS?

(Adam Davis) #14

They should totally drop this and try jQuery.

(jcolebrand) #15

That is an excellent question, however.

Probably familiarity of the stack and the Rails usage?

(Alex) #16

I read that they are using PostgreSQL as their main data store and Redis for their job queue, rate limiting, as a cache and for transient data. Sounds like a smart choice to me. Especially Redis, Redis kicks *ss. :slight_smile:

(Justin Giancola) #17

But why is that? Did Wordpress, phpBB et al. choose PHP/MySQL because there was cheap hosting available? I don’t think so. Cheap hosting for PHP/MySQL became available because there was such a demand to host Wordpress, phpBB, etc. installations.

(Dskraus) #18

Right. Hosting totally became a commodified business. Very much a business that seems to just try to compete with each other on price point for amount of storage space, bandwidth etc. It’s a race to the bottom.

(Randito) #19

By going with Ruby, you can leverage a large ecosystem of gems that are especially particular buzzword complaint.

There’s event machine, redis, postgres, haml, sass, coffeescript and lots of other goodies under the hood. There’s restclient for making REST calls (not sure how it’s used though). There’s fog for AWS integration.

There’s a few gems (ha!) hiding in there, too. Check out the “onebox” and “messagebus”. Those have been the really cool finds I have found while digging through the code at GitHub - discourse/discourse: A platform for community discussion. Free, open, simple.. (I suspect onebox is piece that goes out and grabs content for links you place in the editor. i.e. github, flickr, etc).

(rs999) #20

[quote=“jcolebrand, post:8, topic:1457, full:true”]They’re too intelligent of a team not to have considered that.

You do realize most of the core of this team also has StackOverflow/StackExchange style experience, right?[/quote]

Which is why I am wondering why they didn’t go down the .NET/SQL Server route. Maybe Jeff got bored with that stack or maybe he saw something in stackexchange that he thought he could do better with Rails?