SlideShare a Scribd company logo
From	Startup	to	Mature	Company:	
jashmead@nistica.com
1
PostgreSQL	Tips		
&	Techniques
ÊWavelength Selective Switches (WSS)☑
Agile Optical Networks
2
MSAN 10Gbà
100Gb
LOCAL HD
DISTRIBUTION
IPDSLAM
IPDSLAM
Data Center
Access Metro Edge Metro Core Long-Haul
**
Æ Ê
Ê
☑ ☑
☑
☑
CRITICAL BUILDING BLOCKS à AGILE OPTICAL NETWORKS
Tunable Pluggable Lasers
* Optical Channel Monitors (OCM)
Agile Optical Networks
☑
☑
3
INPUT EXPRESS
DROP
1x2		WSS
1) Automated routing of individual channels
– Reconfigurable Optical Add-Drop Mux
(ROADM)
2) Dynamic channel power management
– Allows long distance transmission
3) Integrated optical channel monitoring
– Information feedback for power
management
Wavelength Selective Switch (WSS)
What is a Zeppelin?
jashmead@nistica.com 4
•Manufacturing	
Database	
•Drives	manufacture	via	
automated	checklists	
•Work	flow	management		
•Training	checks	
•Module	data	
•Customer	datasheets	
•Process	engineering
Checklist Manifesto
• Getting	the	basics	
right	
• Every	time	
• In	ICU,	5	steps	to	
insert	line	
• Infection	rate	from	
11%	to	0
jashmead@nistica.com 5
How to design a database
• Listen	to	the	client	talk	about	their	business	
• Where	they	use	nouns,	use	tables.	
• Where	they	use	verbs,	use	functions.	
• Turn	their	adjectives	into	columns,	
• and	their	adverbs	into	the	parameters	for	
the	functions.
jashmead@nistica.com 6
It’s about the relationships
• Like	nouns,	tables	
only	valuable	in	
combination	
• Foreign	keys	
• Bones	and	
tendons	
• Documentation	
• Performance
jashmead@nistica.com 7
Keys are primary
• Anonymous	
• Natural	keys	
• Sequences	
• Fast	enough	for	
temp	tables	
• And	can	set	
ranges	in	useful	
ways
jashmead@nistica.com 8
CREATE SEQUENCE
serials_id_seq
START WITH
1000000000
INCREMENT BY 1
MINVALUE
1000000000
MAXVALUE
1249999999
CACHE 1;
Timestamps — Or where on the planet are we?
jashmead@nistica.com 9
Time to pull the trigger
• Timestamps	
• Keep	scope	
limited	
• Complex	
validation	
• History	
• Error	trapping
jashmead@nistica.com 10
CREATE TRIGGER
serials_timestamp
BEFORE UPDATE ON
serials FOR EACH ROW
EXECUTE PROCEDURE
timestamp_trg();
CREATE FUNCTION timestamp_trg() RETURNS trigger
LANGUAGE plpgsql
AS $$
begin
/*
force timestamps
-- created_at & updated_at fields exist
-- set Model.record_timestamps = false;
-- this keeps ActiveRecord from trying to do the
update
*/
if new.created_at is null
then
new.created_at = now();
end if;
new.updated_at = now();
return new;
end;
$$;
Stored Procedures - Muscles of a Database
jashmead@nistica.com 11
Staying true to type
•Rich	type	system	
•Induced	types	
•Defined	domains	
•Conversions	
•General	functions
jashmead@nistica.com 12
CREATE FUNCTION
sn_process(sn0 sn_t, stuff
description_t)
LANGUAGE plpgsql
AS $$
declare
sn1 sn_t;
serial_id1 serials.id
%type;
top_serial_id1
serials.id%type;
begin
Metadata
jashmead@nistica.com 13
select a.attname
from pg_catalog.pg_attribute a,
pg_catalog.pg_class c,
pg_catalog.pg_namespace n
where a.attrelid = c.oid
and c.relnamespace = n.oid
and c.relname = ?
and n.nspname = 'public'
and a.attnum > 0 -- gets rid
of internal columns
and a.attisdropped = 'f'
order by a.attnum
Model-View-Controller
jashmead@nistica.com 14
It’s about the conversation
jashmead@nistica.com 15
•KISS	
•Separation	
of	concerns	
•DRY	
•Right	tool	
•Local	
standards
JSON
jashmead@nistica.com 16
response = {
"result": "OK",
"number_of_serials": 3,
"message": "We found three
serials",
"serials": [ "SN1", "SN2",
"SN3" ],
"details": {
"retrieved_on": "2018-01-01
03:17:04",
"length": 1003
}
}
•Compact	
•Easy	to	
read	
•Native	in	
PostgreSQL	
•Frozen	
JavaScript
Crash reporting
• No	exceptions	
• Be	specific	
• Leave	log	
entry	
• Notify	IT	
• Tell	the	user	
what	to	do	
next
jashmead@nistica.com 17
Death to Yellow Stickies
jashmead@nistica.com 18
Start with the help
jashmead@nistica.com 19
I have a syncing feeling about this…
•Hub	&	spokes	
•Technical	
problems	
•Push	model	
•Positive	
verification	
required!
jashmead@nistica.com 20
2B or Not 2B
•Engineering	DB	
in	SQL	Server	
•2B	or	Not	2B	
•LATIN1	
•Different	
organization
jashmead@nistica.com 21
Some Assembly Required
•Parts	in	assembly	
travel	together		
•But	when	you	
pull	part	out?	
•And	move	it	
back?	
•Some	thought	
required!
jashmead@nistica.com 22
Start	in	Vietnam
Go	to	NJ
Replace	Sub-assembly
Ship	Back	to		
Vietnam
Pirate Checklist
23
•Tables/
relationships	
•Model/View/
Controller	
•Trust	—	but	
verify	
•Think	globally	—
act	locally	
•Guidelines	—	not	
rules
What next?
• Blogs	
• User	groups	
• Email	list	
• Books	
• Reference	
manuals
jashmead@nistica.com 24
Thank	You!
www.nistica.com
jashmead@nistica.com
25

More Related Content

PPTX
Project Gemini - a fuzzing tool used by Scylla to guarantee that data, once w...
PDF
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
PDF
Machine learning at Scale with Apache Spark
PDF
Large volume data analysis on the Typesafe Reactive Platform
PDF
Cassandra as event sourced journal for big data analytics
PPTX
An adaptive and eventually self healing framework for geo-distributed real-ti...
PPT
Seattle Cassandra Meetup - Cassandra 1.2 - Eddie Satterly
PDF
Spark Summit EU talk by Qifan Pu
Project Gemini - a fuzzing tool used by Scylla to guarantee that data, once w...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Machine learning at Scale with Apache Spark
Large volume data analysis on the Typesafe Reactive Platform
Cassandra as event sourced journal for big data analytics
An adaptive and eventually self healing framework for geo-distributed real-ti...
Seattle Cassandra Meetup - Cassandra 1.2 - Eddie Satterly
Spark Summit EU talk by Qifan Pu

What's hot (10)

PDF
Apache spark - Installation
PDF
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
PPTX
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
PDF
Valerii Vasylkov Erlang. measurements and benefits.
PDF
Cluster schedulerの紹介
PDF
Distributed Stream Processing - Spark Summit East 2017
PDF
A Spark Framework For < $100, < 1 Hour, Accurate Personalized DNA Analy...
PDF
ACM DEBS Grand Challenge: Continuous Analytics on Geospatial Data Streams wit...
PDF
Memcached Presentation
PDF
Postgres Performance for Humans
Apache spark - Installation
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
Valerii Vasylkov Erlang. measurements and benefits.
Cluster schedulerの紹介
Distributed Stream Processing - Spark Summit East 2017
A Spark Framework For < $100, < 1 Hour, Accurate Personalized DNA Analy...
ACM DEBS Grand Challenge: Continuous Analytics on Geospatial Data Streams wit...
Memcached Presentation
Postgres Performance for Humans
Ad

Similar to From Startup to Mature Company: PostgreSQL Tips and techniques (20)

PPTX
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
PDF
Top 10 Best Practices for Apache Cassandra and DataStax Enterprise
PDF
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
PDF
Data Stores @ Netflix
PDF
MEETUP - Unboxing Apache Cassandra 3.10
PPSX
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
PDF
Netflix at-disney-09-26-2014
PDF
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
PPTX
GPS Insight on Using Presto with Scylla for Data Analytics and Data Archival
PDF
Cassandra's Odyssey @ Netflix
PDF
SamzaSQL QCon'16 presentation
PPTX
Spark Streaming Early Warning Use Case
PDF
Workflowsim escience12
PDF
Cassandra Summit 2014: Monitor Everything!
PDF
In Memory Database In Action by Tanel Poder and Kerry Osborne
PDF
Oracle Database In-Memory Option in Action
PDF
Advanced Postgres Monitoring
PDF
The CMS Online Cluster: 
 Setup, Operation and Maintenance 
 of an Evolving C...
PPTX
Devops kc
PDF
Concurrency
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
Top 10 Best Practices for Apache Cassandra and DataStax Enterprise
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
Data Stores @ Netflix
MEETUP - Unboxing Apache Cassandra 3.10
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
Netflix at-disney-09-26-2014
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
GPS Insight on Using Presto with Scylla for Data Analytics and Data Archival
Cassandra's Odyssey @ Netflix
SamzaSQL QCon'16 presentation
Spark Streaming Early Warning Use Case
Workflowsim escience12
Cassandra Summit 2014: Monitor Everything!
In Memory Database In Action by Tanel Poder and Kerry Osborne
Oracle Database In-Memory Option in Action
Advanced Postgres Monitoring
The CMS Online Cluster: 
 Setup, Operation and Maintenance 
 of an Evolving C...
Devops kc
Concurrency
Ad

More from John Ashmead (20)

PDF
The Quantum Internet: Hype or the Next Step
PDF
How to build a PostgreSQL-backed website quickly
PDF
The Quantum Internet: Hype or the Next Step
PDF
Artificial Intelligence: Past, Present, Futures
PDF
Time dispersion in time-of-arrival measurements
PDF
Time dispersion in quantum mechanics -- Philcon 2019 version
PDF
Time dispersion in quantum mechanics
PDF
Mars Or Bust!
PDF
Practical Telepathy: The Science & Engineering of Mind-Reading
PDF
Practical Telepathy: The Science & Engineering of Mind-Reading
PDF
Stargates: Theory and Practice
PDF
StarGates: Theory and Practice
PDF
Quantum dots
PDF
Star Gates: the Theory and Practice
PDF
Time to the power of Tim
PDF
How many universes are there, anyway
PPTX
A Quantum of Mystery
PDF
Converting from MySQL to PostgreSQL
PDF
Seven War Stories and a Moral
PDF
MAMP Stack - Macintosh, Apache, MySQL, PHP
The Quantum Internet: Hype or the Next Step
How to build a PostgreSQL-backed website quickly
The Quantum Internet: Hype or the Next Step
Artificial Intelligence: Past, Present, Futures
Time dispersion in time-of-arrival measurements
Time dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics
Mars Or Bust!
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
Stargates: Theory and Practice
StarGates: Theory and Practice
Quantum dots
Star Gates: the Theory and Practice
Time to the power of Tim
How many universes are there, anyway
A Quantum of Mystery
Converting from MySQL to PostgreSQL
Seven War Stories and a Moral
MAMP Stack - Macintosh, Apache, MySQL, PHP

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Approach and Philosophy of On baking technology
PPTX
Cloud computing and distributed systems.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
Cloud computing and distributed systems.
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Big Data Technologies - Introduction.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

From Startup to Mature Company: PostgreSQL Tips and techniques