# Migrating from Developing Asynchronous Multi-Threading Programs to Reactive Programs in Java
## 5 Proposed Solution  
### Architecture  
The project is based on a microservices architecture that simulates the minimal backend of a social media platform, designed to demonstrate multiple scenarios and allow for a more detailed comparison between the asynchronous and reactive programming paradigms. The architecture leverages multiple core services, each with distinct functions within the application ecosystem. Figure 1 provides a detailed representation of the employed architecture, highlighting both the individual components and the established interconnections.  
The Gateway Service represents the application's entry point, allowing incoming requests to be routed to the appropriate services. It is also responsible for the validation process within the mechanism used for authentication and authorization, based on the JWT token standard [48; 49]. This ensures a centralized authentication process, removing  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Section** & **Summary** \\ \hline
4.1. Microservices & Explores microservices’ benefits for scalability and maintainability, \\  & noting challenges in transitioning from monolithic systems. \\ \hline
4.2 The Reactive Manifesto & Summarizes the core principles of reactive systems: responsiveness, \\  & resilience, elasticity, and message-driven communication. \\ \hline
4.3 Spring Boot and Spring WebPlux & Highlights WebPlux’s advantages for non-blocking web applications \\  & and Spring Boot’s ease of use for rapid development. \\ \hline
4.4 Performance and Cost Analysis & Compares RxJava and Project Reactor, emphasizing their respective \\  & strengths in individual operations and event stream processing. \\ \hline
4.5 Adoption of Reactive Programming & Details adoption strategies employed by companies, showcasing \\  & reactive programming’s scalability and efficiency. \\ \hline \hline \end{tabular}
\end{table}
Table 4: Summary of the current state of technology.  
validation pressure from downstream services by simplifying their involvement to only perform the extraction and post-processing steps of the required token data.  
The User Service is responsible for managing all aspects related to the user, including the initial login process, issuing the JWT tokens, user registration, the handling of profile information, and any profile updates. Although not as diverse in terms of dedicated use cases, it is an integrated part of operations delegated to other services, which must retrieve additional user information to perform the computations and fulfill the requests.  
The Tweet Service manages message-related operations, such as the creation, modification, deletion, and retrieval of user messages. It is also responsible for handling the tokenization and extraction of mentions and tags, as well as generating the user content, by aggregating all the necessary data and computing it into operable results.  
The Interaction Service enables interactions within the social media platform between users, allowing the management of subscriptions, acknowledgments, shares, and replies, therefore adding a degree of dynamism and user engagement.  
This architecture adheres to the \"database-per-service\" microservices pattern [50], ensuring the independence and scalability of individual components. Each service leverages its dedicated instance of a relational database while also incorporating a caching mechanism for guaranteed performance by minimizing database read operations and inter-service exchange of recently computed information.