Reputation: 29760
So we have a system, this system writes huge amounts of data to a logging DB. This data is only read when something goes wrong, the rest of the time it's sat their just in case.
This data is currently stored in a SQL Server DB in the following structure:
So I'm thinking would this be more efficently stored in a NoSQL system, like MongoDB
As far as I can see, from reading several articles(here and here for example), this has the following advantages
So my question(s) are predominately does this fit do we think?
Particuarly
Upvotes: 2
Views: 1578
Reputation: 678
If you're storing logging data, why not use Logstash? Logstash uses Elasticsearch as storage and both writes and queries are very fast and it also scales well. Couple Logstash with http://kibana.org/ and you've got yourself your own personal log analysis and querying dashboard.
MongoDB is not a bad choice either. Some really good logging and exception apps like Errbit use MongoDB as the backend.
When using mongodb for vigorous logging it helps to send data from ur application to a middleware on the udp port which in turn writes to mongo. That way there is almost 0 wait for writes to happen. The advantage is that while the udp port receives the data and lets your app resume, the middleware can do safe writes to mongo, thus making sure log integrity is maintained.
Upvotes: 1
Reputation: 7275
From my experience Mongo does ok with writes, but it's not spectacular. At a previous job, our production instance struggled quite a bit more with writes than reads.
Mongo is very aggressive with allocating files on disk. Read this: http://docs.mongodb.org/manual/faq/storage/#why-are-the-files-in-my-data-directory-larger-than-the-data-in-my-database
Eventually Mongo tries to grab 2GB at a time even if your database is empty.
From my experience I found deletes to be pretty efficient. No real complaints, but then again we weren't deleting a lot of data.
The horizontal scaling from my experience was pretty chatty, but it has to be to replicate data. The thing to read about is the difference between using a replica set or using sharding. The replication model/network activity is pretty different between the two.
We used Mongo mostly for efficient reads and it did really well with that.
Upvotes: 2