About db separation(1)
This is a post about Db separation.
In my company, we use two DBs, one for log records and one for services. During development, I became curious about why we separate the DBs.
Benefits of separating DBs by purpose
- Performance and scalability: The DB for service should be focused on storing and processing key business data. The DB for log recording often consists of a large amount of small-sized data, and if logs are stored in the DB for service, performance may be affected. Separating the DB for log recording allows you to apply specialized settings and structures to the loading and processing of log data, improving performance and scalability.
- Data security: Logs can be used primarily for debugging, auditing, and analyzing purposes, so storing logs with sensitive business data on the same division can be a security issue. Separating DBs for log recording allows you to independently configure access control and security settings for log data.
- operation and maintenance: The DB for service handles the main business logic, so you need to perform tasks such as maintenance, performance optimization, and backup. By separating the DB for log recording, you can perform log management tasks without affecting the work of the main service division. In addition, by managing log data separately, you can focus more on log management tasks.
- Analysis and monitoring: Log data provides important information about system behavior and troubleshooting. By keeping log divisions separate, you can easily analyze and monitor log data. You can use log analysis tools and visualization tools to gain useful insights from log data, which can help you monitor and improve system performance, user behavior, errors, and more.
Conclusion
By separating the DB for recording logs from the mainstream division, you can gain benefits in terms of performance, security, operations and maintenance, and analytics and monitoring.
Now you know the benefits of separating DBs. Now, in our case, we are using different services for our two DBs (AWS S3, MongoDB), and I will explain why we are using different services in part 2.