is a fast-growing recording, collaborating and reporting platform designed for sharing and reviewing video game highlights and performance. Taking a game-agnostic approach that allows users to record across games such as Valorant, League of Legends, and Counter-Strike: Global Offensive, Insights.gg automatically records, saves, and analyzes a player’s gameplay footage, providing insights for improvement and enabling increased collaboration between professional esports teammates and casual gamers alike. The platform has a desktop application, designed for recording gameplay, and a web application, designed for live collaboration between teammates or friends. Other features like instant replay, clipping, and automatic bookmarking functionality allow users to dynamically capture and do some minimal editing on the fly. Imagine being the editor of the in-game footage of a live sports broadcast, but for esports and gaming, in real-time, and from the comfort of your home. This is what Insights.gg offers its customers.
Insight.gg’s objective is to enhance and simplify the gameplay recording process for its users. Steve Lam, CTO at Insights.gg, explains, "Our users love the fact that they don't need to think about the recording, and then we make it really easy to share with their teammates. Every time they play a game, it is automatically recorded and saved - making it a really frictionless experience to identify improvements."
Founded in Vancouver in 2019, Insights.gg’s user base was initially concentrated in North America. Since then, Insights.gg has witnessed its user base expand to millions of gamers across the globe, with over 100,000 daily active users worldwide. Most of these users are based in Japan, South Korea, Europe, and North America. With this rapid expansion, users in different parts of the world were experiencing performance and latency impact as the Insights.gg architecture wasn’t originally built nor optimized for global scale, with their PostgreSQL database becoming a bottleneck, in particular. For Lam and his team, delivering the best possible user experience and performance was paramount. Insights.gg would need to migrate to a more modern stack to ensure an exceptional gaming experience for users worldwide.
Migrating from a PostgreSQL monolith to scale up to a global user base
Based on these business needs, Insights.gg’s requirements were clear: they needed a technology stack that would both enable global distribution and reduction of latency without extensive engineering effort. Ideally, this new architecture would also allow them to quickly deliver the improvements to their user base while allowing them to iterate and improve their capacity and functionality in the future.
Global traffic management
As a result of this growth in the service, Insight.gg’s usage across the world began to fluctuate drastically from one region to another based on the time of the day (e.g. peak usage in the United States could be 9 pm EST, with minimal corresponding usage in Europe). Distributed compute services that could intelligently route and scale up or down based on demand was required to ensure the solutions wouldn’t become prohibitively expensive to maintain.
At the database layer, Insights.gg was originally built on a single-region PostgreSQL cluster. This was suitable when their users were isolated to North America, but became problematic when they started to see adoption in Europe and Asia. Insights.gg knew that a distributed compute layer built on a single-region database would not deliver the requisite performance requirements; even if Insights.gg built out an efficient distributed compute architecture, the application’s performance would be tied to the lowest common denominator in the stack – the single-region database. Even after standing up PostgreSQL read replicas in Asia and Europe, Lam explained, the PostgreSQL installation “negatively affected our application in ways that we didn't expect.”
Lam summarized, “Adopting a tech stack that was distributed-by-default from the ground up became one of our top priorities as our user base grew over time.”
Lam and his team aimed to build their stack around an internal API that would enhance the scalability and flexibility of their platform both for immediate and future requirements. This would enable them to flexibly introduce a wide range of applications and services without having to maintain brittle integration code. HTTP-delivered technologies would help facilitate efficient data exchange between various components of the platform by negating costly connection pooling when services weren’t in use.
Lam’s team knew they would need to iterate quickly to stay competitive - and at the same time, they wanted to be able to optimize their architecture to intelligently adapt to regional usage traffic spikes. Insights.gg aimed to eliminate the need for managing and provisioning servers, allowing them to focus more on developing and delivering innovative features and services to their users. The serverless approach offered scalability on-demand, automatically scaling up or down based on the workload, ensuring optimal performance even during peak usage periods.
Insights.gg architecture diagram
Insights.gg architecture: why a distributed-by-default stack
Ultimately, Insights.gg elected to build on Fauna, Cloudflare Workers
, and Fly.io
– a stack that is purpose-built for global distribution and delivered in a serverless fashion, simultaneously reducing latency and minimizing the engineering effort required. Beyond these core distributed solutions, Insights.gg leverages Wasabi for storing large video files and Google Cloud Run for running background tasks and container services, enabling efficient processing of user rankings and other miscellaneous tasks.
One of the key advantages of Insights.gg's adoption of Cloudflare, Fauna, and Fly.io is the ability to optimize their compute resources based on user traffic from different regions. This dynamic routing allows Insights.gg to scale their infrastructure efficiently based on demand and without being tied to a centralized server.
Cloudflare Workers serve as the API routing, gateway, and front-end for incoming connections. All user-facing interactions are handled through a GraphQL framework and stack running on Cloudflare Workers, which act as resolvers to fetch and manipulate data and enables Insights.gg to handle complex queries and deliver real-time data to users effectively. Cloudflare Workers provides a seamless connection between the frontend (including the desktop and web apps) and the backend. Insights.gg also leverages Cloudflare Durable Objects
to implement advanced features such as GraphQL subscriptions. With Cloudflare's global network of data centers, incoming traffic is routed to the nearest edge server, reducing latency and ensuring a smooth gaming experience for users worldwide.
To facilitate communication between the various components of their architecture, Insights.gg utilizes Fly.io, a globally distributed hosting platform. Fly.io serves as the host for a large intermediary Golang server that acts as an internal API, acting as the central hub for all auxiliary services within the broader Insights.gg architecture, including Fauna (for latency-sensitive requests, some Cloudflare Workers functions will be routed directly fo Fauna). Fly.io dynamically deploys servers based on user demand through its Dynamic Request Routing,
automatically spinning up servers in the appropriate location based on demand. This intelligent scaling mechanism ensures that Insights.gg's compute resources are always deployed close to the users, minimizing latency and providing optimal performance.
In their new stack, Insights.gg first adopted Cloudflare Workers, which are delivered as ephemeral functions. Taking an API-first approach, they began assessing databases that could integrate via HTTP instead of TCP connections. Fauna’s API delivery model was seen as a major advantage for this reason - which led the Insights.gg team to migrate a portion of their workload to Fauna to compare performance with their PostgreSQL installation.
Lam shared that, “over the course of a weekend, I was able to rewrite our backend with Fauna and stand up an MVP that I could show to the rest of the executive team. Latency decreased by more than 2x compared to our PostgreSQL instance.” This performance improvement quickly garnered buy-in from management, and within a month, the entire application was deployed with Fauna as the core database. Fauna is now used to store user information, video URLs, team metadata, privilege and access settings for team management, comments for videos, and even vector-based drawings.
With Fauna's multi-region deployment options, Insights.gg can store data in multiple geographic locations and aligns with their broader distributed stack. Fauna’s Intelligent Routing
provides developers with a single endpoint to access a strongly consistent, multi-region distributed database that optimally routes requests for the lowest latency, has replicas for redundancy against regional cloud failures, and provides region choice to help meet data residency requirement. This enables Insights.gg to comply with data privacy regulations and cater to their global user base, providing localized data access and improved data sovereignty. Lam shared that, “Compared to our previous database (PostgreSQL), Fauna is by default all over the world. So we don't have to worry about any international issues as we scale.” Fauna ensures high availability by automatically handling failover and replication across multiple data centers. This minimizes downtime and ensures that Insights.gg's gaming platform remains highly resilient to regional outages, providing uninterrupted gaming experiences. As a gaming company with a globally distributed user base, Insights.gg can rely on Fauna's scalability to ensure smooth performance even during peak usage periods.
Lam highlights that "the serverless aspect of Fauna has allowed us to forget about the database and just focus on our business logic." This freedom from infrastructure management enables Insights.gg to allocate their resources more efficiently and accelerate development.
Document-relational data model
model allows Insights.gg to take advantage of the scalability and flexibility of a document database without sacrificing the power traditionally associated with a relational database. Lam explained, “One pain point we had with PostgreSQL was having to synchronize our schema updates as well as our code deployments. Leveraging Fauna’s document-relational model allows us to forget about schema changes and focus just on deploying the code, which allows us to deploy faster without timing the deployments or schema changes. At the same time, we can still apply relations. The word that comes to mind when I think about Fauna is ‘flexible’.
Fauna's distributed architecture allows data to be stored and retrieved from servers located closer to users. This reduces latency and improves response times, ensuring a fast and seamless gaming experience for Insights.gg's users across different regions.
Fauna provides strong consistency
guarantees, ensuring that data updates are propagated across all replicas in real-time. This ensures that Insights.gg's data remains accurate and up-to-date, enabling accurate insights for their users.
By adopting Fauna, Fly.io, and Cloudflare, Insights.gg has not only achieved cost-effective global distribution, but also significantly reduced manual operations, streamlined their infrastructure, and significantly reduced latency. The distributed and serverless delivery models improved scalability and performance and also reduced undifferentiated overhead, enabling Insights.gg to focus on innovation and delivering value to their diverse global user base.