Mongo chicago

Post on 18-May-2015

854 views 1 download

Tags:

Transcript of Mongo chicago

Our Adventure WithMongoDB, Rails & Friends

Mongo ChicagoOctober 2010

Ethan Gundersonhttp://ethangunderson.com

Twitter & Github: ethangunderson

http://gathers.us

Our Agenda1) gathers.us2) Why Mongo3) Choosing an ODM4) Data modeling5) Takeaways6) Q & A

Manage events

Manage your groups(coming soon)

Aggregate your social content(coming soon)

High ValueGroupsEventsRSVPs

Low ValueSocial Events

Data needs

Our Agenda1) gathers.us2) Why Mongo3) Choosing an ODM4) Data modeling5) Takeaways6) Q & A

Document data model

Read heavy

Reads

Writes

Scaling With MongoDB - 2:45

The real reasonI won an argument

Our Agenda1) gathers.us2) Why Mongo?3) Choosing an ODM4) Data modeling5) Takeaways6) Q & A

Rails loves

MongoMapperMogoDoc

MongoidMongomatic

Candy

Lotʼs of options for Rails integration

The strait Mongo Ruby driver!We chose ...

ORMs are worthless if you donʼt understand what theyʼre doing.

Simple to use

Learn your tools

We avoided one until it became too painful not to use one.

In the end, we choseMongoid

Rails 3 support

Nice query syntax

Safe mode

Master / Slave

Rapid development

Our Agenda1) gathers.us2) Why Mongo3) Choosing an ODM4) Data modeling5) Takeaways6) Q & A

Our data model

Introducing groups

Option 1

Option 2

YEAH!!

This idea actually sucks

Mongoʼs 4MB 8MB document limit

Among other things, it keeps people like us, from doing things like that.

In reality, documents shouldnʼt be bigger than ~250kb

1) updating on the server2) transferring across the network3) serializing to and from BSON

Inefficient when...

Querying for single eventsCan’t pull back a single event

Option 3single collection inheritance

Mongoid Support

Mongoid Support

Easy querying

Top level objects are stilltop level objects

Moral of the story is,data modeling is still hard

Our Agenda1) gathers.us2) Why Mongo3) Choosing an ODM4) Data modeling5) Takeaways6) Q & A

Takeaways1) Analyze your data needs2) Learn the API3) Data modeling is (still) hard

Our Agenda1) gathers.us2) Why Mongo3) Choosing an ODM(?)4) Data modeling5) Takeaways6) Q & A

http://spkr8.com/t/4864Q & A