This is the first article in a series where we will develop a Node Js project from beginning to end.
Node has the primary advantage of being fast. I mean REALLY fast. This is because it is asynchronous by default. Programming asynchronously is also what will make Node challenging. You need to start thinking about whether or not you need one function to complete before calling the next one, because this will dictate how you structure your code. We will cover this more in-depth in another article in this series.
- This stack is fast, MongoDB is an incredibly fast data store, Node is a very fast backend, and as a web framework, Express is very minimal and fast, and Ember, once loaded is an incredibly fast front-end.
- As a datastore, MongoDB is very flexible. You do not need to create collections to store data, just store data to it, and MongoDb will create it on the fly. Need a new field? just add it to the next thing you save.
We will also be looking at using a job queue server (most likely Gearman) to manage backend processes, and learn why this will make our application even more scalable.
That Sounds Cool! So What Are We Going to Build?
We will be recreating the now defunct Tumblr clone Posterous, that was bought and subsequently shuttered by Twitter.
Like Tumblr, Posterous was a mini-blogging platform with an emphasis on Post-types (video, audio, link, quote, text, etc.) and a community. It had two interesting features that set it apart:
- It was based around posting by email (originally)
- It aggregated full content to just about EVERY service.
That second item in particular is what will make this project very exciting. We will upload photos to our new app and then propagate them out to Facebook, Picasa, Twitter, Flickr, etc. Videos will go to Facebook, YouTube, Vimeo. We will repost everything to WordPress Blogs, Tumblr, etc. We will be using Node to connect to all of these different APIs and learning how to work with them in Node.
Ok, But the Big Question Is….WHY Are We Doing This?
In my work, I help startups develop product concepts from beginning to end, I architect solutions, I make sure these things can scale up to handle millions of users, and of course, I build these products for those startups as well. Its an involved process, that I love going through, and I want to be able to share that process with everyone else.
In our next article, I will walk you through setting up our server, and getting a simple web server running with Node.Js and Express.