13. 13
Flexibility (seriously)
/* ---------------------------------- */
/* ----- Begin the PL/SQL block ----- */
/* ---------------------------------- */
EXEC SQL EXECUTE
DECLARE
insufficient_funds EXCEPTION;
old_bal NUMBER;
min_bal CONSTANT NUMBER := 500;
BEGIN
SELECT bal INTO old_bal FROM accounts
WHERE account_id = :acct;
-- If the account doesn't exist, the NO_DATA_FOUND
-- exception will be automatically raised.
:new_bal := old_bal - :debit;
IF :new_bal >= min_bal THEN
UPDATE accounts SET bal = :new_bal
WHERE account_id = :acct;
INSERT INTO journal
VALUES (:acct, 'Debit', :debit, SYSDATE);
:status := 'Transaction completed.';
ELSE
RAISE insufficient_funds;
END IF;
....
26. 26
Insurance leader generates coveted 360-degree view of
customers in 90 days – “The Wall”
Case
Problem Why MongoDB Results
• No single view of
customer
• 145 yrs of policy data,
70+ systems, 15+ apps
• 2 years, $25M trying to
aggregate in RDBMS –
failed
• Agility – prototype in 5
days; production in 90
days
• Dynamic schema & rich
querying – combine
disparate data into one
data store
• Hot tech to attract top
talent
• Increased call center
productivity
• Better customer
experience, reduced
churn, more upsell opps
• Dozens more projects in
the works to leverage
this data platform
29. 29
Stores billions of posts in myriad formats
with MongoDB
Case
Problem Why MongoDB Results
• 1.5M posts per day,
different structures
• Inflexible MySQL,
lengthy delays for
making changes
• Data piling up in
production database
• Poor performance
• Flexible document-
based model
• Horizontal scalability
built in
• Easy to use
• Interface in familiar
language
• Initial deployment held
over 5B documents and
10TB of data
• Automated failover
provides high
availability
• Schema changes are
quick and easy