Using Amazon Neptune for Real-time Anomaly Detection in Gaming Transactions

Leveraging Graph Databases for Transaction Integrity

Zupee, a leading skill-based gaming platform in India, faced a challenge in maintaining integrity across their incentive programs while managing millions of daily transactions. The company needed to identify suspicious patterns and detect anomalies in wallet transactions in real-time – a challenge that traditional relational databases couldn’t efficiently handle.

Why Traditional Databases Fell Short

Initially, Zupee used relational databases to identify connected users and validate transactions. However, as their user base expanded, limitations emerged:

  • Processing millions of daily transactions became inefficient
  • Multiple correlation attributes created complex relationships
  • Traditional database structures struggled with interconnected data
  • Real-time analysis of intricate relationships was difficult

The inherently connected nature of their data – where users linked through multiple attributes and complex relationships – made traditional database querying increasingly cumbersome.

The Graph Database Advantage

Graph databases excel at managing interconnected data by storing information as nodes (entities) and edges (relationships). This approach provides several key benefits:

  • Efficient traversal of relationships without predefined join operations
  • Ability to execute complex queries across numerous data points in milliseconds
  • Exploration of data through multiple hops with minimal restrictions
  • More intuitive approach to storing and querying interconnected information

Implementation with Amazon Neptune

Zupee implemented Amazon Neptune, a fully managed graph database service optimized for storing billions of relationships with millisecond query latency. Their solution processes over 1 million wallet transactions daily in real-time.

The graph data model connects various entities:

  • User nodes (central to the model)
  • Device tokens (for device logins)
  • Transactions (creation and transfers)
  • Payment instruments (payment methods)
  • User profiles

By utilizing the Union Find algorithm, Zupee efficiently created distinct subgraphs of entities based on their relationships, enabling discovery of complex associations without having to model every relation explicitly.

Real-World Results

The Neptune implementation delivered impressive outcomes:

  • Response times under 50 milliseconds in optimal conditions
  • Real-time anomaly detection capabilities
  • Management of over 5 million nodes and edges
  • Dynamic searching for entities and connected nodes in real-time

The system now effectively identifies suspicious patterns by analyzing relationships between user profiles, payment instruments, and device tokens. It can detect duplicate accounts, discover shared payment instruments across multiple accounts, and calculate appropriate incentive values based on user authenticity.

For pay-to-play formats, when users add money to their wallet, the system queries Neptune to fetch relevant subgraphs showing user associations, ensuring legitimate users receive full incentive benefits while accounts with detected anomalies receive adjusted or no incentives.

This approach has allowed Zupee to optimize costs by ensuring incentives are primarily given to genuine users while protecting against potential misuse through duplicate accounts or shared payment methods.

Visit the AWS Database Blog for more information on how Zupee implements Amazon Neptune to detect wallet transaction anomalies in real-time