• Home

  • Custom Ecommerce
  • Application Development
  • Database Consulting
  • Cloud Hosting
  • Systems Integration
  • Legacy Business Systems
  • Security & Compliance
  • GIS

  • Expertise

  • About Us
  • Our Team
  • Clients
  • Blog
  • Careers

  • VisionPort

  • Contact
  • Hidden inefficiencies in Interchange searching

    Jeff Boes

    By Jeff Boes
    August 13, 2012

    A very common, somewhat primitive approach to Interchange searching uses an approach like this:

    The search profile contains something along the lines of

      mv_search_type=db
      mv_search_file=products
      mv_column_op=rm
      mv_numeric=0
      mv_search_field=category
    
    [search-region]
      [item-list]
        [item-field description]
      [/item-list]
    [/search-region]

    In other words, we search the products table for rows whose column “category” matches an expression (with a single query), and we list all the matches (description only). However, this can be inefficient depending on your database implementation: the item-field tag issues a query every time it’s encountered, which you can see if you “tail” your database log. If your item-list contains many different columns from the search result, you’ll end up issuing many such queries:

    [item-list]
        [item-field description], [item-field weight], [item-field color],
        [item-field size], [item field ...]
      ...

    resulting in:

    SELECT description FROM products WHERE sku='ABC123'
    SELECT weight FROM products WHERE sku='ABC123'
    SELECT color FROM products WHERE sku='ABC123'
    SELECT size FROM products WHERE sku='ABC123'
    ... …

    interchange

    Rails 3 ActiveRecord caching bug ahoy!

    Brian Gadoury

    By Brian Gadoury
    August 2, 2012

    Sometimes bugs in other people’s code makes me think I might be crazy. I’m not talking Walter Sobchak gun-in-the-air-and-a-Pomeranian-in-a-cat-carrier crazy, but “I must be doing something incredibly wrong here” crazy. I recently ran into a Rails 3 ActiveRecord caching bug that made me feel this kind of crazy. Check out this pretty simple caching setup and the bug I encountered and tell me; Am I wrong?

    I have two models with a simple parent/child relationship defined with has_many and belongs_to ActiveRecord associations, respectively. Here are the pertinent bits of each:

    class MimeTypeCategory < ActiveRecord::Base
      # parent class
      has_many :mime_types
    
      def self.all
        Rails.cache.fetch("mime_type_categories") do
        MimeTypeCategory.find(:all, :include => :mime_types)
      end
    end
    
    class MimeType < ActiveRecord::Base
      # child class
      belongs_to :mime_type_category
    end

    Notice how in MimeTypeCategory.all, we are eager loading each MimeTypeCategory’s children MimeTypes because our app tends to use those MimeTypes any time we need a MimeTypeCategory. Then, we cache that entire data structure because it’s a good candidate for caching and we like our app to be fast. …


    ruby rails tips

    Postgres Open 2012

    David Christensen

    By David Christensen
    July 31, 2012

    I’m excited to be speaking at the 2012 Postgres Open Conference; Chicago, September 17-19. (Conference details at http://www.postgresopen.org/.)

    My talk will be “Choosing a Logical Replication System: Slony vs Bucardo”.

    I look forward to seeing many of you there!


    conference postgres

    Ruby on Rails software developer needed

    Jon Jensen

    By Jon Jensen
    July 31, 2012

    This position has been filled. See our active job listings here.

    We’re looking for another talented Ruby on Rails developer to consult with our clients and develop their Ruby on Rails web applications. If you like to focus on solving business problems and can take responsibility for getting a job done well without intensive oversight, please read on!

    End Point is a 17-year-old web consulting company based in New York city, with 28 full-time employees working mostly remotely from home offices. Our team is made up of strong ecommerce, database, and system administration talent, working together using ssh, Screen and tmux, IRC, Google+ Hangouts, Skype, and good old phones.

    We serve over 200 clients ranging from small family businesses to large corporations, using a variety of open source technologies including Ruby, Python, Perl, Git, PostgreSQL, MySQL, RHEL/​CentOS, Debian, and Ubuntu.

    What is in it for you?

    • Work from your home office
    • Flexible full-time work hours
    • Annual bonus opportunity
    • Health insurance benefit
    • 401(k) retirement savings plan
    • Ability to move without being tied to your job location

    What you will be doing:

    • Consult with clients to determine their web application needs
    • Build, test, release, and maintain web applications for our …

    jobs-closed rails

    Are you sure you want a MacBook Pro?

    Brian Buchalter

    By Brian Buchalter
    July 30, 2012

    The “UltraBooks” trend has been been made popular by Apple’s efforts at making the computer an appliance. There are clear benefits to this, but for enthusiasts, it means less control to upgrade to hardware of their choosing. Let’s contrast this experience with my own Dell Vostro 3500. It was purchased two years ago and yet through upgrades, it has many features the recently refreshed MacBook Pro with Retina display lacks, while offering the same processing power.

    MacBook Pro Advantages

    Let’s be clear, the MacBook Pro (MBP) has a number advantages over my Dell. The Retina display of course trounces my 1376×768 resolution on a 15" display. For designers, photographers, and video editors, Retina is a great asset. For someone who spends their day inside Vim and SSH, not so much. Similarly, the MBP’s seven hour battery life is impressive, although I’m sure with my processor intensive work load, it would be lower. But for me, I’m not terribly mobile. I need to be mobile from room to room perhaps, but I don’t find myself without power and needing to complete mission critical work less frequently than my replaceable 90 watt-hour battery can provide over 3 to 4 hours. Similarly, weight …


    linux mac hardware

    Interchange “on-the-fly” items

    Jeff Boes

    By Jeff Boes
    July 26, 2012

    Interchange has a handy feature (which, in my almost-seven-years of involvement, I’d not seen or suspected) allowing you to create an item “on-the-fly”, without requiring any updates to your products table. Here’s a recipe for making this work.

    First, you need to tell Interchange that you’re going to make use of this feature (in catalog.cfg).

    OnFly onfly

    Simple, no? The “OnFly” directive names a subroutine that is called to pre-process the custom item before it’s added to the cart. The default “onfly” routine can be found in the system tag “onfly”: code/SystemTag/onfly.coretag in the standard Interchange installation. (If you need more that what it provides, that’s beyond the scope of my post, so good luck, bon voyage, and please write back to let us know what you learned!)

    Then, you need to submit some special form parameters to set up the cart:

    • mv_order_item: the item number identifying this line
    • mv_order_fly: a structured string with | (vertical bar) delimiters. Each sub-field specifies something about the custom item, thus:
    description=My custom item|price=12.34

    Now, in my particular case, I was encapsulating an XML feed of products from another site (a parts supplier) so …


    ecommerce interchange json

    cPanel Exim false positive failure & restart fix

    Jon Jensen

    By Jon Jensen
    July 24, 2012

    I’m not a big fan of add-on graphical control panels for Linux such as cPanel, Webmin, Ensim, etc. They deviate from the distributor’s standard packages and locations for files, often simultaneously tightening security in various ways and weakening security practically by making several more remotely accessible administration logins.

    On one of the few servers we maintain that has cPanel on it, today we did a routine Red Hat Network update and reboot to load the latest RHEL 5 kernel, and all seemed to go well.

    However, within a few minutes we started getting emailed reports from the cPanel service monitor saying that the Exim mail server had failed and been restarted. These emails began coming in at roughly 5-minute intervals:

    Date: Tue, 24 Jul 2012 14:21:05 -0400
    From: cPanel ChkServd Service Monitor <cpanel@[SNIP]>
    To: [SNIP]
    Subject: exim on [SNIP] status: failed
    
    exim failed @ Tue Jul 24 14:21:04 2012. A restart was attempted automagically.
    
    Service Check Method:  [socket connect]
    
    Reason: TCP Transaction Log:
    << 220-[SNIP] ESMTP Exim 4.77 #2 Tue, 24 Jul 2012 14:21:04 -0400
    <<
    <<
    >> EHLO localhost
    << 250-[SNIP] Hello localhost.localdomain …

    hosting redhat sysadmin

    Automated VM cloning with PowerCLI

    Brian Buchalter

    By Brian Buchalter
    July 23, 2012

    Most small businesses cannot afford the high performance storage area networks (SANs) that make traditional redundancy options such high availability and fault tolerance possible. Despite this, the APIs available to administrators of virtualized infrastructure using direct attached storage (DAS) make it possible to recreate many of the benefits of high availability.

    High Availability on SAN vs DAS

    A single server failure in a virtualized environment can mean many applications and services can become unavailable simultaneously; for small organizations, this can be particularly damaging. High availability with SANs minimize the downtime of applications and services when a host fails by keeping virtual machine (VM) storage off the host and on the SAN. VMs on a failed host can then be automatically restarted on hosts with excess capacity. This of course requires SAN infrastructure to be highly redundant, adding to the already expensive and complex nature of SANs.

    Alternatively, direct attached storage (DAS) is very cost effective, performant, and well understood. By using software to automate the snapshot and cloning of VMs via traditional gigabit Ethernet from host to host, we can …


    hosting sysadmin virtualization
    Previous page • Page 137 of 222 • Next page