Mongodb @ vrt

11
1 MongoDB @ VRT

Transcript of Mongodb @ vrt

Page 1: Mongodb @ vrt

1

MongoDB @ VRT

Page 2: Mongodb @ vrt

2

Content

▪ Status▪ Technology Stack▪ MongoDB Technology Stack▪ How we Use MongoDB

Page 3: Mongodb @ vrt

3

m.redactie.be

▪ Yes, we are Live▪ Please check the website later, not now ;-)

Page 4: Mongodb @ vrt

4

Technology Stack

▪ AngularJS

▪ Spring MVC / REST

▪ MongoDB

Page 5: Mongodb @ vrt

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?

Page 6: Mongodb @ vrt

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

Page 7: Mongodb @ vrt

77

How we use it

Page 8: Mongodb @ vrt

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

Page 9: Mongodb @ vrt

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

Page 10: Mongodb @ vrt

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

Page 11: Mongodb @ vrt

1111

Questions ?