Using AWS Serverless to Power Event Management Applications
AWS Architecture BlogUsing AWS Serverless to Power Event Management Applicationsby Cheryl Joseph, Jyoti Tyagi, and Vaibhav Shah | on09 SEP 2021| inAmazon API Gateway,Amazon Cognito,Architecture,AWS Lambda,Foundational (100),Serverless,Travel and Hospitality|Permalink|ShareMost large events have common activities such as event registration, check-in upon arrival, and requesting of amenities. When designing applications, factors such as high availability, low latency, reliability, and security must be considered.In this blog post, we’d like to show howAmazon Web Services (AWS)can assist you in event planning activities. We’ll share an architecture that follows best practices, and one that can be used in developing other solutions.Serverless to the RescueServerless architecture enables you to focus on your application development without having to worry about managing servers and runtimes. You can quickly build, fix, and add new features to your applications. A microservices-based approach provides you the ability to scale and optimize each component of your event management application.Let’s start by looking at some activities that an event guest might perform, and how they might be displayed in a mobile application:Event registration:A guest can register either from a website or from a mobile device, see Figure 1. Events might have heavy traffic initially, or a large push toward the end. This requires building applications that are highly scalable.Figure 1. Event registrationCheck-In:Check-In can be a manual and cumbersome process – some mobile options are shown in Figure 2. Attendees must queue up to register, pick up badges, receive agendas, and collect other meeting materials.Figure 2. Guest check-in kioskGuest requests:While the event is underway, a participant might request hand-outs or want to purchase food or beverages, see Figure 3.Figure 3. Guest requestsSession notification:At popular events, there are some sessions that fill up quickly. Guests must queue up to get into the session. Figure 4 shows a notification screen.Figure 4. Session notification on guest deviceSolution overview for event planningThe serverless architecture presented here is highly scalable and provides low latency. It follows theServerless Application Lensof theAWS Well-Architected Framework. This enables you to build secure, high-performing, resilient, and efficient applications.Frontend user interface using AWS AmplifyThe event website is hosted onAWS Amplify. Amplify provides a fully managed service for deploying and hosting applications with built-in CI/CD workflows. An alternative for hosting the event website could beAmazon Simple Storage Service (S3)or even by provisioningAmazon EC2instances. However, Amplify is well suited for native mobile apps and JavaScript-based web apps.The event website usesAmazon Cognitofor management of user authentication and authorization. Amazon Cognito is a good choice here as it allows federating with external identity providers.Backend serverless microservicesThe backend of the event management application usesAmazon API GatewayandAWS Lambda. They provide the ability to expose API operations. If the application has a flurry of requests coming in together, the backend serverless microservices will scale up or down seamlessly. However, there are service limits, and it is important to keep these in mind while designing your applications.Amazon DynamoDBis the NoSQL database, which saves the guest registration data and other event-related information. DynamoDB is a good fit here, as it delivers single-digit millisecond performance at any scale and provides high availability, fault tolerance, and automatic capacity scaling.Amazon Pinpointis used to send notifications to guests via email and SMS. Amazon Pinpoint allows your app to connect with customers over channels like email, SMS, push, or voice.Let’s take a closer look at some of the activities we’ve outlined.Solution architecture – Event registration and check-inFigure 5. Event registration and check-inNumbered items following refer to Figure 5:Developers upload code toAWS CodeCommitCodeCommit pushes the code to AmplifyGuests access the website viaAmazon Route 53Route 53 resolves incoming requests and forwards them to AmplifyGuest authentication is performed by Amazon Cognito user poolsAmplify sends the REST API requests to API GatewayAPI Gateway uses Amazon Cognito user pools as the authorizerAPI Gateway proxies the request to LambdaLambda stores guest data in DynamoDBLambda uses Amazon Pinpoint to notify the guestThe guest registration processbegins with loading the web application hosted on Amplify. The application creates the user in the Amazon Cognito user pool and routes the request to API Gateway to complete the registration process. Amazon Cognito integrates with third-party authentication systems such as Google, Facebook, and Amazon. This allows guests to use their existing social media accounts to register.The guest check-in processconsists of loading a web application onto kiosks. Guest information is saved in a DynamoDB table. Upon registration, a QR code is sent to the guests, then scanned upon arrival at a kiosk. Guest information is then retrieved from a DynamoDB table. This allows guests to print their badges and other event materials.Well-Architected guidance:Enable active tracing withAWS X-Rayto provide distributed tracing capabilities and visual service maps for faster troubleshooting of the backend APIs.For Lambda functions, follow least-privileged access and only allow the access required to perform a given operation.Throttle API operations to enforce access patterns established by the event management application service contract.Set appropriate logging levels and remove unnecessary logging information to optimize log ingestion. Use environment variables to control application logging level.Solution architecture – Guest requestsFigure 6. Guest requestsNumbered items refer to Figure 6:Guests access the website via Route 53Route 53 resolves incoming requests and forwards them to AmplifyGuest authentication is performed by Amazon Cognito user poolsAmplify sends the REST API requests to API GatewayAPI Gateway uses Amazon Cognito user pools as the authorizerAPI Gateway proxies the request to LambdaLambda validates and stores guest data in DynamoDBLambda uses Amazon Pinpoint to notify the guestAmazon DynamoDB Streams are enabled which triggers a Lambda functionLambda notifies the employees viaAmazon Simple Notification Service (SNS)to fulfill the requestOnce a guest request is made for session handouts or food or beverages, it is stored in DynamoDB. DynamoDB Streams are enabled, see Figure 7, which captures a time-ordered sequence of item-level modifications in a DynamoDB table. It durably stores the information for up to 24 hours. This generates an event, which triggers a Lambda function. The Lambda function sends an SNS notification via SMS or email to the event employees who can address the guest requests.Figure 7. Sample DynamoDB Streams recordWell-Architected guidance:Standardize application logging across components, and business outcomesEnable caching on API Gateway to improve application performanceUse an On-Demand Instance for DynamoDB when traffic is unpredictable, otherwise use provisioned mode when consistentAmazon DynamoDB Accelerator (DAX)can be used as an in-memory cache to improve read performanceSolution architecture – Session notificationFigure 8. Session notificationNumbered items refer to Figure 8:AnAmazon EventBridgerule runs on a schedule and invokes a Lambda functionLambda retrieves guest and session information from DynamoDBLambda notifies the guest via Amazon PinpointAmazon Pinpoint can send notifications to registered guests to let them know when to queue up for the session.ConclusionThis solution provides a powerful approach for deploying highly scalable applications, while providing low latency and low cost.Build a Serverless Web Applicationcan get you started. Large events require a considerable amount of planning and coordination. We hope the guidance provided here will help you build a scalable and a robust event management application.Cheryl JosephCheryl Joseph is a Solutions Architect at AWS. She has a passion for solving technical challenges. She loves guiding and helping others in understanding their potential in pursuing careers as tech professionals. She enjoys public speaking. She has over 20 years of strong experience in leading several complex, highly robust, and massively scalable software solutions for large-scale enterprise applications.Jyoti TyagiJyoti Tyagi is a Solutions Architect with great passion for artificial intelligence and machine learning. She helps customers architect highly secured and Well-Architected applications on the AWS Cloud using best practices. In her spare time, she enjoys painting and meditation.Vaibhav ShahVaibhav is a Solutions Architect in AWS with passion for building automated solutions for complex problems and helping customers drive solutions. He is interested in Serverless, DevOps, CI/CD, and everything around automation. Besides work – he loves to travel, explore new places, restaurants, cooking, following sports like cricket and football, watching movies and series (Marvel fan), adventurous activities like hiking, skydiving, and the list goes on.
Most large events have common activities such as event registration, check-in upon arrival, and requesting of amenities. When designing applications, factors such as high availability, low latency, reliability, and security must be considered. In this blog post, we’d like to show how Amazon Web Services (AWS) can assist you in event planning activities. We’ll share […]
Cheryl Joseph
Amazon API Gateway Amazon Cognito Architecture AWS Lambda Foundational (100) Serverless Travel and Hospitality