Download presentation
Presentation is loading. Please wait.
Published byMabel Rich Modified over 9 years ago
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: www.mind-flip.com/theBlog www.mind-flip.com/theBlog Linked In: http://www.linkedin.com/in/mindflip http://www.linkedin.com/in/mindflip When I think I’m being profound, or funny: www.WithBigHair.com www.WithBigHair.com
7
Data Structure Design Resulting Structures – User Object – Feed Object – Story Object – Comment Object
8
WWR: VocZie’s Object linking User Object Feed Object Comment Object Story Object 1 1 1 1 0..1 1 * 1
9
VocZie’s REST API Examples: /feeds/ /feeds/ /stories /feeds/ /story/ /comments /feeds/ /story/
11
MongoDB Structures Collections Objects and their identity The two ways of relating objects – Via pointers (aka _id) – Via embedding
12
Transaction Problem? UpdateStoriesFromFeed( url ) if ( url is being updated ) then wait for notification else lock out everyone else from updating url fetch and parse stories from feed’s url for each story returned if ( story doesn’t already exist in DB) add story end if end for remove lock preventing anyone else from updating url end if End function
13
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 http://www.mongodb.org/display/DOCS/Atomic+ Operations#AtomicOperations-TheABANuance
15
Moment of Terror 500 – Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
16
More Terror root@1310-1064-2283:~# mongod mongod --help for help and startup options Mon Jul 23 14:38:35 [initandlisten] MongoDB starting : pid=26105 port=27017 dbpath=/data/db/ 64-bit ** WARNING: You are running in OpenVZ. This is known to be broken!!!
17
The Technical Lesson VMs change over time…
18
More More Terror…. Have I lost all my data ? Can I back up now?
19
cat Terror | less The no backup – backup… Check out /var/lib/mongodb
20
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
21
Questions ? Twitter: @mcwoods@mcwoods Email: woods.mc@gmail.comwoods.mc@gmail.com Mind-Flip Blog: www.mind-flip.com/theBlog www.mind-flip.com/theBlog Linked In: http://www.linkedin.com/in/mindflip http://www.linkedin.com/in/mindflip When I think I’m being profound, or funny: www.WithBigHair.com www.WithBigHair.com
24
Application Design User Functionality First – What data does the UI need? What structure would best present that data?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.