Architecture overview
Deploying this solution with the default parameters builds the following environment in the AWS Cloud.
Figure 1:architecture of construct graph data, model training and model deployment
Figure 2:architecture of real-time fraud detection and business monitor system
This solution deploys five AWS CloudFormation templates in your AWS account and sets up the following:
- The first AWS CloudFormation template
realtime-fraud-detection-with-gnn-on-dgl
creates:- an Amazon Virtual Private Cloud (Amazon VPC) running a NAT gateway, and an internet gateway.
- a Graph database Amazon Neptune cluster with one read replica,the default instance size is
db.r5.xlarge
. - an Amazon SQS message queue。
- The second CloudFormation template starting with
realtime-fraud-detection-with-gnn-on-dgl-trainingNestedStack
creates:- an AWS Step Functions workflow pipeline trains the model from tabular finance trasaction dataset, then deploy the online infernce endpoint.
- AWS Glue data catalog and ETL job are used transforming the original tabular data to graph structure data.
- Amazon ECS on AWS Fargate import the graph data into graph database Amazon Neptune.
- Amazon SageMaker trains model and deploy the online inference endpoint.
- AWS Lambda functions implement raw data ingesting, post-processing after model training and other glue work.
- The third CloudFormation template starting with
realtime-fraud-detection-with-gnn-on-dgl-inferenceNestedStack
creates:- AWS Lambda function implements the real-time fraud detection endpoint.
- The fourth CloudFormation tempalte starting with
realtime-fraud-detection-with-gnn-on-dgl-dashboardNestedStack
creates:- Amazon DocumentDB stores the transactions and their properties, its credential is saved in AWS Secrets Manager.
- AWS Lambda function receives the real-time online trasactions and stores in DocumentDB.
- the business dashboard website hosting in Amazon S3 and distributed by Amazon CloudFront.
- the backend of business dashboard consits of Amazon API Gateway and AWS AppSync.
- The fifth CloudFormation template starting with
realtime-fraud-detection-with-gnn-on-dgl-DashboardDatabaseRotation
creates:- AWS Lambda function will periodically rotate the user credential of DocumentDB stored in Secrets Manager.
For redundancy, the Amazon VPCs are created with subnets in two Availability Zones (AZs) for high availability. The NAT gateway, Amazon Neptune, Amazon DocumentDB, AWS Glue and other AWS resources are deployed across these two AZs.
NOTE: AWS CloudFormation resources are created from AWS Cloud Development Kit (CDK) (AWS CDK) constructs.