YouSub
Untitled

en English

Untitled English subtitles

0 downloads · 54 lines · added Nov 21, 2015

Report a problem
What's wrong?
Advertisement

English transcript

Hello.
My name is Justin Lee, and I'm a software engineer here
with MongoDB.
I work on the Java driver team and I also
work on the Morphia project which we'll discuss today.
But before we get into that, I wanted
to give a brief introduction into what is an ODM or object
document mapper.
If you're coming from the relational world,
you've probably used something similar.
But in essence, what an ODM is if you have your database here,
which is lovely, your application's off over here
with your objects, and you can have
from a handful to hundreds of these depending
on your application.
What normally has to happen is if you have your driver,
your application code has to know
how to take your Java objects, translate them into a form
that the driver knows how to handle,
and then the driver can then shuttle data back and forth
to the database.
What an ODM gets you is it sits in between your application
code and the driver so that you tell the ODM how
to handle your classes and you just hand off your objects
to the ODM and then the ODM then speaks to the driver.
And this has a number of advantages.
It helps shield you from some of the drivers changes
so as the API and the driver changes,
you're a little bit sheltered from those.
But more importantly, the low level details
of what it takes to work with a driver
can sometimes be overwhelming and complicated
depending on what you're doing.
And an ODM can really help simplify
that, providing a nice Java API on top
of which you can write your application
and you don't need to be so terribly concerned with all
the inner workings of the Mongo query language, for example.
Now some reasons for not using an ODM, in the interest
of fairness, is an ODM is typically
a very generic framework.
It's designed to work on virtually any code base
and so there are certain inefficiencies
that arise out of that because, in the case of Java,
it tends to use a lot of reflection
to get data in and out of your Java objects.
And that can be a performance concern for some.
And so some prefer to write directly to the Java driver
and that's perfectly valid.
But for a lot of people, an ODM is perfectly suitable
and works rather well in their case.
So with what an ODM is out of the way,
let's take a deeper look at what Morphia itself is
and what it offers.

Need subtitles from another video?