Flux Architecture Introduction

From Flux Developer Portal

Jump to: navigation, search

Contents

flux Project Architecture Description

Overview

The flux Project is comprised of the following parts:

  • Primary Systems, such as: Database, Application Server, Web-nodes.
  • Supplementary systems, to carry out specific functions, such as: video decoding, content importing.
  • Supporting services to ease project maintenance: hourly build system with the follow-up unit test run, build & deployment system to staging/production environment, emergency/IIS logs parsing system.

The project is Windows platform based; it employs .Net Framefork, C#, and ASP.NET. Leading technologies, such as WCF (Web Services successor technology) and Atlas (ASP.NET based AJAX), have been incorporated into the project along the way, after thorough preliminary testing and trial.

Database

flux has following databases:

  • Pbt – contains data for Page building tools
  • UserProfile – users and community related information
  • ContentDiscovery – data produced by ‘Contentdiscovering’ system
  • Content – stores the whole content distributed among 4 servers (based upon the first symbol of the owner ucid)
  • Advertising – data for the banner system
  • Reporting – needed for report generation for the Think-site
  • Tracking – user activity in the system data
  • Searching – database for speeding up user- and content-related searches
  • PerformanceLog – performance-related data, such as one taken out of IIS web server logs
  • UrlMapping – resides in each of the Web nodes and contains url-binding information. Such data is used to support old-way content links.

Subsystems

There exist the following subsystems:

  • VideoEncoder – decodes video into FLV format. It uses external service AudibleMagic to check copyright for video and mp3.
  • ContentImporter – imports content from rss/atom-sources. It can be run as both a console application (for importing from sources specified in a configuration file) and a part of ‘RtxSupportService’ service (for importing from sources specified in the database).
  • SiteMapGenerator – generates sitemap for google search engine indexer.
  • RtxSupportService – a host service for the following subsystems:
    • ThumbnailImporter – generates snapshots of web pages
    • UICustomizator – provides for functioning of Community UI customizator (see below)
    • ContentImporter – imports content from rss/atom-sources. Takes the list of sources from DB.
    • StaticFileUploader – uploads static content unto static servers for the follow-up tweaking of a community’s look-and-feel.
    • fluxSharing – provides a possibility to post a flux-based content onto external communities.
  • IISLogParser – parses IIS logs into PerformanceLog database
  • Advertising – banner system, shows advertising banners on sites. It can use data both form database and 3rd-parties banner systems, as wished by the site owners. For instance, PCDmusic community on a number of pages uses 3rd party banners – as was requested by site owners, and the rest of the pages uses banners provided by information from the database.
  • CDN – content delivery network. A system, as its name implies, used for content delivery, such as video, music, thumbnails. It also performs: picture resizing, caching of the served content, etc.
  • CDN Upload – uploads content unto CDN servers
  • Tracking – tracks users’ activity on sites
  • PowerMTA – 3rd party system for sending of emails onto external email addresses. It uses files generated by a Messaging system
  • Widgets – are JavaScript scripts used by sites for embedding the desired functionality offered by flux. Such as: Login, Rating, Posts, etc.
  • Community UI Customizator – community customization system.

Main Parts of the Project

The following logical parts constitute the project:

  • Pbt – page building tools. It offers the site’s admin the possibility to create new – and edit the existing pages, allocate modules and edit their properties. Page modules are specially preprogrammed ASP.NET control elements which offer various types of functionality, such as: news feeds, video playback, advertising banner, discussions, picture gallery to name but a few. The modules are designed and developed by a flux developers team.
  • AdminSite – community administrator’s web interface
  • Css25 – provides the possibility for the site’s admin to edit a limited number of CSS styles in order to achieve desirable site’s look-and-feel [transl.]
  • FML – flux markup language. Allows users to create custom modules using a markup language that retrieves information from flux data sources (DataProviders). Later on, FML is translated into corresponding ASP.NET constructs.
  • Messaging – introduces messaging functionality into flux system. Sending of messages (emails) to external recipients is also possible: for that, Messaging is integrated with 3rd-party PowerMTA subsystem.
  • fluxApi – provides API for external users’ attempt to create their own site and not to use predefined functionality (Widgets). It is done in form of web services that mimick calls to controllers down in UILogic layer.
  • DataAccessApi – successor of fluxApi. It’s an HttpHandler that serves GET requests. Thus it is possible to cache requests’ results.

Project’s Architecture

The project is based on the N-layer architecture. Main logical layers are:

  • Data storage (Database)
  • Data access (DataLayer)
  • Business logic (Business layer)
  • Presentation logic (UILogic)
  • Presentation (UI)

Physically the above layers are grouped by tiers:

  • Data storage is conveyed on the dedicated servers with Ms Sql Server 2008
  • DataLayer and BusinessLayer are placed inside Application Layer servers
  • UiLogic and UI reside on a web nodes


Interaction between DataLayer and Database is achieved by ADO.NET. Interaction between UILogic and Application Server is done by WCF.

Data Access Layer

Data Access layer can be conceptually divided unto 2 main parts:

  • Kontiki – ORM part, does the mapping between database data entities and instances of classes in term of code.
  • DataLayer – contains classes which encapsulate the technicalities of data retrieval from the DB and offer the data in OOP-way to the Business Logic Layer.

The main concept of the Data Access Layer – is to rid programmers of the necessity to know the database implementation details and to provide access to the stored data in a way they familiar with – OOP entities. Data Access Layer enables to retrieve both specific objects (say, this specific user) and lists of objects (say, rss feed to be imported inside a given community).

As the data access layer is a base layer for the Business Logic Layer, the number of people, liable to alter its code, are limited to a minimum.

Business Logic

Business Logic (BL) layer is dedicated for implementation of business rules and requirements. Every data manipulation that the business implies must be implemented in this layer.

One can separate the following BL parts:

  • ActivityTracking – tracking the user activity
  • CDN – content delivery network
  • Content – business entity classes. E.g., User, Community, Category, Comment, Rating, etc.
  • Class factories
  • Location – allows to specify geo location. Includes: City, Country, State, Zip code, etc.
  • Messaging – on-site messaging system
  • Pbt – Pbt support on the BLL
  • Performance – measuring of AppLayer’s Wcf-services performance
  • Reports – opens access to various reports, such as regarding Ad-server, page views, etc.
  • Security – implementation of access to features separation based on role model.
  • Discovery – means of on-demand incorporation external content into the flux system.

Interaction between UILogic and BusinessLogic

Objects of BL layer are not used directly by the UILogic but rather are grouped on the provided functionality basis into sets of services which are located in the logical layer called Façade. Data transfer is done by employing specific objects called DTO (Data Transfer Objects). Such objects are practically void of methods and are used solely for data transfer purposes. These objects’ classes are made available both in the Business and UILogic layers by making the containing Assembly called ‘Interfaces’ physically accessible from both of layers.


UILogic

In order for the control elements not to re-create similar data retrieval logic from the Façade and follow-up processing, a specific layer, UILogic, is introduced. As such, it is a set of controllers that encapsulate data receipt/transfer to/from the Façade layer. Therefore the control elements and UI-level pages need only to serve for data presentation purposes plus reaction to the user’s actions. A controller may service a single page as well as (in case of common functionality implementation, say, getting the specific Community-related data) several pages or control elements of the UI layer.
UILogic layer also contains implementation of:

  • Pagination mechanism for lists of data
  • DataProviders – special hierarchical controllers’ structure used for data retrieval and processing that is used in Pbt mechanism
  • QuickMenu – implementation of quickmenu logic
  • StyleCustomization – UI-logic for css25.
  • FML – implementation of UI –logic for flux Markup Language. Represents classes that map FML markup into ASP.NET constructs.
  • DataAccessApi – UI-logic for DataAccessApi
  • a number of supplementary classes, such as fluxContextManager, LocationContext, etc.

UI

Presentation logic layer contains control elements (controls) and pages which are not PBT-created pages.


An example of layer interaction

A typical example of described layers’ interaction may be as such:

  1. A backend team creates an Interface which describes data that needs to be received from the database.
  2. This interface gets implemented as a Kontiki-subclass and also an implementation of the Active Record pattern.
  3. This class is instantiated inside ContentClassFactory.
  4. In the BL a class is created which implements all the required business logic including the manipulation of DL-layer objects.
  5. Business objects are instantiated via ClassFactory.
  6. Business objects are grouped by functionality into Façade’s services and are exposed for external usage (webUI, API) through WCF.
  7. UILogic processes the data gathered from the BL layer for presentation. Say, date’s formatting into a suiting form, strings encoding, etc.
  8. UI shows the received data

File:architectureintro.jpg

Personal tools
Toolbox