The document discusses how MongoDB is used at VRT (the Belgian public broadcasting organization):
- MongoDB version 2.4.9 is used with a replica set of 1 primary and 4 secondaries and secondary preferred read preference.
- On the application side, JavaDriver 2.12 is used with no ORM, just BasicDbObject and QueryBuilder. Integration testing uses NoSQL Unit to insert test data and check results.
- On the database side, all queries are indexed for performance and the replica set provides eventual consistency suitable for their application. System profiling and query explaining are used to determine useful indexes.
5. 5
MongoDB: Technology Stack
▪ MongoDB version 2.4.9
- 2.6 is going to be investigated after the elections 25/05
▪ RoboMongo (http://robomongo.org/) and the mongo-shell are used as
view on the DB.
- Downside of RoboMongo : "copy JSON" produces invalid JSON =>
ISOdate and ObjectID
- Change is underway but RoboMongo is written in C++ so can't help, feel
free to do so
- Will check for alternatives later, anyone already experience with others?
6. 6
How We Use It
▪ JavaDriver 2.12
▪ No ORM, hardcore java FTW
▪ BasicDbObject and QueryBuilder, latter provides a fluent api (add
example)
Application Side
8. 8
How We Use It
▪ NoSQL Unit https://github.com/lordofthejars/nosql-unit/
▪ UsingDataSet and @ShouldMatchDataSet uses JSON files to insert
data and check data
▪ Created custom comparison strategy for more fine grained control of
what and how to check the resulting data se
Integration Testing
9. 9
How We Use It
▪ Replica set :
- 1 primary
- 4 secondaries
- Read-preference : secondary preferred
- Eventual consistency is ok for our application
▪ No sharding (yet?)
DB Side
10. 10
How We Use It
▪ All queries are indexed, dramatical increase of performance
- not covered queries, to much data, sometimes big articles
- if data-set fits in RAM, full-covered query has small to no performance gain
- indexes created based on profiling (system.profile) and query.explain. Use
it, the knowledge you get from is extremely useful.
DB Side