This thesis presents the incremental migration of the user domain from the UX-Engine monolith — a large-scale personalization and content discovery platform developed by ContentWise/Moviri and serving over 100 million users globally — into a dedicated Spring Boot microservice. The migration is guided by the Strangler Fig Pattern and Domain-Driven Design, with the user domain identified as a supporting subdomain whose tight coupling and dispersed logic made it one of the most challenging areas of the system to maintain. The new service reimplements all user-facing operations — creation, retrieval, update, rename, history deletion, and preference management — while preserving the existing database schema and the observable behavior of the legacy system. The shared database was retained as a deliberate architectural trade-off to enable coexistence between the monolith and the new service during the transition period. Key implementation challenges addressed include the EAV-like schema inherited from the Moviri Application Library, a lost-update concurrency problem resolved through pessimistic locking, and the dual-write problem analyzed through the transactional outbox pattern and Change Data Capture with Debezium. The delete user history operation is analyzed as an inherently cross-domain workflow, with the Saga pattern identified as the correct long-term solution. The service was containerized and deployed on AWS EKS via a GitOps workflow with ArgoCD. Validation was performed through unit tests, functional API tests against the existing ContentWise test suite, performance tests with Gatling, and a custom characterization testing framework based on database snapshot comparison. Results confirm behavioral equivalence with the legacy system, performance comparable to the monolith despite the additional network overhead of a Kubernetes deployment, and measurable improvements in code quality across all static analysis dimensions.
Questa tesi presenta la migrazione incrementale del dominio utente dal monolite UX-Engine — una piattaforma di personalizzazione e content discovery sviluppata da ContentWise/Moviri, con oltre 100 milioni di utenti a livello globale — verso un microservizio dedicato basato su Spring Boot. La migrazione è guidata dallo Strangler Fig Pattern e dal Domain-Driven Design, con il dominio utente identificato come sottodominio di supporto il cui elevato accoppiamento e la logica dispersa lo rendevano una delle aree più difficili da manutenere nell'intero sistema. Il nuovo servizio reimplementa tutte le operazioni rivolte agli utenti — creazione, recupero, aggiornamento, rinomina, cancellazione della cronologia e gestione delle preferenze — preservando lo schema del database esistente e il comportamento osservabile del sistema legacy. Il database condiviso è stato mantenuto come scelta architetturale deliberata, per consentire la coesistenza tra il monolite e il nuovo servizio durante il periodo di transizione. Tra le principali sfide implementative affrontate figurano lo schema EAV-like ereditato dalla Moviri Application Library, un problema di concorrenza di tipo lost update risolto tramite pessimistic locking, e il problema del dual write analizzato attraverso il transactional outbox pattern e il Change Data Capture con Debezium. L'operazione di cancellazione della cronologia utente è analizzata come un flusso intrinsecamente cross-domain, con il Saga pattern identificato come soluzione corretta nel lungo periodo. Il servizio è stato containerizzato e distribuito su AWS EKS tramite un workflow GitOps con ArgoCD. La validazione è stata condotta attraverso unit test, test funzionali API eseguiti sulla suite di test esistente di ContentWise, test di performance con Gatling e un framework di characterization testing personalizzato basato sul confronto di snapshot del database. I risultati confermano l'equivalenza comportamentale con il sistema legacy, performance comparabili al monolite nonostante l'overhead di rete aggiuntivo introdotto dal deployment su Kubernetes, e miglioramenti misurabili della qualità del codice su tutte le dimensioni dell'analisi statica.
Migrating the user domain from a monolithic recommendation platform to a microservice architecture
Lucca, Simone
2025/2026
Abstract
This thesis presents the incremental migration of the user domain from the UX-Engine monolith — a large-scale personalization and content discovery platform developed by ContentWise/Moviri and serving over 100 million users globally — into a dedicated Spring Boot microservice. The migration is guided by the Strangler Fig Pattern and Domain-Driven Design, with the user domain identified as a supporting subdomain whose tight coupling and dispersed logic made it one of the most challenging areas of the system to maintain. The new service reimplements all user-facing operations — creation, retrieval, update, rename, history deletion, and preference management — while preserving the existing database schema and the observable behavior of the legacy system. The shared database was retained as a deliberate architectural trade-off to enable coexistence between the monolith and the new service during the transition period. Key implementation challenges addressed include the EAV-like schema inherited from the Moviri Application Library, a lost-update concurrency problem resolved through pessimistic locking, and the dual-write problem analyzed through the transactional outbox pattern and Change Data Capture with Debezium. The delete user history operation is analyzed as an inherently cross-domain workflow, with the Saga pattern identified as the correct long-term solution. The service was containerized and deployed on AWS EKS via a GitOps workflow with ArgoCD. Validation was performed through unit tests, functional API tests against the existing ContentWise test suite, performance tests with Gatling, and a custom characterization testing framework based on database snapshot comparison. Results confirm behavioral equivalence with the legacy system, performance comparable to the monolith despite the additional network overhead of a Kubernetes deployment, and measurable improvements in code quality across all static analysis dimensions.| File | Dimensione | Formato | |
|---|---|---|---|
|
SimoneLuccaThesis.pdf
accessibile in internet per tutti
Descrizione: This thesis presents the incremental migration of the user domain from the UX-Engine monolith — a large-scale personalization and content discovery platform developed by ContentWise/Moviri and serving over 100 million users globally — into a dedicated Spring Boot microservice. The migration is guided by the Strangler Fig Pattern and Domain-Driven Design, with the user domain identified as a supporting subdomain whose tight coupling and dispersed logic made it one of the most challenging areas of the system to maintain.The new service reimplements all user-facing operations — creation, retrieval, update, rename, history deletion, and preference management — while preserving the existing database schema and the observable behavior of the legacy system. The shared database was retained as a deliberate architectural trade-off to enable coexistence between the monolith and the new service during the transition period. Key implementation challenges addressed include the EAV-like schema inherited from the Moviri Application Library, a lost-update concurrency problem resolved through pessimistic locking, and the dual-write problem analyzed through the transactional outbox pattern and Change Data Capture with Debezium. The delete user history operation is analyzed as an inherently cross-domain workflow, with the Saga pattern identified as the correct long-term solution. The service was containerized and deployed on AWS EKS via a GitOps workflow with ArgoCD. Validation was performed through unit tests, functional API tests against the existing ContentWise test suite, performance tests with Gatling, and a custom characterization testing framework based on database snapshot comparison. Results confirm behavioral equivalence with the legacy system, performance comparable to the monolith despite the additional network overhead of a Kubernetes deployment, and measurable improvements in code quality across all static analysis dimensions.
Dimensione
2.19 MB
Formato
Adobe PDF
|
2.19 MB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/258317