Build Your Own Facebook - Part 1
Here's a billion mythical dollars - let's design the next popular mobile/social application. I don't know how long this series (!) of posts will last but I'll at least start with this one. We're not actually going to build a Facebook, but maybe we'll design some of a similar application, and see how big a problem can get just starting from a small acorn of an idea.
The huge question
A while ago I saw a question on Stack Overflow about building a "basic social application." I'm summarizing a lot, but essentially the original poster had spent some months (or more) learning programming and has an idea for a mobile+social application and wants to know "what next?" Original question here if you want to read it: How to Create a Basic Android Social Service. The question got closed, probably for a variety of reasons, but mainly because it's a huge spectrum of a topic and the answer would not be well-suited for the Stack Overflow format. I don't know the original poster, but I'm going to assume based on some of his or her statements that the poster is somewhere in the novice category. So a bunch of this article is going to remain high level.
So let's start
What is the application going to do? (I'll reread the question again...)
- user signup and login (personalization!)
- user profile (so we can get to know them just like FB)
- make posts (what did you have for breakfast?)
- view posts (everything is public for now)
special sauce(we'll come up with this later)- use "standard practices"
This list by itself is the basics. This list is also potentially huge. Where do we even begin? Just based on this list we know a few things. It's going to be some kind of client-server application. Although it might be fun to come up with a peer-to-peer social-network application... that might get kind of weird and non-traditional. So before we get too far, we need to pick a client and a server. I know you might not care about that and just want to start building the application, but we're building this mythical company from the ground up and somebody needs to decide.
Client platform
Android. That's what the question was tagged as so that's what we'll use. We could just make this a web application that renders superbly on mobile, but true client applications still (as of this writing) seem to have a quicker, more natural response.
Server platform
This could be anything really but we have to narrow it down somehow. Since I'm most familiar with Java, we'll stick with that (yes, .Net is a great platform, but we have to narrow the field somehow). Even after we've selected Java there are still several choice we have to make as we'll soon see. First, are we going the "traditional" Java EE route using the Java language or when I said "Java" above did you read that as "anything-that-runs-on-the-Java-JVM"? If the latter, then there are even more choices of language: Groovy/Grails, JRuby, Scala, etc. For now let's stick with standard JavaEE.
Hosting
Are we going to host this on our own servers (either in-house or remote)? If not, we can host this in the cloud on Google App Engine, Amazon EC2, VMware vCloud, Rackspace Cloud, Red Hat Cloud, or probably a dozen others. Most of the choices here will be compatible enough with how we're going to build this application that it almost doesn't matter. Note: Google App Engine is going to be the most different from the rest listed above, but for argument's sake we'll design our application such that it will work almost the same there. There will no doubt be some economic impact, but we have a lot of mythical dollars so we'll ignore cost. For now let's just say we'll use some generic cloud provider simply because I don't want to buy the hardware myself.
Application Server
What Java EE application server are we going to use? I know you probably have your favorite, and for very good reasons. I have a favorite also. Just pick one out of the following list (they're listed in alphabetical order to avoid personal bias): Geronimo, GlassFish, JBoss, Jetty, Tomcat, WebSphere, probably a bunch of others, too. There are a lot of choices here but just like the hosting, it almost doesn't matter. Sure, one of them is going to perform better than another one, but if we write our application correctly we won't be tied to any particular app server (maybe just one or two config files different.) Another note: if you picked Google App Engine from the previous paragraph, you don't need to select which Java EE app server.
Database
What database are we going to use? The original poster tagged the question with "mysqlite" but may have conflated SQLite (for Android) and mysql into one. For on-device storage for the Android client portion of our app, we'll of course use SQLite, but on the server we could use anything. MySQL, Oracle, SQLServer, Postgress, DB2, HSQLDB, CouchDB, MongoDB, Amazon SimpleDB, etc. Seriously the list is too huge and there are a lot I'm leaving out unintentionally, except for Sybase which I'm leaving out intentionally, but don't ask me why, it's personal. A big choice here is whether to use a "traditional" relational database, or a non-relational one.
What's next?
See Also
For additional reading: Teach Yourself Programming in Ten Years