1 of 13

MongoLab

for Mobile Developers

Peter Traeg - March 24, 2012

2 of 13

Cloud based database solution

  • Based on MongoDB
  • REST based interface database interaction
  • Free 250MB database accounts
  • Good for simple apps where you don't want to write a lot of server side code.
  • http://www.mongolab.com

3 of 13

MongoDB - What is it?

  • Powerful "No SQL" database
  • Used for very large databases:
    • Foursquare
    • Shutterfly
    • Craigslist
    • Intuit
    • Forbes
  • Based on storing JSON documents

4 of 13

Terminology

Databases

Collections

Documents

5 of 13

MongoLab - REST interface

Simple REST interface for CRUD operations:

  • Create (HTTP POST)
  • Read (HTTP GET)
  • Update (HTTP PUT)
  • Delete (HTTP DELETE)

Security is limited to your API key

6 of 13

Sample JSON data

[

{

"id":"ABC12",

"fname":"Peter",

"lname":"Johnson",

"email":"pete@acme.com",

"state":"NY"

},

{

"id":"ABC13",

"fname":"Mary",

"lname":"Jones",

"email":"mary@apple.com",

"state":"CA"

}

]

7 of 13

REST API Examples

8 of 13

REST API Examples

9 of 13

REST API Examples

10 of 13

MongoDB Features

Geolocation searches - used by Foursquare

Indexes on attributes of a document

Ability to aggregate documents

  • Aggregation Framework
  • Map / Reduce

Queries can span documents across collections

11 of 13

Issues with the REST based API

Limited security

Shared API key across databases

REST API is specific to MongoLab

Not all Mongo features are exposed.

12 of 13

Resources

mongolab.com

mongohq.com

10gen.com - creators of MongoDB

13 of 13

The End