+ All Categories
Home > Documents > Rapid Development with Schemaless Data Models

Rapid Development with Schemaless Data Models

Date post: 07-Nov-2014
Category:
Upload: mongodb
View: 488 times
Download: 1 times
Share this document with a friend
Description:
 
Popular Tags:
30
Rapid Development with Schema-less Data models Keith Chilek SVP, Engineering
Transcript
Page 1: Rapid Development with Schemaless Data Models

Rapid Development with Schema-less Data models Keith Chilek SVP, Engineering

Page 2: Rapid Development with Schemaless Data Models

The online professional network for students and early professionals

3/8/13 | 2

Page 3: Rapid Development with Schemaless Data Models

With our data & tools, our members can better

Manage their education

Tell their story

Get a job

3/8/13 | 3

Page 4: Rapid Development with Schemaless Data Models

Growth

Technology Stack What is the MyEdu Profile?

MongoDb vs MySQL Decision Version 1 Using MongoDB

Learning From Our Mistakes

3/8/13 | 4

Page 5: Rapid Development with Schemaless Data Models

3/8/13 | 5

6,000,000

5,000,000

4,000,000

3,000,000

2,000,000

1,000,000

0

7,000,000

8,000,000

9,000,000

Jul 2012

Aug 2012

Sep 2012

Oct 2012

Nov 2012

Dec 2012

Jan 2013

We’re Building for Growth

Page 6: Rapid Development with Schemaless Data Models

MyEdu’s Technology Stack

Javascript

Scripting

Middleware

Database

3/8/13 | 6

Page 7: Rapid Development with Schemaless Data Models

3/8/13 | 7

Page 8: Rapid Development with Schemaless Data Models

“The only constant is change, continuing change, inevitable change, that is the

dominant factor in society today.

No sensible decision can be made any longer without taking into account not only

the world as it is, but the world as it will be.”

Isaac Asimov

3/8/13 | 8

Page 9: Rapid Development with Schemaless Data Models

MongoDB vs MySQL

Move fast, iterate often Minimize the downtime required

to launch new features Make sure the new product will

really, really scale

3/8/13 | 9

Page 10: Rapid Development with Schemaless Data Models

“We can do all of that in MySQL.”

“Schema-less design is impossible

to maintain.”

MongoDB vs MySQL

3/8/13 | 10

Page 11: Rapid Development with Schemaless Data Models

“We can do all of that in

MySQL.”

MongoDB vs MySQL

3/8/13 | 11

Page 12: Rapid Development with Schemaless Data Models

“We can do all of that in

MySQL.”

MongoDB vs MySQL

3/8/13 | 12

SELECT * FROM User, School, Major!WHERE User.school_id = School.school_id!AND User.major_id = Major.major_Id!AND User.user_Id = 1021!

Page 13: Rapid Development with Schemaless Data Models

“We can do all of that in

MySQL.”

MongoDB vs MySQL

3/8/13 | 13

Page 14: Rapid Development with Schemaless Data Models

“We can do all of that in

MySQL.”

MongoDB vs MySQL

3/8/13 | 14

SELECT * FROM User, User_School, User_Major, ! ! School, Major!

WHERE User_School.school_id = School.school_id!AND User_Major.major_id = Major.major_Id!AND User.user_id = User_Major.user_id!AND User.user_id = User_School.user_id!AND User.user_Id = 1021!

Page 15: Rapid Development with Schemaless Data Models

“We can do all of that in

MySQL.”

MongoDB vs MySQL

3/8/13 | 15

Page 16: Rapid Development with Schemaless Data Models

“We can do all of that in

MySQL.”

MongoDB vs MySQL

3/8/13 | 16

SELECT * FROM User, User_School, User_Major, User_Work, User_Project, School, Major, Work, Project!WHERE User_School.school_id = School.school_id!AND User_Major.major_id = Major.major_Id!AND User_Project.project_id = Project.project_Id!AND User_Work.work_id = Work.work_Id!AND User.user_id = User_Major.user_id!AND User.user_id = User_School.user_id!AND User.user_id = User_Work.user_id!AND User.user_id = User_Project.user_id!AND User.user_Id = 1021!

Page 17: Rapid Development with Schemaless Data Models

Yikes!

MongoDB vs MySQL

3/8/13 | 17

Page 18: Rapid Development with Schemaless Data Models

MongoDB vs MySQL

Looks like a Mongo document to me!

3/8/13 | 18

Page 19: Rapid Development with Schemaless Data Models

MongoDB vs MySQL

3/8/13 | 19

db.user_profile.find({“user_id” : 1021});!

Page 20: Rapid Development with Schemaless Data Models

“Schema-less design

is impossible to maintain.”

MongoDB vs MySQL

Lucky for us, the web services team had already been employing a Service / Mapper /

Model pattern.

With this pattern we are able to control the structure of each mongo document with a

defined data model.

3/8/13 | 20

Page 21: Rapid Development with Schemaless Data Models

MongoDB FTW!

MongoDB allows us to…

Move fast, iterate often Minimize the downtime required

to launch new features Make sure the new product will

really, really scale

3/8/13 | 21

Page 22: Rapid Development with Schemaless Data Models

MyEdu Profile (iteration 1: October)

3/8/13 | 22

Page 23: Rapid Development with Schemaless Data Models

MyEdu Profile (iteration 2: November)

3/8/13 | 23

Page 24: Rapid Development with Schemaless Data Models

MyEdu Profile (iteration 3: January)

3/8/13 | 24

Page 25: Rapid Development with Schemaless Data Models

Make sure the new product will really, really scale

With proper indexing alone, we have over 600k mongo profile documents on just a 3

member replica set.

We lowered our overall site speed time by 0.3 seconds and lowered our profile product

speed 300% when we introduced MongoDB.

3/8/13 | 25

Page 26: Rapid Development with Schemaless Data Models

It’s not all peaches and crème…

Oops! Bad Index

3/8/13 | 26

Page 27: Rapid Development with Schemaless Data Models

Lessons Learned

A schema-less data model has many benefits.

We can rapidly change our data to meet the needs of new product features and

requirements.

The document object is a familiar structure for a web developer.

3/8/13 | 27

Page 28: Rapid Development with Schemaless Data Models

What’s next?

Event tracking with MongoDB

Map Reduce

Using Json Patch for doing updates

3/8/13 | 28

Page 29: Rapid Development with Schemaless Data Models

Thanks!

Keith Chilek SVP, Engineering [email protected]

We’re Hiring!

Page 30: Rapid Development with Schemaless Data Models

Thanks!

Keith Chilek SVP, Engineering [email protected]

We’re Hiring!


Recommended