databases and agile development - dwight merriman (mongodb)
DESCRIPTION
Presented as a keynote at JAX London 2013 Much has been made of scalability as a driver for choosing a database, but the choice of a database influences much more than the scaling architecture. Different database choices drive different data models which in turn influence the development process.TRANSCRIPT
Databases and Agile Development
Dwight MerrimanMongoDB
•What is the first thing you think of when you hear “RDBMS”?
•What is the first thing you think of when you hear “SQL”?
•What is the first thing you think of when you hear “NoSQL”?
New data models create an opportunity to innovate
Dynamic schemas
Facilitate agile
But there is a schema!
It evolves some of course
{ _id : “too_big_to_fail”, title : “Too Big to Fail”, author : “joe123”, when : “2008-12-03”, body_text : “…”,}
{ _id : “too_big_to_fail”, title : “Too Big to Fail”, author : “joe123”, when : “2008-12-03”, body_text : “…”, comments : [ { who:”jane”, comment:”I don’t think so…”, when:”2008-12-04” }, … ]}
{ _id : “too_big_to_fail”, title : “Too Big to Fail”, author : “joe123”, when : “2008-12-03”, body_text : “…”, comments : [ { who:”jane”, comment:”I don’t think so…”, when:”2008-12-04” }, … ]}
db.posts.find( { “who”:”jane” } )
{ _id : “too_big_to_fail”, title : “Too Big to Fail”, author : “joe123”, when : “2008-12-03”, body_text : “…”, comments : [ { who:”jane”, comment:”I don’t think so…”, when:”2008-12-04” }, … ], votes : 3, voters : [‘joe123’,’kblm’,’dwight’]}
{ _id : “too_big_to_fail”, title : “Too Big to Fail”, author : “joe123”, when : “2008-12-03”, body_text : “…”, comments : [ { who:”jane”, comment:”I don’t think so…”, when:”2008-12-04” }, … ], votes : 3, voters : [‘joe123’,’kblm’,’dwight’]}
db.posts.update( {_id:“too_big_to_fail” , voters:{$ne:”jjelm”}}, {$inc:{votes:1}, $push:{voters:”jjelm”} })
Static vs Dynamic
int x = “abc”; // javavar x = “abc”; // javascript
Static vs Dynamic
int x = “abc”; // javavar x = “abc”; // javascript
UPDATE items SET x = “abc”
SOA & Agile
A
B
C
D
{ x : 3, desc : “thing”}
SOA & Agile
A
B
C
D
{ x : 3, desc : “thing”, loc : [20.3, 24.732]}
Further thoughts on writing apps today
Store first, ask questions later“speculative storage”
Further thoughts on writing apps today
Default to real-time
Thanks