In case you are interested in learning about MongoDB or generally curious about non-relational approaches to storage of data then my recommendation for you is to check out the online courses offered by MongoDB Incorporation. I promise you won’t be disappointed. MongoDB Inc’s educational department – MongoDB University – offers five courses for developers and dev ops:
- MongoDB for Python Devs (next session Sep 9 2014)
- MongoDB for Java Devs (next session Aug 5 2014)
- MongoDB for node.js Devs (next session Aug 12 2014)
- MongoDB for DBAs (next session Jul 15 2014)
- MongoDB Advanced Deployment and Operations (next session Jul 15 2014)
MongoDB for Java Developers
Personally I would have preferred to take the Python course but when I decided to get started only the Java course was available. And this is actually one of the reasons why I am so amazed about this course and how thoughtfully it was crafted. The thing is, last time I used Java was about 12 long years ago, and all that was left about it in my brain was the general syntax and of course the OO concepts. But the challenge about Java – compared to most other languages – is anyway not the language itself but the ecosystem you need to set up to simply start programming. To make a long story short – I actually got Maven, Spark and FreeMarker working and that thanks to how well the tutors guided me and the rest of the massive open online crowd. What followed was even more fun because in the course of the following 7 weeks I got thoroughly introduced to MongoDB and how it is used. The main use case is a blog web-site which is built using Spark and FreeMarker – but don’t worry the blog is provided and it will be just necessary to edit the parts working specifically with MongoDB.
The Course Outlined
- Week 1: Setting up Java stuff and MongoDB
- Week 2: CRUD on the Mongo shell
- Week 3: Schema Design – the document concept
- Week 4: Performance tuning with indexes and monitoring
- Week 5: The aggregation framework – Grouping and friends
- Week 6: Distributed MongoDB applications – sharding and replication
- Week 7: Interviews with CTOs from foursquare and codeacademy
- Week 8: Final exam
The usual MOOC technology – bite-sized lecture clips, quizzes after lectures, terminated homework assignments and a final exam – which btw struck me as surprisingly sophisticated – will make sure that your time is well invested and you will gain ready-to-use knowledge waiting to be applied. And of course – the best part is – if you stick through with the course until the end you will be rewarded with a verifiable certificate.
Java on Linux
In case you are working with Ubuntu or some other Linux flavour – let me spare you the gory details, the sweat and the pain – use the free and marvellous Community Edition of Jetbrain’s IntelliJ – simply forget about Eclipse or Netbeans.
My Five Cents
Personally I find the JSON-based command line syntax pretty damn clumsy. It is really hard to write non-trivial commands on the MongoDB shell. Forcing the intended expressions into a JSON-frame sometimes feels like wearing a straight jacket. Let me give you a very simple example:
1 |
db.scores.find({ score : { $gte : 50 , $lte : 60 } } ); |
I mean – why not simply something similar to this?
1 |
db.scores.find(score >= 50 and score <= 60) |
… or …
1 |
select * from scores where score between 50 and 60 # ;-) |
… I just made that up – but I think you get my point. And this is a very small expression. More complex conditions especially when applied in context of the aggregation pipelining will make you miss good old SQL! Sorry for the complaints – MongoDB is without doubt a great choice when relationality handicaps scaling or your data is simply lacking a schema!
(original article published on www.joyofdata.de)