During the development of the event management platform, bulk ticket printing emerged as a significant performance challenge. The existing Node.js application utilized Puppeteer to generate PDFs from HTML templates. While functional, this setup struggled with complex and dynamic templates, leading to slow rendering times and high resource consumption — especially when processing large batches of tickets simultaneously.
To improve performance, the team attempted to offload PDF generation to a Laravel-based service using DOMPDF. The Node.js application would send the required template and data to Laravel, which then generated and returned the rendered PDF. Although this integration was technically sound, the process remained inefficient and slow, particularly under heavy load. Complex layouts, large datasets, and network overhead between services continued to hinder performance, impacting the user experience and delaying ticket delivery.
To overcome these limitations, the development team refactored the Laravel PDF generation service into a dedicated microservice focused solely on PDF processing. The rendering engine was upgraded from DOMPDF to SnappyPDF (wkhtmltopdf), providing faster and more reliable performance for complex, HTML-based ticket designs.
A queuing system was then introduced to handle parallel PDF generation, allowing multiple files to be processed simultaneously without blocking the main application workflow. This architectural improvement significantly enhanced speed, scalability, and reliability.
However, since queued jobs could not return data directly through HTTP responses, a webhook-based notification system was implemented. Once a PDF was successfully generated, the Laravel microservice triggered a webhook to notify the Node.js server, which then used Socket.IO to deliver the PDF to the frontend in real time.
This end-to-end optimization resulted in a smooth, responsive, and efficient printing workflow, reducing delays, improving performance, and providing users with a seamless experience — even during high-volume ticket generation.
4x faster PDF generation after replacing DOMPDF with SnappyPDF and implementing parallel processing.
Seamless real-time delivery of generated PDFs through webhook and Socket.IO integration.
Improved scalability, enabling bulk ticket printing without performance degradation.
Enhanced user experience, with faster response times and minimal processing delays during peak loads.
Through strategic refactoring and performance optimization, the ticket printing workflow was transformed into a highly efficient and scalable system. By introducing a dedicated microservice, upgrading the rendering engine, and implementing asynchronous processing with real-time notifications, the solution achieved a strong balance between speed, reliability, and user experience.
This approach not only resolved existing performance bottlenecks but also established a robust technical foundation for future scalability and feature expansion.