![Page 1: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/1.jpg)
Who am I ? What am I doing here?• Twitter: @mcwoods
• Email: [email protected]
• Mind-Flip Blog:www.mind-flip.com/theBlog
• Linked In: http://www.linkedin.com/in/mindflip
• When I think I’m being profound, or funny: www.WithBigHair.com
![Page 2: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/2.jpg)
Birth of an Idea…
![Page 3: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/3.jpg)
![Page 4: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/4.jpg)
![Page 5: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/5.jpg)
ApplicationDesign
![Page 6: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/6.jpg)
Application Design
![Page 7: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/7.jpg)
Data Structure Design
• Resulting Structures– User Object– Feed Object– Story Object– Comment Object
![Page 8: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/8.jpg)
WWR: VocZie’s Object linking
User ObjectFeed Object
Comment ObjectStory Object
1
1
1
1
0..1
1
*
1
![Page 9: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/9.jpg)
VocZie’s REST API
Examples:
• /feeds/<feed_id>• /feeds/<feed_id>/stories• /feeds/<feed_id>/story/<story_id>/comments• /feeds/<feed_id>/story/<story_id>
![Page 10: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/10.jpg)
Selecting a Technology
![Page 11: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/11.jpg)
MongoDB Structures
• Collections• Objects and their identity• The two ways of relating objects– Via pointers (aka _id)– Via embedding
![Page 12: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/12.jpg)
Transaction Problem?UpdateStoriesFromFeed( url )
if ( url is being updated ) then wait for notificationelse
lock out everyone else from updating urlfetch and parse stories from feed’s urlfor each story returned
if ( story doesn’t already exist in DB)add storyend if
end forremove lock preventing anyone else from updating url
end ifEnd function
![Page 13: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/13.jpg)
Implementing a lock manually
• update if current– Aka Compare and Swap – Atomic MongoDB actions allow for manual
creation of locks– http://www.mongodb.org/display/DOCS/Atomic+
Operations#AtomicOperations-TheABANuance
![Page 14: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/14.jpg)
Stumbling along
![Page 15: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/15.jpg)
Moment of Terror
500 – Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
![Page 16: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/16.jpg)
More Terror
root@1310-1064-2283:~# mongod
mongod --help for help and startup optionsMon Jul 23 14:38:35 [initandlisten] MongoDB starting : pid=26105 port=27017dbpath=/data/db/ 64-bit
** WARNING: You are running in OpenVZ. This is known to be broken!!!
![Page 17: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/17.jpg)
The Technical Lesson
• VMs change over time…
![Page 18: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/18.jpg)
More More Terror….
• Have I lost all my data ?• Can I back up now?
![Page 19: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/19.jpg)
cat Terror | less
• The no backup – backup…• Check out /var/lib/mongodb
![Page 20: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/20.jpg)
Conclusions
• Good– No SQL DB is great for avoiding the DAL translation
pain– Aid development time– MongoDB Core Documentation is good
• Bad– Small print – VM compatibility– MongoDB Driver Documentation isn’t as good as
the core
![Page 21: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/21.jpg)
Questions ?• Twitter: @mcwoods• Email: [email protected]• Mind-Flip Blog:
www.mind-flip.com/theBlog• Linked In: http://
www.linkedin.com/in/mindflip • When I think I’m being profound, or funny:
www.WithBigHair.com
![Page 22: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/22.jpg)
![Page 23: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/23.jpg)
![Page 24: Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: chris.woods@mind-flip.comchris.woods@mind-flip.com Mind-Flip Blog:](https://reader035.vdocument.in/reader035/viewer/2022062519/5697bfed1a28abf838cb8c33/html5/thumbnails/24.jpg)
Application Design
• User Functionality First– What data does the UI need?
• What structure would best present that data?