From Flutter to Gatsby: Our Journey to Enhanced Performance and Stability 🚀

Dealberg Tech
6 min readJul 11, 2024

--

Problem Statement

At DealBerg, a B2B startup, we inherited our entire platform, i.e., multiple codebases that were initially developed by an outsourced agency. To make their work easy, they used Flutter to build for Android/IOS/Web platforms, which was very buggy and unstable. The fast-evolving landscape of web development requires developers to find the right tools and technologies which has a crucial impact on delivering optimal performance and stability. As we progressed, we encountered challenges and reasons that we found that ended up migrating to Gatsby. In this blog, I’ll share our journey, the reasons behind our switch, and the benefits we’ve experienced with Gatsby.

What is Flutter?

Flutter, developed by Google, is an open-source UI software development toolkit used to build natively compiled applications for mobile, web, and desktop from a single codebase. It’s known for its fast development cycles, expressive and flexible UI, and a rich set of pre-designed widgets.

When to use Flutter?

1. Cross-Platform Applications: One of the primary use cases of Flutter is building cross-platform mobile applications. With a single codebase, developers can create apps for Android, IOS, Web, and Desktop reducing development time and effort.

2. Advanced OS Features: It provides ready-to-use plugins for features like sensor data collection, permission handling, GPS coordinates, credentials, and Bluetooth.

3. Embedded Devices: Flutter can be used to build applications for embedded devices, providing a versatile solution for creating user interfaces on a wide range of hardware.

4. Prototyping and MVP Development: Flutter’s fast development cycle and hot reload feature make it an excellent choice for prototyping and developing Minimum Viable Products (MVPs). This allows developers to quickly iterate on designs and functionality.

What is Gatsby?

Gatsby is a React-based open-source framework for creating fast, modern websites and apps. It leverages the power of React, GraphQL, and modern web technologies to deliver a high-performance web experience. Gatsby is known for its excellent developer experience, scalability, and out-of-the-box performance optimizations.

When to use Gatsby?

1. Static Site Generation: Gatsby is widely used for building static websites, which are pre-rendered at build time. This results in extremely fast load times and improved performance.

2. Progressive Web Apps (PWAs): Gatsby can be used to create Progressive Web Apps, which provide a native app-like experience on the web. These apps are fast, reliable, and engaging.

3. Blogs and Content-Heavy Sites: Gatsby is particularly well-suited for content-heavy sites like blogs, news sites, and documentation portals. It supports Markdown, and CMS integrations, and has a rich ecosystem of plugins.

4. Marketing and Landing Pages: Gatsby is ideal for building marketing websites, landing pages that need to be fast, visually appealing, and SEO-friendly, and documentation sites due to its support for Markdown and ease of integration with various data sources.

Embarking on the Journey of Flutter: Exploring its Potential in Web Development

When we started using Flutter for web development, we were drawn by its promise of code reusability across platforms and its beautiful, expressive UI. However, as we delved deeper, several challenges emerged:

  1. Performance Issues: Flutter, while great for mobile apps, didn’t meet our performance expectations for web applications. The loading times were longer, and the responsiveness wasn’t as smooth as we needed.
  2. Stability Concerns: We faced occasional bugs and stability issues that were harder to debug and fix due to the relatively newer support for web development in Flutter.
  3. SEO Limitations: Flutter’s client-side rendering posed challenges for SEO, which is critical for our business’s online visibility.
Admin Panel Lighthouse Report (Flutter)

Why We Switched to Gatsby

After careful consideration, we decided to switch to Gatsby for our web development needs. Here are the key reasons:

  1. Performance: Gatsby builds static websites, ensuring fast load times and excellent performance. The pre-rendered HTML and efficient data handling significantly improved our site’s speed.
  2. Stability: Gatsby’s mature ecosystem and extensive plugin library offered the stability we needed. The robust community support also made troubleshooting easier.
  3. SEO: Gatsby’s static site generation is inherently SEO-friendly, providing better indexing by search engines and improving our site’s discoverability.
  4. Developer Experience: Gatsby’s use of React and GraphQL made it easy for our development team to build and manage content. The clear documentation and community support further enhanced our productivity.
Vendor Panel Lighthouse Report (Gatsby)

Performance Comparison: Waterfall Network APIs in Flutter vs. Gatsby

Our investigation of waterfall network APIs reveals intriguing contrasts between Flutter and Gatsby frameworks. While Flutter exhibits longer loading times, Gatsby demonstrates swifter execution and reduced initial load times. This distinction underscores Gatsby’s efficiency in web development, showcasing its capability to deliver faster content rendering and smoother user experiences. As we delve deeper into these findings, optimizing API usage becomes pivotal in maximizing performance across different development environments.

Flutter Network Waterfall
Gatsby Network Waterfall

Performance Showdown: Flutter vs. Gatsby — Unveiling the Superiority of Gatsby for the web

In our performance comparison, Gatsby outshines Flutter with significantly higher performance scores, particularly in loading times and overall execution speed. Gatsby’s focus on static site generation and efficient caching mechanisms enables faster content delivery and smoother user experiences. While Flutter offers robust cross-platform capabilities, its runtime architecture occasionally leads to longer initial load times. This comparison highlights Gatsby’s edge in web development scenarios prioritizing speed and performance optimization.

Performance Analysis for Our Admin Panel (Flutter)
Performance Analysis for Our Vendor Panel (Gatsby)

Making the Decision for Your Next Website Development

This blog isn’t intended to put down any Flutter Developer out there. Flutter released Web Support late in 2021, while the main intention of React was to build for the Web. With this in mind, when considering your next website development framework, it’s crucial to weigh the efficiencies of Gatsby and Flutter Web. Gatsby stands out significantly due to its native use of JavaScript, simplifying development and enhancing compatibility across browsers. In contrast, while versatile, Flutter introduces additional complexities by requiring JavaScript conversion, potentially leading to integration challenges. This distinction underscores Gatsby’s advantage in delivering streamlined performance and seamless user experiences, particularly in web-focused projects where speed and compatibility are paramount. Ultimately, choosing Gatsby for your website development ensures robust functionality and efficient deployment, aligning with modern web standards and user expectations.

Conclusion

Navigating the restructure of our codebase has been an exhilarating journey as a front-end developer. Focused on enhancing performance and user experience, collaborating closely with our team, we’ve crafted a foundation that prioritizes clean architecture, seamless navigation, and visually compelling interfaces. This endeavor underscores our commitment to delivering intuitive solutions that resonate with our users’ needs.

As we look forward, our dedication remains steadfast in evolving this platform to align with emerging trends and elevate user interactions. Your support fuels our drive to innovate and optimize, ensuring our front-end solutions pave the way for enhanced digital experiences. Thank you for joining us on this transformative path. Together, let’s shape a future where front-end development sets new standards in usability and impact.

— Blog written by Nevil Paul, Frontend Developer

--

--