Decoupled Frontend

    Introduction

    MindTouch as it ships consists of two conceptual components: (1) the .NET API and (2) the PHP front-end. Over time, we've moved most of the business logic away from the PHP layer, which has had the benefit of reducing database connections. The end goal is to completely remove all database connections from PHP, which will allow deployments to set-up servers which only handle processing PHP front-end requests. (However, keeping the two levels separate may not necessarily yield performance gains, as the network/Apache overhead price may be high). This is mainly considered a "cleanup" item, which will help the development team by funneling all business logic through one entry point (API) and be consistent with the conceptual architecture of MindTouch.

    Since the Hayes release, we've removed almost all of the database connections from the front-end, but a couple ones remain.

    As a note, although the application will remove database dependencies, MindTouch's upgrade scripts are written in PHP, and will still require database updates.

    Purpose

    This document exists to outline the existing database connections, and the work involved in removing them.

    Intended Audience

    This spec is for PHP devs. 

    Status

    Just being documented. 

    Technical Specification

    There are three locations where database look-ups are still used heavily.

    1. includes/LinkCache.php - this keeps a cache of page titles with IDs and does a direct look-up against the pages table.
    2. includes/Title.php - Detection of whether an article exists throughout the PHP is done by the assumption that articleID > 0 (based on a page title). This does a direct DB call. An effort was made to convert this over earlier, but when a page is restricted, an ID is not returned, and the skin assumes the page does not exist
    3. includes/WatchedPages.php - Determines whether a page is watched or not through the db

    There are other locations where DB calls are still made, and I've made an initial pass at the clean-up in the attached patch file.

    Tag page

    Files 1

    FileVersionSizeModified 
    Viewing 3 of 3 comments: view all
    r. 15172 implements the low-risk changes into trunk
    Posted 16:42, 14 Jul 2009
    Is this a good place to also suggest deprecating PHPMailer and using the EmailService to send mail from now on?
    Posted 15:44, 19 Jul 2009
    yep!
    Posted 22:14, 26 Aug 2009
    Viewing 3 of 3 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by