单独的生产数据库用于记录 [英] Separate production database for logging

查看:120
本文介绍了单独的生产数据库用于记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试中的应用程序,它将部门Windows窗体应用程序的事件记录到SQL Server数据库中.该应用程序几乎可以投入生产了.日志记录数据库与应用程序数据库完全分开.

I've got an application in test that's logging events for a departmental Windows forms application to a SQL Server database. The application is nearly ready for production. The logging database is completely separate from the application database.

我的问题是,我真的需要创建日志记录数据库的生产版本,还是可以仅将生产和测试事件记录到同一数据库中?明显的答案是肯定的,我当然需要一个单独的数据库.您永远都不希望测试和生产环境混合在一起.但是在这种情况下,写入数据库的数据实际上并不是真正的生产数据,而只是记录了我们用来解决问题的详细信息.它没有业务价值,并且如果不小心删除了数据或数据库暂时不可用,也不会造成任何重大损失.并且将其全部置于测试环境中将使我的管理变得更加简单.

My question is, do I really need to create a production version of the logging database, or can I just log production and test events to the same database? The obvious answer is yes, of course I need a separate database. You never want test and production environments to mix. But in this case, the data being written to the database isn't really production data, exactly, it's just logging details that we use to troubleshoot problems. It has no business value, and nothing significant would be lost if the data were to be inadvertently dropped or the database were to be temporarily unavailable. And having it all in a test environment would make it much simpler for me to manage.

因此,在所有环境中使用单个日志记录数据库利弊似乎是一个更好的解决方案.但这感觉不对.有人可以告诉我为什么这是个坏主意的具体原因吗?

So on a pros and cons basis using a single logging database for all environments seems like a better solution. But it just doesn't feel right. Can anybody give me any specific reasons why this is a bad idea?

推荐答案

如果您的开发服务器已关闭,而prod却没有,则您的日志记录可能无法正常工作.可以保证将在您需要登录的重要产品发生时发生.在我们的情况下,prod和dev不在同一个物理位置,这意味着通过我们的网络发送日志记录数据,并导致管道瓶颈和胡思乱想的网络专家.

Your logging may not work if your dev server is down but prod isn't. Can guarantee that will be when something critical you need logged on prod will happen. In our case prod and dev are not in the same physical location which would mean sending logging data across our network and cause pipeline bottlenecks and cranky network guys.

此外,如果您决定更改日志记录过程该怎么办?在进行新开发时,整个生产过程可能会中断.

Plus what if you decide to change the logging process? While you are doing new development, the entire prod process might break.

有时候,有些人可能会阅读车床日志,由于某些错误而惊慌失措,忘记了它发生在开发人员身上.或更糟糕的是,有人可能会看到一个错误的错误,他们认为该错误实际上是在产品上发生的,而在开发人员中发生了.

And there will be times when someone might read lthe logs, panic at some error forgetting that it happened on dev. Or worse, someone might see a bad error that they thought was happening on dev that was really happening on prod.

这篇关于单独的生产数据库用于记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆