Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are good NoSQL and non-relational database solutions for audit/logging database

What would be suitable database for following? I am especially interested about your experiences with non-relational NoSQL systems. Are they any good for this kind of usage, which system you have used and would recommend, or should I go with normal relational database (DB2)?

I need to gather audit trail/logging type information from bunch of sources to a centralized server where I could generate reports efficiently and examine what is happening in the system.

Typically a audit/logging event would consist always of some mandatory fields, for example

  • globally unique id (some how generated by program that generated this event)
  • timestamp
  • event type (i.e. user logged in, error happened etc)
  • some information about source (server1, server2)

Additionally the event could contain 0-N key-value pairs, where value might be up to few kilobytes of text.

  • It must run on Linux server
  • It should work with high amount of data (100GB for example)
  • it should support some kind of efficient full text search
  • It should allow concurrent reading and writing
  • It should be flexible to add new event types and add/remove key-value pairs to new events. Flexible=no changes should be required to database schema, application generating the events can just add new event types/new fields as needed.
  • it should be efficient to make queries against database. For reporting and exploring what happened. For example:
    • How many events with type=X occurred in some time period.
    • Get all events where field A has value Y.
    • Get all events with type X and field A has value 1 and field B is not 2 and event occurred in last 24h
like image 250
Juha Syrjälä Avatar asked May 05 '10 14:05

Juha Syrjälä


People also ask

Which database is best for storing logs?

Apache HBase is the Hadoop database. It is also a distributed, scalable, big data store. It's very convenient to store logs in and it has real-time read/write access to your data.

Is MongoDB good for logging?

The data can be used and stored without worrying about relationships or tables. And for diagnosing issues, monitoring your deployment, and fine tuning performance, MongoDB Logs are useful. Big businesses widely use MongoDB, and it's understandable why. MongoDB is quicker than a SQL database and is simple to scale.

Which is better NoSQL or relational database?

Relational databases store data in a very organized, but also rigid way. NoSQL, earning it's name by being “not only SQL” makes it easier to store all different types of data together. It's used for its flexibility and therefore speed and scalability in managing large volumes of data.


2 Answers

The two I've seen used successfully are MongoDB and Cassandra.

like image 120
Doobi Avatar answered Nov 09 '22 14:11

Doobi


should I go with normal relational database (DB2)?

Yes, you should! If you just want to store stuff and scan it, you might as well write to a file. Very fast, no overhead! But the minute you want to summarize data over time (last 24h, or between time t and t+1), the more you care about the data as something other than lines of text, no question a proper RDBMS is your friend.

like image 30
James K. Lowden Avatar answered Nov 09 '22 12:11

James K. Lowden