

# Architecture patterns for modern, microservice-based MES
<a name="mes-patterns"></a>

To unlock valuable insight, infer patterns, predict events, and automate manual processes such as quality inspection and data collection, MES can use cloud-native technologies such as the Industrial Internet of Things (IIoT), AI/ML, and digital twins. Some of the most common use cases and their architecture patterns are discussed in the following sections:
+ [Industrial edge computing](edge.md)
+ [IIoT](iiot.md)
+ [Interface with other enterprise applications](enterprise-interface.md)
+ [AI/ML](ai-ml.md)
+ [Data and analytics](data-analytics.md)
+ [Containers for computing](containers.md)

For more information about the microservices that these architectures include, see the [Decomposing MES into microservices](decomposing.md) section later in this guide.

# Industrial edge computing
<a name="edge"></a>

MES is critical to manufacturing operations. Some microservices or functionalities within MES require low latency and cannot tolerate intermittent connectivity to the cloud. These microservices are better suited to run on premises. [AWS edge services](https://aws.amazon.com/edge/) extend infrastructure, services, APIs, and tools offered in the cloud to an on-premises data center or co-location space. AWS services for the edge are available for infrastructure, storage, content delivery, rugged and disconnected edge, robotics, machine learning, and IoT.

## Architecture
<a name="edge-architecture"></a>

Many MES transactions are latency-sensitive. One of the examples cited later in this guide is the production execution service. One of the functions of the production execution service is to guide the flow of work-in-progress goods. Because this is a sensitive activity, the tolerance for latency could be low, and manufacturers might need an on-premises component of this microservice.

Here is the sample architecture for this use case.

![\[MES architecture for industrial edge computing use cases\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/industrial-edge-computing.png)


1. Amazon Elastic Kubernetes Service (Amazon EKS) for computing and Amazon Relational Database Service (Amazon RDS) for databases are hosted locally in AWS Outposts. You can also use self-managed hardware to host edge components. Some features, such as Amazon EKS Anywhere, can be used for self-managed hardware as well.

1. The edge component of these services can sync with the cloud component through an Amazon API Gateway endpoint between two container instances.

   Another option is to set up a service bus between the two container instances to keep them in sync. You can use Amazon Managed Streaming for Apache Kafka (Amazon MSK) to set up such service buses.

1. Manufacturers can use the cloud components of microservices to process cases that are less sensitive to latency, such as sending updates to a PLM system for process improvement, sending confirmations to an ERP system for production, and exporting data to a data lake for reporting and analytics. Because of the cloud's economics, scale, and disaster recovery benefits, manufacturers can store data for extended periods in cloud instances of the microservice.

# Industrial Internet of Things (IIoT)
<a name="iiot"></a>

Typical manufacturing facilities have thousands of sensors and devices that generate a lot of data. Most of this data goes unused. MES can contextualize this data and make it usable with the help of cloud-native services. MES can also connect with machines and devices, collect information automatically—for example, from process parameters and test results—and use it to respond in real time to events, save time, and eliminate the possibility of error due to manual entry. For example, you could collect results from testing machines, determine the product quality, and create non-conformance records or secondary inspection workflows in an automated manner without any manual data entry. Over time, cloud-native IoT services can help find specific patterns and root causes for defects, and you can prevent the defects from occurring by modifying the manufacturing process.

AWS offers a broad and deep range of solutions for unlocking your IoT data and accelerating business results. These solutions include [AWS Partner solutions](https://aws.amazon.com/iot/partner-solutions/) and [AWS services](https://aws.amazon.com/iot/), which are the building blocks for the architecture based on customers' unique needs. The AWS IoT services that you can include in your architecture as building blocks include the following:
+ [AWS IoT Greengrass](https://aws.amazon.com/greengrass/) is an IoT open source edge runtime and cloud service that helps you build, deploy, and manage device software. The edge runtime or client software runs on premises and is compatible with various hardware. It enables local processing, messaging, data management, and ML inference, and offers pre-built components to accelerate application development. AWS IoT Greengrass can exchange data with the edge component of MES for latency-sensitive use cases.
+ [AWS IoT Core](https://aws.amazon.com/iot-core/) is a managed cloud platform that lets connected devices interact with cloud applications and other devices easily and securely. AWS IoT Core can support billions of devices and trillions of messages reliably and securely, and can process and route those messages to AWS endpoints and other devices. When you use AWS IoT Core, your applications can keep track of, and communicate with, all your devices all the time, even when they aren't connected.
+ [AWS IoT SiteWise](https://aws.amazon.com/iot-sitewise/) is a managed service that enables industrial enterprises to collect, store, organize, and visualize thousands of sensor data streams across multiple industrial facilities. AWS IoT SiteWise includes software that runs on a gateway device that sits on site in a facility, continuously collects the data from historians or specialized industrial services, and sends it to the cloud. You can further analyze this collected data in the cloud and use it for dashboarding or feed it to MES for responses to results and trends.

## Architecture
<a name="iiot-architecture"></a>

A typical IoT data ingestion and processing architecture can take many shapes based on unique environmental factors. The most common use case is to collect data from machines on the local network and securely send this data to the cloud. Here is the sample architecture for this use case.

![\[MES architecture for IIoT use cases\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/iiot.png)


1. Machine or data source: These could be smart machines that are connected to the network and can share the data on their own, or other data sources such as PLCs and historians. The data coming from these sources can be in different protocols, such as MQTT and OPC-UA.

1. AWS IoT Greengrass is installed on a Greengrass core device with components that collect data from data sources and send it to the cloud.

1. Data in the MQTT protocol goes to AWS IoT Core. AWS IoT Core further redirects this data based on the rules that are configured.

1. Data in the OPC-UA protocol goes to AWS IoT SiteWise. Organizations can visualize this data by using the AWS IoT SiteWise portal. The data is fed to AWS IoT Core and eventually to a data lake for contextualization and to combine it with data from other systems.

1. Amazon Kinesis streams the data from AWS IoT Core to store it. AWS IoT Core has a feature [rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html) that gives it the ability to interact with other AWS services.

1. An Amazon Timestream database stores the data. This is just an example—you can use any other type of database depending on the nature of the data.

1. Amazon EKS manages the availability and scalability of the Kubernetes control plane nodes within the microservice.

1. You can feed the data that's ingested from machines and other operational technology (OT) data sources to a data lake.

# Interface with other enterprise applications
<a name="enterprise-interface"></a>

Because MES sits at the edge of operational technology (OT) and information technology (IT), it must interact with enterprise applications and OT data sources. Depending on the organizational solution landscape, MES can interact with ERP to get production and purchase order information, master data about parts and products, inventory availability, and bill of materials. MES would also report back to ERP for the status of orders, actual material and labor consumption during production, and machine status. If PLM is present, MES can interact with it to get a detailed bill of process (BOP), work instructions, and, in some cases, the bill of materials (BOM). MES would also report to PLM about process execution information, non-conformances, and BOM variations.

## Architecture
<a name="enterprise-interface-architecture"></a>

Considering the wide variety of PLM and ERP systems, the design for this pattern varies, based on the systems MES interacts with. The following diagram illustrates a sample architecture.

![\[MES architecture for interfacing with other enterprise applications\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/interface-erp-plm.png)


1. Organizations might have ERP instances in the AWS Cloud or elsewhere.

1. As with ERP, a PLM system could be in the AWS Cloud or elsewhere.

1. Organizations can import data from ERP and PLM to an Amazon Simple Storage Service (Amazon S3) bucket. If those systems are hosted in the AWS Cloud, the file vault might be another S3 bucket and can be replicated for MES. Another way to connect to those applications is through the API by using Amazon API Gateway.

1. Regardless of how organizations import the data from ERP and PLM, an AWS Lambda function can process the received information and route the data to microservice databases, because the ERP and PLM interfaces and this type of data processing are primarily event-driven.

# Artificial intelligence and machine learning (AI/ML)
<a name="ai-ml"></a>

By using artificial intelligence (AI) and machine learning (ML) on data that's generated by MES, machines, devices, sensors, and other systems, you can optimize your manufacturing operations and gain competitive advantages for your business. AI/ML transforms the data into insights that you can use proactively to optimize manufacturing processes, enable predictive maintenance of machines, monitor quality, and automate inspection and testing. AWS has comprehensive [AI/ML services](https://aws.amazon.com/machine-learning/) for all skill levels. The AWS approach to machine learning includes three layers. In time, most organizations that have significant technology capability will use all three.
+ The bottom layer consists of frameworks and infrastructure for ML experts and practitioners.
+ The middle layer provides ML services for data scientists and developers.
+ The top layers are AI services that mimic human cognition, for users who don't want to build ML models.

Here are some of the prominent AWS ML services for industrials:
+ [Amazon SageMaker AI](https://aws.amazon.com/sagemaker/) is a fully managed service to prepare data and build, train, and deploy ML models for any use case with fully managed infrastructure, tools, and workflows.
+ [AWS Panorama](https://aws.amazon.com/panorama/) provides an ML appliance and SDK that add computer vision (CV) to your on-premises cameras to make automated predictions with high accuracy and low latency. With AWS Panorama, you can use computer power at the edge (without requiring video to be streamed to the cloud) to improve your operations. AWS Panorama automates monitoring and visual inspection tasks such as evaluating manufacturing quality, finding bottlenecks in industrial processes, and assessing worker safety within your facilities. You can feed the results of these automated tasks through AWS Panorama to MES and to your enterprise applications for process improvements, quality inspection planning, and as-built records.
**End of support notice**  
On May 31, 2026, AWS will end support for AWS Panorama. After May 31, 2026, you will no longer be able to access the AWS Panorama console or AWS Panorama resources. For more information, see [AWS Panorama end of support](https://docs.aws.amazon.com/panorama/latest/dev/panorama-end-of-support.html).

## Architecture
<a name="ai-ml-architecture"></a>

In manufacturing quality management, automated quality inspection is one of the most popular use cases for computer vision and machine learning. Manufacturers can place a camera at a location such as a conveyor belt, mixer chute, packaging station, stock room, or laboratory to get visuals. The camera can provide a good-quality picture of visual defects or anomalies, help manufacturers perform inspections of up to 100 percent of all parts or products with improved inspection accuracy, and unlock insight for further improvements. The following diagram shows a typical architecture for automated quality inspection.

![\[MES architecture for AI/ML use cases\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/ai-ml.png)


1. A camera that is capable of communicating on the network shares the image.

1. AWS IoT Greengrass is hosted locally and provides a component to infer any anomalies in the image.

1. The quality management edge service processes the result of the inference output from the previous step locally, for latency-sensitive use cases. AWS Outposts hosts the computing and database resources. Manufacturers can extend this component architecture to send alerts or messages to stakeholders based on the inference results. Manufacturers can also use other compatible third-party hardware to host services at edge.

1. The edge component of these services can sync with the cloud component through an Amazon API Gateway endpoint between two container instances. Another option is to set up a service bus between the two container instances to keep them in sync. You can use Amazon Managed Streaming for Apache Kafka (Amazon MSK) to set up such service buses.

1. Manufacturers can use the cloud component of microservices to process cases that are less sensitive to latency, such as processing quality inspection to populate history tables and sending updates to a PLM system to get quality results for future processes and part design improvements. Because of the cloud's economics, scale, and disaster recovery benefits, customers can store data for extended periods in cloud microservice instances.

1. You can use cloud-native ML services such as Amazon SageMaker AI to build and train the model in the cloud. You can deploy the finally trained model at the edge for inference. The edge component can also feed data back to the cloud to retrain the model.

# Data and analytics
<a name="data-analytics"></a>

Traditional monolithic MES systems had limited or no analytics capabilities. Manufacturers had to rely on expensive third-party tools or complex methods of backend data extraction into spreadsheets for basic reports such as daily production, inventory levels, quality results, and so on. There was little possibility of combining MES data with other applications and system data for analytics. Microservice-based MES on AWS can solve the typical analytics challenges for MES and provide additional analytics capabilities to give manufacturers a competitive advantage. The AWS Cloud gives manufacturers choices from a set of purpose-built analytics services and built analytics platforms, and also provides purpose-built solutions such as Industrial Data Fabric for industrial customers.
+ [AWS analytics services](https://aws.amazon.com/big-data/datalakes-and-analytics/) are purpose-built to quickly extract data insights by using the most appropriate tool for the job and are optimized to give the best performance, scale, and cost for business needs.
+ [Industrial Data Fabric](https://aws.amazon.com/solutions/industrial/industrial-data-fabric/)** **helps manage data at scale from multiple data sources. Businesses can optimize operations across the value chain and functions by combining MES data with data siloed in various systems across manufacturing. Traditionally, systems and applications within manufacturing either don't communicate or communicate rigidly based on hierarchy. For example, a PLM system doesn't talk to an OT system such as SCADA or PLC. Therefore, the data from production and process design aren't combined because these systems aren't designed to work together. MES connects the two, but traditional monolith MES, too, is limited in its communication with enterprise applications and OT systems. The Industrial Data Fabric solution on AWS helps you create the data management architecture that enables scalable, unified, and integrated mechanisms to use data effectively.

## Architecture
<a name="data-analytics-architecture"></a>

The following diagram shows a sample architecture for data and analytics that combines data from IoT, MES, PLM, and ERP. This architecture is built only on AWS services. However, as mentioned previously, you can use an AWS Partner solution for data analytics, and address the unique requirements of your environment by combining services from AWS and AWS Partners.

![\[MES architecture for data and analytics\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/data-analytics.png)


1. The OT data sources to be combined are available on the local network.

1. AWS Outposts provides edge hardware.

1. AWS IoT Greengrass services include an ML component for local inference and other components for data ingestion, processing, streaming, and so on.

1. The local instance of a microservice for MES could be any microservice, and, depending on the requirements, there can be more than one microservice at the edge.

1. Local authentication and authorization allow MES users to securely access the local microservice for latency-sensitive use cases, such as real-time production reports, or in the event of connectivity interruptions.

1. IoT services such as AWS IoT Core receive data in the cloud, and AWS IoT SiteWise stores and processes the data.

1. Amazon API Gateway endpoint and Amazon MSK options keep the cloud and edge components of microservices in sync.

1. Amazon Kinesis streams the data from IoT services to Amazon S3 buckets. Kinesis allows buffering and processing of data before storing it in S3 buckets.

1. The industrial data lake includes S3 buckets, an AWS Glue crawler, and the AWS Glue Data Catalog. AWS Glue crawlers scan the S3 bucket that contains raw data to automatically infer schemas and partition structure, and populate the Data Catalog with the corresponding table definitions and statistics from the S3 bucket that contains processed data.

1. Machine learning services such as Amazon SageMaker AI are used to analyze the data in the data lake and to derive patterns for predicting future events.

1. The MES microservice consists of the cloud components of a microservice within MES.

1. Analytics services support serverless querying of data from data lakes, data warehouses (Amazon Athena), interactive visualization using business intelligence services (Amazon Quick), an optional cloud data warehouse to run complex queries (Amazon Redshift), and optional advance data processing (Amazon EMR).

1. Frontend web services include Amazon Cognito to authenticate users, Amazon Route 53 as a DNS service, and Amazon CloudFront to deliver content to end-users with low latency.

1. AWS Lambda enables interfaces between analytics services and other applications.

1. Interface services include API Gateway to manage APIs and AWS AppSync to consolidate APIs and create endpoints.

# Containers for computing
<a name="containers"></a>

Containers are a popular choice for a modern MES that comprises microservices. Containers are a powerful way for MES developers to package and deploy their applications—they are lightweight and provide consistent, portable software for MES applications to run and scale anywhere. Containers are also preferred for running batch jobs such as interface processing, running machine learning applications for use cases such as automated quality inspection, and moving legacy MES modules to the cloud. Almost all MES modules can use containers for computing.

## Architecture
<a name="containers-architecture"></a>

The architecture in the following diagram combines DNS and load balancing for a consistent user experience with backend containerized computing. It also includes a continuous integration and continuous deployment (CI/CD) pipeline for continuous updates.



![\[MES container-based architecture\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/containers.png)


1. The MES development team uses AWS CodePipeline to build, commit, and deploy the code.

1. The new container image is pushed to Amazon Elastic Container Registry (Amazon ECR).

1. Fully managed Amazon Elastic Kubernetes Service (Amazon EKS) clusters support computing functions for MES microservices such as production management and inventory management.

1. AWS database and cloud storage services are used to support the unique needs of the microservices.

1. Elastic Load Balancing (ELB) automatically distributes incoming traffic for MES modules across multiple targets in one or more Availability Zones. For more information, see [Workloads](https://docs.aws.amazon.com/eks/latest/userguide/eks-workloads.html) in the Amazon EKS documentation.

1. Amazon Route 53 serves as a DNS service to resolve incoming requests to the load balancer in the primary AWS Region.

# Bringing it all together
<a name="all-patterns"></a>

A mature, microservice-based MES architecture combines all the use cases, integration tools, and orchestration services and approaches described in this guide. However, the details of the architecture can vary based on unique environmental factors, such as criteria used to determine the boundaries of microservices, evolution, and enhancements to MES over time. The following diagram illustrates a typical architecture that combines the usage scenarios discussed in previous sections.

![\[Consolidated MES architecture for multiple use cases\]](http://docs.aws.amazon.com/prescriptive-guidance/latest/mes-on-aws/images/mes-consolidated.png)
