Design Comic Con Registration System

Backend developer
Javarevisited
Published in
5 min readOct 25, 2021

--

Photo by Marjan Blan | @marjanblan on Unsplash

Through this article we will learn how to design a backend architecture which help the users to register for the events. In the past, we have discussed about the system design concepts. We will be using those concepts here and we will learn some more new concepts. Please have a look at these articles before proceeding further.

Problem Statement

A new service has been requested by multiple front-end experiences (web & app) that would allow users to sign-up for different kinds of Comic-Con live events, such as Comic Con Halloween, First Comic League, and others. The service is expected to play a vital role in unifying the signup experience across many different comic con live event microsites and apps and help the business to gain more transparency across these live events managed by local market groups. Design a backend solution for the comic con event service that provides the capabilities outlined above, exposing APIs both for the experience side to provide sign-up capabilities, as well as APIs for an admin front-end that allows administrators to create events, maintain and extract participant lists. The design proposal should consider the global availability of the service, as well as privacy & legal constraints and their implications on the storage of users’ personal information.

Basic Understanding

Every comic con live event location needs their own server, database and website. It will be really hard to build this system without any server at the live locations. Any third party application/movie tickets application should work along with comic con’s server to get seat availability information.

Now, let’s design Comic Con registration system.

Functional Requirements

  1. User can search/view the events
  2. User can register/unregister from the event
  3. Admin can create/view/update/delete the events
  4. Admin can get the list of registered users for the event
  5. Supports multiple cities and countries

Non Functional Requirements

  1. Highly concurrent and available
  2. Highly scalable
  3. No Latency

User and Admin Roles

Users and admin have different roles which can be differentiated using roles parameter.

  • Admin can create/view/update/search/delete the events. Admin can also get the list of registered users for the events
  • User can register/unregister events, search events, view events.

Relational Database

We are using relational database in our system because we need structured data and their relations. It’s a myth that relational database are not scalable. We can scale relational database as well. Here we are using Master Slave architecture to scale our RDBMS. Master database does the write operations and other slaves database, having master database copies, will do the heavy read operations. This will reduce our database latency.

  • User Database : uid(Primary Key), uname, contact, email, seats booked, eid(Foreign Key)
  • Event Database : eid(Primary Key), ename, location, city, country, seats available, cost
  • Payment Database : pid(Primary Key), eid(Foreign Key), ispaid

Caching

We are using Redis which is used as a caching layer for heavily read data. Redis can also be used as locks for various purpose such as to block tickets we can use redis entry for every seat a user is trying to book with a specific TTL (Time To Live).

Notification Service

Notification Service is a message queueing system such as Rabbitmq or Apache Kafka to execute the async task which are time-consuming such as sending SMS/Email/WhatsApp messages, generating tickets as PDF. Also, if the admin create, update or delete the events then the notification service will get notified and updated information is added in elastic search so that the user gets the latest updated event information.

Load Balancer

We can use Nginx or Amazon Elastic Load Balancer in this case. Load Balancers helps in maintaining the load on the servers. Load Balancers used various techniques to identify which server should process the request so that servers are not overloaded.

Content Delivery Network (CDN)

CDN helps in maintaining the service globally. CDN is a geographically distributed group of servers which work together to provide fast delivery of Internet content. The requested content is first stored on the origin server and is then replicated and stored elsewhere as needed. This makes the application highly available and helps in reducing the latency.

How user will register for the event?

  1. User will search for the comic con events.
  2. Opens the comic con event details.
  3. User registers their email id for the event using OAuth. OAuth is used to grant websites or applications access to their information on other websites but without giving them the passwords.
  4. Now the number of seats available is fetched from the event database which is cached.
  5. Now user selects the number of seats and the server should lock the seats for next 10 minutes. The user should make the payments in 10 minutes otherwise server will release the lock on the seats.
  6. Check invoice with payment options and pay via gateway. Request will be redirected to payment gateway.
  7. Once the payment is successful then a unique ID is generated.
  8. If the user selects the seats and made the payment but the seats are not available. Then the entire transaction would be reverted.
  9. The number of seats available are updated at the event database.
  10. User will get a ticket invoice with encrypt QR code, basic details of the event, address of the event, timings etc
  11. A ticket will be generated then and there only using Unique Ticket ID
  12. Async tasks are invoked to send SMS, Email and WhatsApp the tickets
  13. User goes to the comic con event and the event manager scan QR code on booking ticket.
  14. Ticket code is retrieved using QR code scan.
High Level Design (HLD)

REST APIs

  • /users?eid=“<value>” returns list of registered users for the event
  • /cities which return all the cities
  • /events?city=“<value>” returns all the events for this city
  • /locations?city=“<value>” returns all the locations for this city
  • /locations?city=“<value>”&eid=“<value>” returns all the locations for this city and for this event
  • /events?city=“<value>”&location=“<value>” returns all the events for this city and for this location

Technologies

  • Backend Server : Java, Spring Boot, Swagger, Hibernate
  • Security: Spring Security
  • Database : MySQL
  • Server : Tomcat
  • Caching : Redis
  • Notifications : Apache Kafka
  • Deployment: Docker
  • Code repository: Git
  • Load balancer : Nginx

This is how I will design the event registration system. Please feel free to add/review the design and let me know how you will approach such questions. I will add more system design articles so that we can learn and design systems together. Stay Tuned. Happy Learning! 🎃

--

--