本文介绍了哪个 NoSQL 数据库最适合仅追加审计日志用例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的用例是对资源进行审计日志记录.讨论时考虑一个非常简单的模式:资源名称、访问时间戳和访问用户名.有了所有的 NoSQL 选项,我想知道哪种解决方案最适合我的用例?

My use case is audit logging for resources. For discussion consider a very simple schema: a resource name, access time stamp, and accessing user name. With all the NoSQL options out there, I'm wondering which solution is best for my use case?

资源名称保存在图形数据库 (Neo4j) 中,虽然我们可以向连接到资源顶点的审计顶点添加顶点和边,但审计信息可能很大,我担心会污染相对简单的图形.

The resource names are being held in a graph database (Neo4j) and while we could add vertices and edges to an audit vertex connected to the resource vertex, the audit info could be large and I fear pollute a relatively simple graph.

我目前倾向于使用文档数据库,例如 MongoDB 或 Couchbase,其中每个资源都有自己的文档,审计日志是该文档中的一个简单数组,它被附加到.我担心 I/O 可能会成为一个问题,因为审计日志会变长并且整个文档必须在应用服务器和数据库之间交换.我认为最小化这种情况的一个方法是让每个审计条目成为自己的文档,并将其 ID 附加到父资源文档数组.

I'm currently leaning towards a document database such as MongoDB or Couchbase in which each resource has it's own document, and the audit log is a simple array within this document that gets appended to. I fear that I/O could become a problem as audit logs get long and the entire document must be exchanged between app server and database. One soultion I see to minimize this is to make each audit entry its own document and append its ID to the parent resource document array.

目前不需要搜索审计日志,但我觉得有了文档数据库,我觉得以后有一个很好的方法来集成 Elastic Search.

Search audit logs is not a requirement at this time, but with a document database I feel there is a nice path to integrate Elastic Search at a later time.

似乎 Redis 可能更适合我的用例,但数据持久性没有其他解决方案那么严格.

It seems Redis may be a bit more optimal to my use case, but the data persistence does not appear as rigorous as other solutions.

从概念上讲,我想我正在寻找任何支持追加"API 方法调用而无需交换太多信息的 NoSQL 解决方案.具有讽刺意味的是,这基本上是一个 SQL INSERT 语句,但我担心传统的 RDBMS 无法满足我的规模要求.审计表会很快变大,我宁愿利用最新最好的 NoSQL 方法进行分区/分片.

Conceptually, I guess I am looking for any NoSQL solutions that support an "append" API method call without needing to exchange much information. Ironically this is basically a SQL INSERT statement, but I fear a traditional RDBMS will not meet my scale requirements. The audit table would get huge fast and I would rather leverage the latest and greatest NoSQL approaches to partitioning / sharding.

对日志附加用例的任何见解表示赞赏!

Any insights into log append use cases are appreciated!

这些似乎是类似的 SO 问题:

These seem to be similar SO questions:

审计日志的数据库设计

用于审计数据的 NoSQL 或 RDBMS

谢谢,贾里德

推荐答案

Apache Kafka 是面向日志的,高度可扩展,允许以多种不同方式订阅消息.

Apache Kafka is log-oriented, highly scalable and allows for subscribing to messages in multiple different ways.

这篇关于哪个 NoSQL 数据库最适合仅追加审计日志用例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 03:29