Presented by Nuri Halperin, Owner and Principal, Plus N Consulting
Experience level: Deep dive
When designing a solution leveraging MongoDB, the entities and business requirements need to be evaluated in a new light. In this session, we'll take a business scenario mapped out the traditional relational way, and synthesize a document oriented solution pitching to Mongo's strengths. We'll examine common tradeoffs and considerations that may arise and demonstrate key mechanics that can be implemented to address them.
18. Certification
id UUID
tool_type_id int
date datetime
Maker Certification
member_id UUID
certification_id UUID
date datetime
Person
id UUID
first_name nvarchar(32)
last_name nvarchar(32)
Tool Type
id int
name vharchar
is_certifiable bit (not null)
19. Tool
asset_id UUID
tool_type_id int
Tool Type
id int
name vharchar
Asset
id UUID
name nvarchar(32)
is_stationary bit
Certification
person_id UUID
tool_type_id UUID
name varchar(16)
Member Certification
member_id UUID
certification_id UUID
date datetime
Member Tool Log
asset_id UUID
type_id int
Person
id UUID
first_name nvarchar(32)
last_name nvarchar(32)
Maker
person_id UUID
status_id Int (not null)
Maker Status
id int
status varchar(16)
23. Tool
asset_id UUID
type_id int
Tool Type
id int
name vharchar
Asset
id UUID
name nvarchar(32)
is_stationary bit
Certification
person_id UUID
asset_id UUID
name varchar(16)
Member Certification
member_id UUID
certification_id UUID
Member Tool Log
asset_id UUID
type_id int
date datetime
Person
id UUID
first_name nvarchar(32)
last_name nvarchar(32)
Maker
person_id UUID
status_id Int (not null)
Maker Status
id int
status varchar(16)
We can do
anything!
36. Extra Field :: Tables
DOWN TIME? COORDINATED DEPLOYMENT?
ALTER TABLE [x]
ADD COLUMN [is_certifiable] bit
DEFAULT 0
37. Extra Field :: MongoDB
FLEXIBLE SCHEMA, CODE FIRST
> db.x.insert({
…,
is_certifiable: true})
> db.x.update(
{_id: 123},
{$set:{is_certifiable: true}})
On the fly!
49. Tool
asset_id UUID
type_id int
Tool Type
id int
name vharchar
Asset
id UUID
name nvarchar(32)
is_stationary bit
Certification
person_id UUID
asset_id UUID
name varchar(16)
Member Certification
member_id UUID
certification_id UUID
Person
id UUID
first_name nvarchar(32)
last_name nvarchar(32)
Maker
person_id UUID
status_id Int (not null)
Maker Status
id int
status varchar(16)
Member Tool Log
asset_id UUID
type_id int
date datetime