Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jeff Lemmerman Matt Chimento Medtronic Confidential 1 9th Annual CodeFreeze Symposium Medtronic Energy and Component Center.

Similar presentations


Presentation on theme: "Jeff Lemmerman Matt Chimento Medtronic Confidential 1 9th Annual CodeFreeze Symposium Medtronic Energy and Component Center."— Presentation transcript:

1 Jeff Lemmerman Matt Chimento Medtronic Confidential 1 9th Annual CodeFreeze Symposium Medtronic Energy and Component Center

2 2 MECC est. 1976 MECC Components Batteries Defibrillation Capacitors Feedthroughs Glass/ Metal Feedthroughs Precision Molding and Extrusion Census – 1200 Employees Plant Size – 190,000 Square Feet 40,000 Manufacturing 15,000 R&D Labs 38,000 Office 97,000 Common, Support, Warehouse

3 About MongoDB Background Founded in 2007 as 10Gen First release of MongoDB in 2009 $223M+ in funding MongoDB Core server Native drivers Version 2.4.9 released 1/10/14 Subscriptions, Consulting, Training Monitoring (MMS)

4 RDBMS Strengths Data stored is very compact Rigid schemas have led to powerful query capabilities Data is optimized for joins and storage Robust ecosystem of tools, libraries, integrations 40+ years old!

5 Enter “Big Data” Gartner defines it with 3Vs Volume Vast amounts of data being collected Variety Evolving data Uncontrolled formats, no single schema Unknown at design time Velocity Inbound data speed Fast read/write operations Low latency

6 Is this a BIG data problem? 6

7 Where stored? 7

8 Mapping Big Data to RDBMS Difficult to store uncontrolled data formats Scaling via big iron or custom data marts/partitioning schemes Schema must be known at design time Impedance mismatch with agile development and deployment techniques Doesn’t map well to native language constructs

9 Key Features Data stored as documents (JSON-like BSON) Flexible-schema In schema design, think about optimizing for read vs. storage Full CRUD support (Create, Read, Update, Delete) Atomic in-place updates Ad-hoc queries: Equality, RegEx, Ranges, Geospatial Secondary indexes Replication – redundancy, failover Sharding – partitioning for read/write scalability Terminology Collection = Table Index = Index Document = Row Column = Field Joining = Embedding & Linking

10 Our experience with MongoDB Consulting/Training has been excellent Support agreement has been under-utilized Emails for security updates etc. are prompt Release cycle is frequent Mongo Monitoring Service Potential concerns storing db stats externally MongoDB Certification now available New course coming soon in Udacity

11 Building First C# Application CRUD operations for domain class “Component” Create new Visual Studio 2010/2012 project Install C# driver – currently 1.8.3 Domain class annotations Authentication Replication Sharding 11

12 Medtronic Confidential 12

13 13

14 How is data retrieved? 14

15 Loading Data Into Central Repository 15

16 Download/Install MongoDB 16 mongodb.org/downloads

17 Install MongoDB as Windows Service 17

18 Create Default Data Directory 18 C:\data\db Start Mongod C:\MongoDB\bin\mongod.exe

19 MongoDB Shell 19 C:\MongoDB\bin\mongo.exe

20 Creating Components 20.insert() will always try to create new document.save() if _id already exists will update If document doesn’t have _id field it is added

21 Reading Components 21

22 Reading Components 22 Returns Null

23 Updating Components 23 $set keyword used for partial updates Without $set keyword entire document is replaced {multi : true} to update multiple documents

24 Deleting Components 24 Works like.find() Drops collection Drops database

25 Medtronic Confidential 25

26 Creating Components - CompRepo 26 mongodb://localhost/database

27 Creating Components – Add() 27

28 Reading Components 28

29 Updating Components – Save() 29 Save sends entire document back to server

30 Updating Components – Update() 30 Update only sends changes

31 Deleting Components 31 Needed to add reference to Repo class

32 Automapping 32

33 33

34 Authentication 34 Clients on localhost connect as admin by default Start mongod with config option to disable Create read-only user and a write user Start mongod with these config options

35 Replica Sets

36 Scaling Reads

37 Sharding

38 Key Points CHOOSE WISELY: SHARD KEY CANNOT BE CHANGED! All documents in sharded collection must include the shard key Shard key must be an indexed field Queries that sort by the shard key are much more efficient Mongos handles routing to the correct shard Key Points CHOOSE WISELY: SHARD KEY CANNOT BE CHANGED! All documents in sharded collection must include the shard key Shard key must be an indexed field Queries that sort by the shard key are much more efficient Mongos handles routing to the correct shard Sharding

39 What makes a good shard key? Sharding

40 Key Learnings Working Set < Memory ISODate("2012-09-25T03:00:23Z") Use UTC Queries must match data type “string” vs. integer Download and use other MongoDB tools (MongoVUE) Do not convert query results to List<>

41 Gaps Enterprise acceptance of “new” approach Integration with off-the-shelf reporting and analytics User interface for managing the database cluster Developer familiarity with JSON and MongoDB 21 CFR Part 11 Compliance

42 Questions? Medtronic Confidential 42 docs.mongodb.org/manual

43 Collect and store raw data Medtronic Confidential 43

44 Databases Are Not ARDS Medtronic Confidential 44 RDBMS Optimized For Storage

45 Waveform Data Medtronic Confidential 45

46 ObjectId Special 12-byte BSON type that guarantees uniqueness within the collection. The ObjectID is generated based on timestamp, machine ID, process ID, and a process-local incremental counter. MongoDB uses ObjectId values as the default values for _id fields.BSONcollection_id 46

47 Indexing 47 Without indexes queries must perform a table scan (every document) All collections index on the _id field

48 Backup/Restore 48 One option is to use mongodump.exe / mongorestore.exe

49 Aggregation Framework 49

50 Write Concern 50


Download ppt "Jeff Lemmerman Matt Chimento Medtronic Confidential 1 9th Annual CodeFreeze Symposium Medtronic Energy and Component Center."

Similar presentations


Ads by Google