Install this theme
New Website

finally starting to get my act in gear. put up an almost-finished new website. it’s broken in ie8, and i will eventually figure that part out, but it looks not horrible in chrome or firefox. 

anyway, this is where i warn you that this entry is about to go completely nerdy. those not interested in extremely technical bits, you may want to get on to your next thing. 

so the new site was developed using the awesome play framework. i’ve been a java developer for over 15 years and well, there’s a considerable amount of time where i really hate java. especially in the building of web applications. java typically requires the typical web application to incorporate so much dang configuration and moving parts that you spend 90% of your time fighting with the system just to make all those moving parts move in harmony. i originally started out building this using ruby on rails, and was nearly done with it, and i really enjoy working in ruby. but about four or five months ago i stumbled across play. it basically took the entire java “ee” playbook and ripped it in half and then set fire to it. play actually makes working in java fun again. no more endless configurations, fighting with unruly application servers and ridiculously tedious and labor intensive deployment processes. nope, play is like ruby, but you get the scalability of the JVM (java virtual machine) underneath. oh yeah, and with play, working with it is like ruby or php or python. you make a change to code, no stopping/starting a server. play uses code recompilation behind the scenes. you never know it’s happening. how lovely is that?

so anyway, the site has a very light-weight “content management system” to manage the pages. basically i define the pages using a very simple XML scheme (i started out using YAML, but i wanted to use the Markdown syntax engine, and YAML cares so much about whitespace, i had to ditch it. i could have made it work but i didn’t want to spend the time screwing with the either the parsing of YAML or the parsing of markdown, so I went with XML.) 

each page is defined in XML, and when the application starts up it reads each XML file and converts it into a java model, then inserts that into the database. now the database is MongoDB. Mongo is a fantastic “nosql” database (meaning it isn’t a relational database, one that has a notion of tables, rows and columns.) i really don’t like relational databases. oh sure, they are very important for many other requirements, but driving a web site isn’t one of them. No instead Mongo uses the concept of “documents” where each record is a self-contained document, stored in the form of JSON. You can query on any “key” saved within your document, much like a relational database, but you are not wedded to a schema in Mongo. Meaning i can make changes to what the data “looks like” without even worrying about how the database will handle that change. Oh yeah and should SFB ever become a big deal, i can handle the scalability for “free” with Mongo. Horizontal scalability is wicked simple. it just works. setup another server, tell another server about it and poof… scalability acquired. Yes, Mongo has its faults. It isn’t perfect, but it is perfect for what i need. 

There is also a “background” job that runs, the content on the home page is actually sourced from here (tumblr.) basically what happens is, there’s a job that runs on the server every 2 hours that queries the tumblr API (basically a JSON web service) and pulls the latest content. The job queries the local database to see if it has a particular story, if not it inserts it into the database, if it already has it, it ignores the story.) I specifically did not want to write a whole administration application for the site mostly because, well, tumblr has a nice clean interface and an API. Why spend the time doing that when i can leverage what is already there? 

As for the front end, i used the 960 grid CSS framework. I’ve never used it before. i typically use Blueprint but wanted to try something different. I’m not 100% sold on 960 yet, but so far it seems okay. It’s easy to work with just like Blueprint, but like i said, there seems to be something odd with it in ie8. It may not be 960, it most likely is something i did, but the markup and CSS i used is very simple. So i have no idea right now. 

So that’s that. new website. i still need to do some more work on it. mostly filling out the content. that’ll come, i just needed to get a working version out there. my stupid single page deals just weren’t cutting it. 

 
  1. skyflyingby posted this
Blog comments powered by Disqus