Posts Tagged ‘framework’

JavaScript MVC Part 1 – Steal.js

October 3rd, 2011

Far Jantrakool

Since switching over to JavaScriptMVC is a big change for us, we're breaking things down into small tasks, the first being StealJS.

It’s difficult to maintain good structure when developing JavaScript. As our team grows so does our code base, becoming larger and more unwieldy. Code gets everywhere: the bottom of the template (tricky to debug), inline, in a giant script.js file (sound familiar?) or scattered across many different files which take long to load and are hard to keep track of.

So we came up with a wish list in the name of better JavaScript structure and framework.

(more…)

Data Storage Layer in Zend Framework (Part 1)

August 29th, 2011

Pieter de Zwart

Think of data storage as a series of layers in a delicious multi-layer dip.

You have to hand it to Zend. Their Framework lets developers build solid LAMP applications with all kinds of useful, out-of-the-box support for RESTful servers, plugging into Lucene, handling LDAP interactions, and even interacting with Windows Azure! Yes! Windows Azure! Something I didn’t even know existed until I browsed Zend’s API docs. I wonder how much Microsoft paid them to include that package…

Anyway, back to the topic at hand. Storing things. In places. With stuff.

Your average web application generally starts off with a basic database back-end like MySQL orPostgreSQL. That works, for a while—until the database starts sweating under load because you are so awesome and successful that your website pulls in a million hits a minute. Reads begin to far exceed writes at the database level. And for most of the time, you’re looking objects with their primary keys, like user or blog post IDs. This means you have an opportunity to relieve the load on your database database (all these dumb ID lookups), and instead let it do what it does best: store, manage and query complex relational data in an atomic and transactional fashion.

Relieving this load is as simple as putting a caching mechanism in front of the database that can, given an entity type and ID, quickly spit out corresponding objects. A good caching system will actually return data much faster than a database, since the data is all stored in memory and built to handle this (and only this) scenario.

At least it should be this simple, in theory.

(more…)