Papers
Articles
Dissertations
144.000.000
NoSQL
no ␣ SQL
S3
...
Mongo
♥Mongo
♥Scala
1
Scala
  ⬍
Mongo
Java driver
✗ Easy to use, hard to misuse
✗ When in Rome, do as the romans do
✗ Don't make the client do anything
  the library could do
Java driver
✗ Easy to use, hard to misuse
✗ When in Rome, do as the romans do
✗ Don't make the client do anything
  the library could do                ☑
Casbah
✗ Easy to use, hard to misuse
✓ When in Rome, do as the romans do
✗ Don't make the client do anything the library
    could do
✗   Obey the principle of least astonishment
Casbah
✗ Easy to use, hard to misuse
✓ When in Rome, do as the romans do
✗ Don't make the client do anything the library
    could do
✗   Obey the principle of least astonishment
                      Leaky abstractions
codes: [ “foo”, “bar” ]


obj.as[BasicDBList]("codes")
  .toList
  .map(_.asInstanceOf[String])

  Don’t make me think
Casbah:
coll.findOne(“name” $ne “wilfred”)

Mongo:
db.coll.findOne({ name : { $ne : “wilfred” } })

☹ Casbah:
coll.findOne(
  MongoDBObject(“name” -> “wilfred”)
)
             Don’t make me think!
Mongo:
db.coll.findOne({ name : “wilfred”})
Casbah
✗ Easy to use, hard to misuse
✓ When in Rome, do as the romans do
✗ Don't make the client do anything the
✗
    library could do
    Obey the principle of least
    astonishment
                                          ☑
Salat
✗ Easy to use, hard to misuse
✓ When in Rome, do as the romans do
✓ Don't make the client do anything the
✗
✗
✓
    library could do
    Obey the principle of least astonishment
    Control
    Symmetry
                                               ☒
Rogue
Beaucatcher
    Lift
 Subset ?
Homegrown
obj.insert[Metadata]
 ("metadata", doc.metadata)

obj.extract[Metadata]
 ("metadata")

       Doesn’t make me think!
2
Versioning
Version 1
            {
                street: “Lingedijk”,
                housenumber: 132
            }


                            ⬍
Version 2




            { address: “Lingedijk 132” }
{
    version: 1,
    street: “Lingedijk”,
    housenumber: 132
}                            Read time
                 ➡         reconciliation

     Memory
{
                 ➡
    version: 2,
    address: “Lingedijk 132”
}
Rollback
3
Object
mapping
Subclasses in
different collections
Conclusion
♥ Scala
♥ Mongo
☹ Libraries
✎ Versioning D.I.Y.
☼ Composition

Mongo