AWS for Industries

Building a Serverless Supply Chain Management Solution for Automotive Customers with AWS AppSync and Amazon Aurora Serverless

In the automotive industry, effective supply chain management is critical for ensuring seamless operations, reducing costs, and meeting customer demands. Modern serverless technologies can help automotive companies achieve end-to-end, real-time visibility and insights across their supply networks. By using AWS AppSync and Amazon Aurora Serverless, organizations can build scalable, responsive applications that help simplify data management and help provide real-time insights into parts, orders, and shipments.

In this blog post, we demonstrate how to build a serverless supply chain management solution tailored for automotive customers using AWS AppSync (a managed GraphQL service) and Amazon Aurora Serverless (an on-demand, auto-scaling relational database). This solution addresses common challenges in managing parts inventory, orders, and shipments by using a fully serverless, GraphQL-based approach.

You will learn:

  • How to model a relational database schema for supply chain management.
  • How to use AWS AppSync to build a GraphQL API for querying and managing supply chain data.
  • How to use Amazon Aurora Serverless v2 for an on-demand, cost-efficient relational database.
  • How to implement JavaScript resolvers in AppSync to handle complex business logic in the API layer.

By the end of this post, you’ll have a working example of a supply chain management application and the knowledge to extend it to meet your business needs.

Solution Architecture

This solution uses AWS serverless technologies to create a scalable and cost-effective supply chain management system for the automotive industry where any visibility gap can trigger costly stoppages due to its just-in-time nature. Below is an overview of architecture.

Figure 1: Architecture diagram of the solution

Figure 1: Architecture diagram of the solution

The serverless supply chain solution operates as follows, tying together the above components in the data flow as shown in Figure 1:

1. Authentication with Amazon Cognito: Amazon Cognito integrates with AppSync to secure the GraphQL API. User pools and identity pools manage authentication, ensuring that each request to AWS AppSync carries valid credentials (for example, a JSON Web Token ). Furthermore, each authenticated user can be assigned a pre-defined role which is included in JWT claims, which allows enforcement of fine-grained access control – for instance, a dealership user might only be allowed to query certain data, whereas an internal supply chain app might have broader permissions. Cognito thus provides a robust, serverless security layer for the solution.

2. GraphQL API with AppSync: Clients (such as web or mobile applications) interact with the system through AWS AppSync using the tokens provided by Amazon Cognito. Using AWS AppSync JavaScript resolvers, the GraphQL API can connect directly to Aurora Serverless to retrieve or manipulate data.

3. Secure Database secret management with AWS Secrets Manager: In order to interact with Aurora, AppSync can get the database connection secrets directly and securely from AWS Secrets Manager using the IAM credentials provided for that purpose. Resolvers can then perform calls against the Database.

4. Business Logic with AppSync Resolvers: Complex business rules are implemented at the AppSync resolver layer using JavaScript (TypeScript) code. This means you can enforce supply chain logic directly in your AWS AppSync API without requiring a downstream AWS Lambda function to handle the request. For example, resolvers can calculate lead times between an order and its corresponding shipment, forecast parts demand based on historical orders, or manage inventory levels dynamically when new orders or shipments come in. Key examples of in-API business logic include:

a. Calculating lead times between orders and shipments (e.g., determining the number of days between an order date and its shipment date).

b. Calculating backorder rates to identify parts with supply issues and measure the percentage of orders that couldn’t be fulfilled immediately.

c. Inventory management rules, such as preventing orders that exceed current inventory or flagging parts for restock when inventory is low.

5. Relational Database with Aurora Serverless: All supply chain data is stored in Amazon Aurora Serverless (using PostgreSQL in our case). The database schema includes three key tables – Parts, Orders, and Shipments – which are designed to capture the relationships and dependencies in the supply chain. AWS AppSync resolvers execute SQL statements to perform queries and updates on these tables.

The combination of these services results in a fully serverless, scalable architecture. Whenever the automotive business experiences increased load (e.g. many orders placed at once), Aurora Serverless can scale capacity accordingly, and AWS AppSync will handle the surge of API calls without needing any manual intervention. Conversely, during periods of low activity, the database scales down to reduce costs, and you pay only for the storage used. This architecture can not only help simplify infrastructure management but also help accelerate development by using GraphQL to abstract and unify data access across the supply chain.

Validating the Solution

With the application deployed and data loaded, you can validate the solution by running some GraphQL queries in AWS AppSync. For detailed step-by-step instructions on how to access the AppSync Console and authenticate, please refer to the Testing Guide in the GitHub repository. Once you’ve completed the setup and authentication steps, return here to continue testing the solution.

Understanding Analytics & Calculations Operations

For automotive supply chain management, having real-time visibility into key performance indicators is crucial for maintaining operational efficiency and meeting customer demands. Our solution provides four key analytics operations that help automotive businesses make data-driven decisions:

1. Calculate Lead Time

Business Context: Lead time is the duration between placing an order and receiving the shipment. For automotive manufacturers, understanding lead times is essential for production planning and avoiding assembly line stoppages. Long or variable lead times can indicate supplier reliability issues or logistics bottlenecks.

Query:
Screenshot of Calculated Lead Time query

Expected Results:

Screenshot of expected results of calculated lead time

Interpretation: For illustrative purposes only, in this example, Engine Blocks have an average lead time of 15 days, which is relatively long. This information helps procurement teams plan orders well in advance and potentially negotiate faster delivery terms or identify alternative suppliers.

2. Calculate Backorder Rate

Business Context: Backorder rate measures the percentage of orders that couldn’t be fulfilled immediately due to insufficient inventory. High backorder rates directly impact production schedules and can lead to costly assembly line shutdowns. For automotive manufacturers operating on thin margins, even a small increase in backorder rates can significantly affect profitability.

Query:
Screenshot of Calculate Backorder Rate query

Expected Results:
Screenshot of Calculate Backorder Rate query

Interpretation: For illustrative purposes only, A backorder rate of 0.22 (22%) for Transmissions indicates a significant supply issue. This suggests the need to increase safety stock levels, diversify suppliers, or improve demand forecasting for this critical component.

3. Calculate Order Fill Rate

Business Context: Order fill rate represents the percentage of orders successfully fulfilled on the first attempt. This metric directly correlates with customer satisfaction and operational efficiency. In automotive manufacturing, a high fill rate ensures smooth production flow and reduces the need for expedited shipping, which can be costly.

Query:

Screenshot of Calculate Order Fill Rate queryExpected Results:

Screenshot of Calculate Order Fill Rate expected results

Interpretation: For illustrative purposes only, Brake Pads have an excellent fill rate of 95%, while Transmissions at 78% need attention. Low fill rates often indicate inadequate inventory management or unreliable suppliers.

Conclusion

In this post, we demonstrated how to build a serverless supply chain management solution for the automotive industry using AWS AppSync and Amazon Aurora Serverless. This fully managed architecture designed to provide automatic scalability to handle demand spikes, cost optimization through pay-per-use pricing, customizable business logic via JavaScript resolvers, and secure role-based access control through Amazon Cognito integration.

This serverless approach addresses real-world automotive challenges like tracking parts inventory, calculating lead times, and forecasting demand. By combining GraphQL’s unified data access with Aurora Serverless’s automatic scaling, automotive companies can build solutions that grow with their business without heavy upfront infrastructure investment or operational overhead.

Alan Oberto

Alan Oberto

Alan Oberto is a Senior Cloud Application Architect at AWS Professional Services, specializing in serverless architectures, AppSync-based APIs, and Generative AI solutions for the automotive industry. He works closely with customers to design and deliver scalable cloud-native applications and enjoys helping teams adopt modern architectures on AWS.