How to Build A Faster Scalable ECommerce Site

scale and performance ecommerce

Knowing how to build a fast scalable architecture that supports your ecommerce is as important as the products and content that you host.

How you build your ecommerce site is important to your online business success. You want your capacity to grow with your business, You want to be fast. You want to convert customers and have them complete their shopping cart checkout.

Slow sites can impact your sales, page views, conversions, bounce rate, search ranking and even result in abandoned shopping carts. If you can’t scale your operations then site performance and sales will suffer. In fact, a study by University of Nebraska-Lincoln found that most people won’t wait for more than two seconds for a web page to load.

There are dozens of ways to improve your ecommerce site scalability and performance. Here are just a few of the great ways to get you started.

First, write down some of the key metrics and features of your ecommerce site to get a baseline for your requirements:

  • Avg and peak visitors per day.
  • Avg number orders per day.
  • Peak orders per hour and per day.
  • Avg time users spend on your site.
  • Peak orders per hour and per day during the holiday season.
  • Your administration needs including number of admins and how often updating site content
  • How often does inventory get updated.
  • Number of unique SKUs/product records in your store.
  • Number of categories.
  • External vendor connections.
  • Now, with those key stats in mind, let’s look at how we can improve some of the main components of your ecommerce system. This way, we can make your site faster and more scalable.

    Images, JavaScript and CSS files

  • Keep file size as small as possible.
  • Optimize images for quality and size. Minify and compress JavaScript and CSS files.
  • Don’t load unneeded JS and CSS files.
  • Use a Content Delivery Network (CDN) to serve cached files from an external server that’s closer to users.
  • Btw, having your servers located closer to your users means less network distance for your data to travel …. which equals faster site performance.

    Web Server
    Web servers are typically sized based on the amount of traffic and users that you have on your site. The more users, the bigger the web server size. The more transactions, the bigger the web server size.

    Try to make as much of your site static and cached as possible. This is an important strategy to consider at the design stage. Inventory levels will change while at the same time you will want to balance the cached assets of your site with updated data. Look at how users use your site and then build out a solution that optimizes your site for their shopping behaviors . Consider using server side caching technologies like Varnish to cache static pages. If your using a PHP based app, use opcode caching technologies like APC.

    Your choice in web server and its configuration greatly impacts your site performance. Consider using Nginx as your web server since it is shown to be as much as 50% faster in some cases than the latest version of Apache server. It was built for asynchronous transactions and is very fast at serving up static pages.

    Product Search
    Searching your tables for product records can really slow down your website performance.
    Implement a search solution like SOLR or ElasticSearch to improve search functionality speed without overloading the database. This will delegate search processes to its own dedicated solution.

    The amount of product and user records in your database usually dictates how big your database server should be.
    To help improve performance, consider using caching technology like memcached or Redis .
    To keep things fresh, you can store queries in memory for a certain period. An example is Redis (“REmote DIctionary Server”)which is a key-value database that will store your data in memory. Another example is Memcache-d ” which is a general-purpose distributed memory caching system. Using these types of caching speeds up your dynamic assets by caching data and objects into memory. This will reduce the number of times an external data source (such as a database or API) needs to be read. More records means more memory.
    For example. you can store product information in Memcached to speed up your pages. Update and expire cached data to keep it current.

    Use Web Server Load Balancing
    Using a load balancer allows you to scale to multiple web servers on demand, transferring some of your traffic to other servers during peak usage. You can add or remove servers as needed. For example, Amazon Web Services allows this scaling process to be automated according to CPU load or any other number of monitored metrics.

    Managed Services
    Especially when you’re first starting off, don’t try to host everything yourself. Cloud services like Amazon Web Services allow you to focus more on building your business and less upon managing the upkeep of your infrastructure.

    When possible, use managed services. For example, AWS has managed databases, caching services, a Cloudfront CDN and Lambda micro services that sit outside your servers. By using any of these you will free up your application resources so that your site is much faster. Managed services help improve your site reliability and efficiency by freeing up system resources for other tasks. A CompTIA study published in CIO magazine found that improving the efficiency and reliability of IT operations was a main driving factor for many companies choosing to use managed services.

    Caching Behavior of Clients
    Where possible build your application so that the data will be cached on the client side. Use HTTP caching to keep files on your clients browser so that they don’t have to be transferred again from your server until the data is expired.

    Retrieve and Render Data After the Page Loads
    Consider using the Backbone.js library and/or Websockets to gather personalized data from your backend. The cool thing about this strategy is that your main web page is delivered immediately (possibly cached :)) while the personalized data is grabbed as needed after the client requests it and then the personalized section is rendered (after request) on the page. Using a framework like Angular.js or Ember.js are other examples of technologies that can help speed up your site. Both approaches can retrieve user personalized data as needed, like Backbone.js, and then render the page section after the initial main page has loaded.

    Securing your web pages is important to safeguard transactions and accounts. But don’t over do it by securing static public pages on your website (i.e.: terms, FAQ’s and blog posts). By practice, https requires additional steps and server overhead to handle the encryption and related extra assets. The additional time is very small but just make sure you keep it to a minimum by correctly optimizing your servers https configurations.

    External Vendors
    External vendors typically require access to/from your system via web calls. For instance, you may request a tax rate quote for a region via a REST service. The more asynchronous these calls can be the better. Reserve real time end-to-end API calls and responses for sales transactions. Try to unload as many non-realtime calls into your backend fulfillment process as possible. Use of queue processing with services running on RabbitMQ and/or SQS can help take the load off your server so that you can concentrate your resources on real time transactions.

    Monitoring and Updating
    Enhancements and changes to make things better are only as good as the process you have in place to make sure it works correctly.
    Monitoring and updating accordingly is as important as implementing these ideas in the first place.
    Use a monitoring application that keeps tabs on your vital e-commerce metrics as well as your backend system metrics. There’s plenty of tools and services out there that provide managed services. Some e-commerce platforms provide dashboards for many of the key metrics for you. If you have the technical resources, then you can even build your own integrated dashboards. For example, an ELK (Elasticsearch, Logstash and Kibana) stack implementation can be used to centralize all your logs into custom dashboard to display actionable metrics.

    Whatever your choice to improve your site performance, remember, your work is never complete. Many more blog posts can be written about other best practices that speed up and scale your ecommerce site. You can always make things faster and better. New technology, your code, user base, site use and software is always changing and will impact your performance and scaling needs. Changes like these will keep you on your toes while offering new opportunities for improvement on a daily basis.

    Posted on January 19, 2016 in my blog

    Share the Story

    About the Author

    Phil is a technology expert with 15+ years experience architecting and building web solutions. He started in digital agencies like PixelPark and Xceed and has worked in creating cutting-edge web solutions, including being an early technology adopter with live events such as Intel Music Festival. He was also the founder of All Media Interactive Group. He specializes in open source development using LAMP, iOS, Node.js, Java, PHP, Magento, and Drupal. At Citigroup/SmithBarney, he served as Development Lead and Tech Program Manager for the Applications Development Division and also headed up Applications Data Security as a certified CISSP for Smith Barney, leading architecture domains and creating standards and best practices for the Applications Development group. In addition, Phil has built integrated social media, informational and commerce database solutions from the ground up for the mobile and desktop platforms of Queen of Raw and Favoire. Phil served as a mentor at the Branson Centre for Entrepreneurship and was a Finalist for the $1M Verizon Powerful Answers Award and a Top 15 Fashion Tech Founders of the Future Finalist at New York Fashion Tech Forum.
    Back to Top