Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chris (I’m not a ghost) Woods. What went right (with Mongo) Application design Application development and system migration Application debugging MongoDB.

Similar presentations


Presentation on theme: "Chris (I’m not a ghost) Woods. What went right (with Mongo) Application design Application development and system migration Application debugging MongoDB."— Presentation transcript:

1 Chris (I’m not a ghost) Woods

2

3 What went right (with Mongo) Application design Application development and system migration Application debugging MongoDB Documentation

4 WWR: Application Design

5 WWR: VocZie’s Structures Functionality First – What data does the UI need? – What structure would best present that data? Resulting Structures – User Object – Feed Object – Story Object – Comment Object

6 WWR: MongoDB Structures Collections Objects and their identity The two ways of relating objects – Via pointers (aka _id) – Via embedding

7 WWR: VocZie’s Object linking User Object – Array of pointers to feeds subscribed Story Object – Pointer to a feed object – One embedded comment object (if available) Comment Object – Pointer to a story object – Pointer to a user object (if available)

8 WWR: VocZie’s Object linking User Object Feed Object Comment Object Story Object Comment Object 1 1 1 1 0..1 1 * 1

9 WWR: VocZie’s REST API Examples: /feeds/ /feeds/ /stories /feeds/ /story/ /comments /feeds/ /story/

10 What went wrong (with Mongo)

11 VM is just a VM except when it is Hell… Oh yeah, and there are no transactions MongoDB Documentation good…. PHP Driver Documentation..?...?

12 WWR: The VM from Hell VMs change over time…

13 WWR: The VM from Hell 500 – Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

14 WWR: The VM from Hell 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!!!

15 WWR: The VM from Hell Have I lost all my data ? Can I back up now?

16 WWR: The VM from Hell The no backup – backup… Check out /var/lib/mongodb

17 WWR: Transactions 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

18 WWR: 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

19 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

20 Q&A

21 Who am I ? What am I doing here? Twitter: @mcwoods@mcwoods Email: woods.mc@gmail.comwoods.mc@gmail.com Mind-Flip Blog: www.mind- flip.com/theBlogwww.mind- flip.com/theBlog When I think I’m being profound, or funny: www.WithBigHair.com www.WithBigHair.com


Download ppt "Chris (I’m not a ghost) Woods. What went right (with Mongo) Application design Application development and system migration Application debugging MongoDB."

Similar presentations


Ads by Google