Mike Slinn

Functional and Non-Functional E-Commerce Requirements

Published 2021-02-02. Last modified 2022-10-26.
Time to read: 8 minutes.

This page is part of the posts collection, categorized under AWS, Azure, Django, Open Source, PostgreSQL, Python, e-commerce, nginx.

In a previous article, I described how I searched for an open-source shopping cart and the disappointing software options that I found. These searches yielded software projects that had begun 20 years ago and were generally of low quality.

The businesses that manage these projects use a failed business model for open source, namely software-as-a-service (SaaS), without much added value. The hosted products have not changed much since they were first established, and they have not kept up with the relentless advances in computer technology. Those businesses derive some additional revenue from customizing the open-source projects.

I decided to be more rigorous in my requirements analysis for a shopping cart with good coupon support so that I could find more suitable options. I now know that the cart must have:

  • Strong discount/coupon support.
  • Support for SKUs defined on-the-fly by customers as they interact with the website.
  • Integration with various payment processors.

Before I share my reviews of candidate shopping carts with you, let’s first discuss the state of the e-commerce market, functional and non-functional requirements, the master/detail pattern, and some technology trends for business software.

E-Commerce Is Hot, Hot, Hot

There are a huge number of e-commerce sites, and that market is experiencing strong growth in part due to the COVID-19 epidemic. E-commerce has entered Main Street, as per Geoffrey Moore’s technology adoption lifecycle.

Functional Requirements

Functional requirements describe what the system must or must not do, and can be thought of in terms of how the system responds to inputs. Functional requirements usually define if/then behaviors and include calculations, data input, and business processes.

Functional requirements are features that allow the system to function as intended. In other words, if the functional requirements are not met, the system will not work. Functional requirements are product features that focus on user requirements.

Functionally, a shopping cart is well understood, yet to be certain that a shopping cart actually works properly, test data and test procedures would need to be designed to verify that all the corner cases were exercised. That would be a significant amount of work to do properly, but at least the work would be rather straightforward.

Non-functional requirements (NFRs)

Non-functional requirements relate to user expectations and include security, reliability, performance, maintainability, scalability, and usability.

An NFR is a requirement that specifies criteria that can be used to judge the operation of a system, rather than specific behaviors.

The plan for implementing NFRs is detailed in the system architecture because they are usually architecturally significant requirements.

Broadly, functional requirements define what a system is supposed to do, and NFRs define how a system is supposed to be.

NFRs can be divided into two main categories:

  • Execution qualities, such as safety, security and usability, which are observable during operation (at run time).
  • Evolution qualities, such as testability, maintainability, extensibility and scalability, which are embodied in the static structure of the system.
 – Paraphrased excerpts from the Wikipedia article on NFRs

I need a shopping cart that has been properly tested, is flexible to configure, and is easy to use. These non-functional requirements are more important to me than the mechanics of how the cart was built or the technology that was used, especially for a proof of concept. In my reviews of shopping cart candidates, I will focus on how well they fulfill these NFRs.

I also want to use technology that is current, properly maintained, full-featured and has a future.

Master-Detail Structures, Interfaces and Reporting

Shopping carts are a classic example of a master-detail structure. The user interface of a shopping cart must exploit the master-detail paradigm effectively.

A master–detail relationship is a one-to-many type of relationship.

Examples of a master-detail relationship are:

  • A set of purchase orders and a set of line items belonging to each purchase order.
  • An expense report with a set of expense line items or a department with a list of employees belonging to it.

An application can use this master-detail relationship to enable users to navigate through the purchase order data and see the detail data for line items only related to the master purchase order selected.

 – From the Wikipedia article on master/detail data models

In the book SAP BusinessObjects BI 4.0 The Complete Reference 3/E, authors Cindi Howson and Elizabeth Newbould provide this rather abstract definition of master/detail reports:

A master/detail report is a particular kind of report in which a dimension value (master) is used to group data (detail) into separate sections. Master/detail reports allow you to analyze and format data for each unique master data value.

Page 13 of Oracle® Performance Tuning for 10gR2, Second Edition by Gavin JT Powell has a more concrete definition:

First normal form removes repetition by creating one-to-many relationships. Data repeated many times in one entity is removed to a subset entity, which becomes the container for the removed repeating data. Each row in the subset entity will contain a single reference to each row in the original entity. The original entity will then contain only nonduplicated data. This one-to-many relationship is commonly known as a master-detail relationship, where repeating columns are removed to a new entity. The new entity gets a primary key consisting of a composite of the primary key in the master entity and a unique identifier (within each master primary key) on the detail entity.

Master-detail is such a common architectural pattern that most business software vendors provide support for it. Other vendors include IBM, Oracle, Salesforce, and Microsoft. Apple’s iPad is used as a client for master-detail applications so often that the iOS SDK even provides a Master-Detail Application template. The master/detail pattern for Google Android applications can be implemented using the Material Design visual language.

Master-Detail Frameworks

Shopping carts must have engaging and effective implementations for master/detail patterns throughout: in the user interface, in the design of reports, in the data structures, in the types of software modules and their interfaces to each other, and in the internal data flow. The best-known web framework explicitly designed to support the master/detail pattern is Ruby on Rails. Of course, many other web frameworks can support master/detail.


Web Servers

Web servers are usually placed in front of e-commerce servers for scalability and security reasons. Netcraft has been reporting on web server deployments since 1995. The Netcraft January 2021 Web Server Survey shows some interesting trends.

Web server developer market share by server type.<br />Apache <code>httpd</code> is losing ground, as developers move to Microsoft and nginx.
Web server developer market share by server type.
Apache httpd is losing ground, as developers move to Microsoft and nginx.
For the busiest 1 million websites, Microsoft has taken the lead.
For the busiest 1 million websites, Microsoft has taken the lead.

Microsoft’s ASP.NET web framework is free, and web hosting is free (to a point), but those enticements fulfill their purpose by locking in customers to Microsoft's software stack and tools. The nopCommerce e-commerce server is free, very capable, and has enjoyed terrific adoption. This technology might be a good business decision for e-commerce sites that have typical requirements, but not if significant customization or integration with non-Microsoft services becomes important. This article was written by an experienced developer: I rebuilt the same web API using Express, Flask, and ASP.NET. Here’s what I found.

Computer Languages

Of all computer languages, Python has arguably the most momentum at present. Ruby on Rails is terrific, but its market share has dropped dramatically since 2011, and without that framework, the Ruby language would probably be much less important than it is. Python has been growing in all directions for a very long time. Microsoft’s C# language, which requires a .NET compatible runtime, is also popular but has never had the momentum that Python has.

The following graph compares the popularity of the Python Django library for making web applications against the popularity of the Ruby on Rails framework for the time period 2009 to the present day. As you can see, in 2011, Ruby on Rails was at its peak popularity; at that time, it was 300% more popular than Django. Now the situation is reversed: today, Django is 400% more popular than Ruby on Rails.

The one thing about Python that I like better than all other languages is the “batteries included” feature-driven approach. This means that Python projects can aspire to more ambitious goals for a given amount of programmer effort as compared to projects implemented in other languages. That was a significant factor in my decision to focus on Python-powered semi-custom shopping carts instead of investigating shopping carts programmed with other computer languages. Ruby on Rails would doubtless provide an excellent foundation for shopping carts, but I think Python is a better strategic choice for me at now in the world of open source.

This is not a decision I would have made in years past. Python's runtime consumes a lot more electrical power than the runtimes of other computer languages. However, Python 3.11 is 25% faster than previus versions. As available computing power continues to grow year-on-year within devices everywhere, the “Python runtime tax” has become much easier to bear.

Beyond Open Source

Most open-source software suffers from limited funding and conflicts of interest. This seriously impacts long-term viability. I am happy to consider all appropriate technology, and I am not fixated on open-source options. Two major technical components need to be considered:

  • E-commerce framework: this dictates the computer language and runtime library.
  • Database: the e-commerce framework often dictates the choice of database.

Monolithic vs Serverless Architectures

Modular Yet Monolithic Architectures

Monoliths on Easter Island
Monoliths on Easter Island

Traditionally, software has been built by first constructing functional modules, then combining the modules into a complete program (the monolith). For e-commerce, entire programs are deployed to production by adding configuration information and integrating with external services, such as payment processors.

This works well; however, the result is a centralized computing resource that has a fixed capability and resource requirements. The expense of operating the software does not change much, regardless of the traffic volume.

To handle periods of heavy traffic, complex mechanisms are required to scale up transactional capacity. Conversely, during periods of light traffic, the minimum cost to maintain the system in an operational state can be significant, especially for a startup company.

Serverless Architecture

One of the big architectural advances recently has been the introduction of serverless computing. It provides near-infinite scalability without paying for unused resources. CloudFlare has a good definition:

Serverless computing is a method of providing backend services on an as-needed basis. A serverless provider allows users to write and deploy code without worrying about the underlying infrastructure. A company that gets backend services from a serverless vendor is charged based on their computation and does not have to reserve and pay for a fixed amount of bandwidth or number of servers, as the service is auto-scaling. Note that despite the name serverless, physical servers are still used, but developers do not need to be aware of them.

Vendors that provide serverless computing platforms include AWS Lambda, Azure Functions, CloudFlare Workers, Google Cloud Functions

The Serverless Framework is a language- and platform-agnostic framework. Languages supported include Node.js, Python, Java, Go, C#, Ruby, Swift, Kotlin, PHP, Scala, & F#. Platforms supported include Alibaba Cloud, AWS, Microsoft Azure, Fn Project, Google Cloud Platform, Apache OpenWhisk, CloudFlare Workers, Knative, Kubeless, Spotinst and Tencent Cloud. The GitHub project has the code.

Responsive Web Pages

Responsive web pages alter their layout and appearance to suit different screen widths and resolutions. Many of the shopping carts I looked at did not support responsive web pages.

Next: Check Out Django Shopping Carts

Python, and therefore Django, is winning. I admit that I like the Django slogan: “Django – The web framework for perfectionists with deadlines”. When an option dominates the competition, you would need an exceptional reason to consider other options. My functional and non-functional requirements are mainstream, so next I will check out the leading option: Django.

* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.