To control various workloads, a Real-Time Database Management System (RTDMS) serves as a framework for executing transactions. Database management systems support both the storage and recovery of data across various application services. However, since security and Quality of Service (QoS) are evaluated separately during user transactions, the performance of these transactions has not been optimized. To address these issues, this paper incorporates both security strength and QoS optimization. In this paper, workload conditions during user transactions in real-time database systems are managed using the Adaptive Chimp Optimization Algorithm (AChOA). This algorithm enhances the security strength of the RTDMS by optimally selecting the security policy based on user requests. Additionally, the search performance of the Chimp Optimization Algorithm (ChOA) is improved through the use of a chaotic series generator with tent mapping. Moreover, an Intrusion Detection and Protection System (IDPS) with a high detection rate is implemented to improve response time. Simulation results demonstrate that the proposed scheme achieves better security strength and response time.