We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18654
    • 191 Posts
    Quote from: BobRay at Feb 12, 2010, 11:23 PM

    Your approach sounds reasonable as long as the total number of blog posts + comments doesn’t get too large. At some point, things will start to slow down.

    Thanks for your input Bob - a couple follow up questions:

    How many posts do you think it would take before a significant slow down occurs?

    How does Wordpress handle this issue (slowdown with lots of comments) given that comments load right into their directory structure in the same way they would be loading into the ModX directory structure with the above proposed strategy?.

    What do you think about possibly using a hybrid approach wherein I would write my own code for front-end processing, and then write directly to the Quip custom table, allowing the use of Quip as a backend manager while still maintaining full control over the front-end? (Ideally I’d like to write my own backend manager using my own custom tables, but I’m not quite there yet in terms of coding skill / familiarity with the system.)

    -matt
      God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
      • 3749
      • 24,544 Posts
      On the number of documents, it’s hard to say since it depends on the server and how you manage the cache. Common wisdom is that trouble starts around 5,000 documents, but I’ve never had enough myself to be a problem.

      I’m not familiar with Quip or WP internals so I’m no help there.

      OpenGeek is a fan of custom DB tables for this kind of thing that just hold the necessary data (modx documents have a lot of overhead that you don’t need to duplicate for every post or comment). He also advocates a custom caching system that’s tailored to your application. He could explain it much better than I could.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: BobRay at Feb 13, 2010, 12:07 AM

        On the number of documents, it’s hard to say since it depends on the server and how you manage the cache. Common wisdom is that trouble starts around 5,000 documents, but I’ve never had enough myself to be a problem.

        I’m not familiar with Quip or WP internals so I’m no help there.

        OpenGeek is a fan of custom DB tables for this kind of thing that just hold the necessary data (modx documents have a lot of overhead that you don’t need to duplicate for every post or comment). He also advocates a custom caching system that’s tailored to your application. He could explain it much better than I could.
        Again, my rule of thumb is any content that is presented in the same way and has a quantity in the 100’s should be modeled using custom data tables. PHP is designed to present dynamic views of such data, and sure, you can cheat by treating every piece of content you have as an actual Resource, but this transfers the overhead of a single dynamic view to your entire web site.

        WP does this very well when used as a blog; it does not treat each post as a view in the system; rather the views are pulled on demand and dynamically rendered into a few distinct views as individual posts (one view), a summary of posts by dates (various additional views), or by tags/categories (a few more views), or as RSS (another view), etc. This allows your blog to scale, even if you have 1000’s of posts and/or comments. By creating a blogging system like this within the MODx framework, it too can scale in the same way (or even better by taking advantage of the almost limitless caching capabilities available in Revo).

        I’m not saying you can’t create a minimalist blog by posting some Resources and summarizing them, in fact I’m constructing my own personal blog that way. But I’m not a prolific poster either, and will likely never reach 100 posts. If I do become prolific for some odd reason, I’ll be developing an add-on component for blogging as I described.

        Quote from: mattcdavis1 at Feb 12, 2010, 10:02 PM

        Also, are there built-in modx functions for making user input database safe? And for escaping output (neutralizing any javascript / html characters)? Or do we just use native php functions for this?

        For example, I know with Zend I can use $this->escape($output) for displaying content and for inserting data to DB, nearly all input is automatically made DB safe using the insert method of the Zend_Db object.
        All xPDO API calls (and thus all modX API calls) use PDO prepared statements, which automatically handle user input escaping. You can manually escape input using PDO’s quote() method as well, but it is recommended to always use prepared statements.
          • 18654
          • 191 Posts
          Thanks for the response OpenGeek. I think I’m going to use quip for the backend management of posts, but write my own code for the front end. So I’ll instantiate the Quip class:

          $quip = new Quip($modx,'web');
          


          This will allow me to create xPDO objects that write to the quip custom table, but then I’m going to comment-out the initialize method:

          //return $quip->initialize($scriptProperties['context']);
          


          so that I can have total control over the front end code / logic. I’m still working on learning how to implement custom database tables on my own as well as customizing the manager section. So I think this hybrid approach will be a good way to go until I gain more knowledge / skill in these other areas.

          -matt
            God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.