The basic concepts of designing the new WebFusion

After one year of pause on developing WebFusion. I can look back and pick up some defects on the original design. When the defects in the design accumulated to an unacceptable rate, I decide to start it over with new one.

New WebFusion project codenamed odin, will use Clojure as the main programming language on server side. In the nearly one year work day with Clojure, I found its pretty and elegant syntax, functional programming can boost the development with clear expressions. Another reason I choose Clojure rather than other Lisp or FP languages is because I can make use of the code bases from old WebFusion when I want to. Another benefits I can take from JVM based programming language is that I can use tones of library that proven stable, high-performance and well documented.

Odin is fully distributed and event driven. That means the each components of odin can run on different servers in any number of processes and working threads. They use Remote Function Invocation from a project that I was created in my employed work time named cluster-connector to communicate with each other. The inner-interactive is event driven, which means odin will not open new thread pool for new users, it will dispatch tasks in one thread to make full use of it and with concurrency benefits. It works like a reactor to dispatch messages by using a project that based on Project Reactor named meltdown for asynchronous.

Odin also benefits from Clojure by using some language features like macro and multi-methods. Macro can make the compiler generate codes from your code, Which means you direct the compiler to do some heavy job to generate repeatedly code or your own DSL to replace complex syntax that should write in native form. And you can even generate macros from macros make works easier for humans. Multi-method is a feature that reflects object-oriented programming, but in a flexible way. It use a dispatch function to determinate the pathway of reaching the actual function rather than fixed class hierarchy. It dispatch to methods according to its parameter, allows me to configure the behavior for each analogous modules in files.

All of the design was tested separately, I am trying to put them together to make sure the system works as expected. The results are not sure, I will report in another article in this blog when it is done.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.