This will be my first series of post as I embark in trying to create a site based on Pinterest but using only Java. To be more precise Spring Framework.
What’s the motive? You can blame it on this video: “Scaling Pinterest” (http://www.youtube.com/watch?v=dSk-SWLJ2g0). After watching that video I was left wondering if you could apply the ideas that worked in a Java background. So with that in mind, I've grabbed my favorite Java framework “Spring-Framework” and started coding away.
The software stack that I would be using for this project would consist of:
Java 7
Spring Framework 4
Tomcat 8 or Netty
Fineagle
Redis
PostqreSQL 9.2
PGBouncer or PGPool
Apache Zookeper
Half the technology stack is a new for me so this will be quite educational. In the frontend I had decided to go with Netty for the web server part since non-blocking IO would be important, but Tomcat 8 will support also non-blocking IO so Tomcat still an option, I guess it would come down to the resource consumption once a stable release of Tomcat 8 is out.
Also most likely would go with the service oriented design, using Twitter’s Thrift to communicate the services with the web servers.
And for the backend would use Redis for caching and messaging, and a pool of PostgreSQL instances sharded and using PGBouncer or PGPool to manage the instances.
So the first part, is to have an application to scale. So the first part of this project would be to build an application, and from there we’ll scale it.
An example of an abstract base Spring MVC controller that implements REST methods and a class that subclasses it. CrudRepository is an interface from the Spring Data project. Direct link to code on gist.