In previous articles, we discussed how our website generation architecture had become increasingly expensive and difficult to maintain. If you’d like more context, you can check out our article on the frontend framework upgrade or the detailed breakdown in Unveiling the Technological Framework: Emma’s Online Store Architecture. In these, we explain how our system relies on Node.js Cron Jobs to manage the generation of multiple country-specific versions of our website.
After encountering the challenges outlined in previous articles, it became evident that we needed to move away from a centralized generation model. We transitioned to generating each country’s site independently, which not only accelerated the process—getting new products live more quickly—but also simplified the architecture and eliminated many complex workarounds. A crucial part of this transition involved overcoming the barriers related to programmatically calling Nuxt’s internal API, a major obstacle in our Nuxt 3 migration.
In our ongoing effort to enhance performance and scalability, we’ve introduced substantial process and technology improvements to our website architecture. These changes not only resolve longstanding issues but also open up new possibilities for growth and efficiency.
Process Improvements
One of the most impactful changes is the shift to independent country generation. Previously, the generation of websites for multiple countries was done in a single, monolithic process. Now, each country’s site can be generated independently. This change significantly reduces bottlenecks and enables faster updates, especially when content varies by region. The new setup also introduces the possibility of generating a site per content type, allowing even more flexibility in managing how content is rolled out across different countries.
These improvements also bring us closer to migrating fully to the Nuxt framework and open the door to server-side A/B testing. By separating the country-specific generation process, we can experiment with server-side changes while keeping the infrastructure more organized and adaptable.
In terms of reliability, the new setup reduces the number of timeout failures during the generation process. If a failure does occur, the tech team is automatically alerted, ensuring quick response times and minimal disruption.
Technology Improvements
On the tech side, these updates have helped reduce our technical debt. By making over 200 files in our codebase obsolete, we've significantly cleaned up and simplified our system. This streamlining removes unnecessary resources that were no longer being used, freeing up space and reducing system complexity.
Additionally, we’ve optimized our resource allocation by reducing the number of message queues and scaling down the infrastructure. We're now running 12 instances, each with 4GB of memory and two full CPUs, ensuring better performance and resource management.
The simplified architecture also enables on-demand generation for ephemeral environments. This is particularly useful for testing and development, as it allows for quick setup and takedown of environments as needed, further speeding up the deployment process.
Another major win is the improvement in our Docker image build times, which have been reduced by 40%. This accelerates our development cycles, making it faster and easier to push out updates and improvements.
Lastly, these improvements unblock the migration to Nuxt 3, which was previously hindered by the complexities of our old architecture. With a more streamlined system in place, we are now well-positioned to fully adopt the latest framework, bringing further performance and feature enhancements to our platform.
Comments