Green Button – 30 Day Free Trial

Blog

Strands Dashboards gets speedy with Django

django logoThe Recommender Dashboard is the web portal where our customers take control over the recommendation engine. The dashboard is the key to controlling both the personalization services offered as well as the main tool and guide for the final integration of our products to your site.

During the past year’s development cycles, the recommender has been boosted with some important improvements. We managed to bypass some architectural snags and in doing so focused these improvements on performance and functionality.

The Dashboard was programmed in Java with a custom framework based on common technologies like Struts, Spring and Hibernate.  It was definitely robust but  limited our development speed with tedious configuration and compilation steps.

These arguments, coupled with the fact that the Dashboard is not a time-critical application (where high performance is not the determining factor), were the reason why we decided to review the system’s infrastructure.

The final decision was to progressively migrate to Django, a web framework written in Python.

Why Django then?

The main reason was speed. With Django you can change the code and see the changes reflect immediately in the application while skipping the build and redeploy phases.

Another important reason was the data model. An existing model in our storage system was already in place so that the chosen framework would re-link to programming objectives in an easy way.

In Django all you need to do is define a class and then indicate the table within the database where the objectives of the class will live together. Include the column name for each attribute and you are done.

But further tuning is possible. Foreign table constraints can for instance be included and Django and will transparently retrieve the linked objects whenever the parent is requested. And requesting is also easy: Customer.objects.get(id = someid) will load a customer object, and customer. Save() will store it back after modification. Say goodbye to the tedious SQL statements!

The framework is arranged as a set of middleware classes that wrap the request/response processing and can add functionality both before or after serving.  Session management, authentication or internationalizations are some examples of the functionalities available out of the box.

Transactions are another complex issue that Django makes easy for us again. You just need to add a single line of code to the main configuration file to activate the transaction middleware and you are ready to go. The default behavior for Django from then on will be to start a transaction when the http request arrives and will then commit it if the response is produced without problems. Automatic rollback will happen if any errors occurred.

The language itself, Python, has cool characteristics as well. Its syntax forces the developer to write clean and structured code, making it easier to maintain and evolve, its dynamic nature greatly speeds up the prototyping and deployment phases and its standard library comes well suited for the web tasks at hand.

The result has been that  we can now  quickly change our Dashboard and therefore have more time to focus on the usability of the site and the happiness of our customers.

Figure1:

New page of the dashboard for creating new logics. A pop-up for entering the name and the logic description will appear when click on “create new logic” tab on the dashboard.


Figure2:

New page of the dashboard for creating new logics: The recommendations can be obtained based on the community behavior (what other users have purchased, visited, clicked,..), on properties of the products and catalog metadata. Our customers can create rules to filter the results of the recommender, according to store/website merchandising strategy.

Figure3:

The look and feel of the widgets can also be customized. Once the logic is defined, our customers can configure the content and layout of the widget, as well as the colours, widget title, and resolution. The template created (logics+widgets) can be included at the different pages of the site.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

WP-SpamFree by Pole Position Marketing