Micro-service Allocation in Multi-thread Architectures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing service processing methods in multi-thread architectures face performance deterioration due to synchronous processing, which leads to long wait times and overhead, while asynchronous processing lacks consistency.
Innovation Solution
A method that allocates service IDs and micro-services to worker threads in a multi-thread architecture, allowing for asynchronous processing and maintaining consistency by allocating micro-services to worker threads regardless of processing completion, and rolling back services upon failure.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If synchronous processing method is used, then consistency is ensured, but processing performance deteriorates due to long wait times and overhead
Solution Approach 1:
The service processing is divided into multiple micro-services that can be processed independently by different worker threads. Each micro-service is a discrete unit that can be allocated separately, allowing parallel processing while maintaining consistency through the control thread's coordination.
Solution Approach 2:
The system dynamically allocates micro-services to worker threads based on current processing state and availability. The control thread continuously monitors and reassigns micro-services, making the system adaptable to changing conditions while ensuring consistent processing outcomes.
2Productivity
If asynchronous processing method is used, then processing performance improves by eliminating wait times, but consistency cannot be ensured
Solution Approach 1:
The control thread continuously monitors the processing state of micro-services and receives feedback from worker threads. Based on this feedback, the control thread can detect incomplete processing and reassign micro-services to ensure consistent completion, thereby maintaining reliability in an asynchronous environment.
Solution Approach 2:
The control thread pre-allocates micro-services to worker threads before actual processing begins, and prepares reassignment strategies in advance. This preliminary organization enables rapid response to processing states while maintaining systematic consistency control.
3Productivity
If micro-services are allocated to worker threads regardless of processing completion, then productivity increases through parallel processing, but thread-to-thread lock contention occurs
Solution Approach 1:
The control thread acts as an intermediary between worker threads, managing the allocation and reassignment of micro-services. This intermediary coordinates thread activities, reduces direct interactions between worker threads, and minimizes lock contention by centralizing control decisions.
Data Source
AI summary
Disclosed is a method for controlling a database service for processing a service according to an exemplary embodiment of the present disclosure. Operations stored in a computer program for processing the method include: an operation of allocating, by a control thread, a service ID for each of one or more received services and identifying one or more micro-services included in each service; an operation of allocating, by the control thread, a micro-service for a first service among the one or more services to one worker thread among one or more worker threads; an operation of allocating, by the control thread, the micro-service of a second service to the worker thread or another worker thread regardless of whether to receive a processing result of the micro-service of the first service from the worker thread; and an operation of allocating, by the control thread, a next micro-service of the micro-service of the first service to the worker thread or another worker thread when receiving the processing result of the micro-service from the worker thread.


