SlideShare a Scribd company logo
1 of 22
Ryan Urabe, CTO
ryan@brandfolder.com
@rurabe
CSAwesomefest
September 23, 2013
Tech Stack
Client side
Server side
Tech Stack
JS
Client side
Server side
Tech Stack
Client side
Server side
Tech Stack
Client side
Server side
Tech Stack
Client side
Server side
Tech Stack
Client side
Server side
JSON
Client side
Server side
JSON
JSON
Client side
Server side
JSON
Client side
Server side
JSON
SQL+JSON
Client side
Server side
Schema
Brandfolder
Logos Images Documents People Fonts Colors Videos Press Texts
• name
• desc
• name
• desc
• name
• desc
• name
• bio
• phone
• email
• twitter
• linkedin
• name
• desc
• googID
• otherID
• name
• desc
• cmyk
• rgb
• pnt
• hex
• name
• desc
• url
• name
• desc
• url
• title
• body
SingleTable Inheritance
Brandfolder
Assets
• type
• name
• desc
SingleTable Inheritance
Brandfolder
Assets
• type
• name
• desc
• phone
• email
• twitter
• linkedin
• cmyk
• rgb
• pnt
• hex
• url
• googID
• otherID
SingleTable Inheritance
Brandfolder
Assets
• type
• name
• desc
• phone
• email
• twitter
• linkedin
• facebook
• aboutMe
• cmyk
• rgb
• pnt
• hex
• hsla
• url
• source
• googID
• fontsID
• adobeID
• otherID
• etc
• etc
SingleTable Inheritance + JSON
Brandfolder
Assets
• type
• name
• desc
• data =>
JSON
Code
class Asset < ActiveRecord::Base
attr_accessible :name,
:description
include DataDelegator
# the secret sauce!!!
end
class Video < Asset
attr_accessible :url
data_delegate :only=> [:url]
# moar secrets!!!
end
Alternatives
• HSTORE
– Supported by ActiveRecord > 4.0
– Can’t nest
• BATF
– Works with any data store
– Need to serialize
– Can’t manipulate or query in the DB
Extending Postgres JSON
• Index the JSON
• Query records by values stored in the JSON
More Postgres + JSON
• Postgres can also serialize records
natively, returning a string of valid JSON.
– Does not require the instantiation of Ruby objects
– FAST
Even more
• You can installV8 in Postgres and write
custom query functions in Javascript
– Awesome
– Web developers are already familiar with it
Ryan Urabe, CTO
ryan@brandfolder.com
@rurabe
CSAwesomefest
September 23, 2013

More Related Content

Similar to Brandfolder - JSON + Postgres

Wrangling data like a boss
Wrangling data like a bossWrangling data like a boss
Wrangling data like a boss
Stephanie Locke
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
Steven Francia
 

Similar to Brandfolder - JSON + Postgres (20)

MongoDB for Genealogy
MongoDB for GenealogyMongoDB for Genealogy
MongoDB for Genealogy
 
Wrangling data like a boss
Wrangling data like a bossWrangling data like a boss
Wrangling data like a boss
 
Searching and Querying Knowledge Graphs with Solr/SIREn - A Reference Archite...
Searching and Querying Knowledge Graphs with Solr/SIREn - A Reference Archite...Searching and Querying Knowledge Graphs with Solr/SIREn - A Reference Archite...
Searching and Querying Knowledge Graphs with Solr/SIREn - A Reference Archite...
 
How to Build a Semantic Search System
How to Build a Semantic Search SystemHow to Build a Semantic Search System
How to Build a Semantic Search System
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
Linked Art: An Art Museum Profile for CIDOC-CRM
Linked Art: An Art Museum Profile for CIDOC-CRMLinked Art: An Art Museum Profile for CIDOC-CRM
Linked Art: An Art Museum Profile for CIDOC-CRM
 
Event Storming(이벤트 스토밍)
Event Storming(이벤트 스토밍)Event Storming(이벤트 스토밍)
Event Storming(이벤트 스토밍)
 
Getting Started with Graph Databases
Getting Started with Graph DatabasesGetting Started with Graph Databases
Getting Started with Graph Databases
 
GAB 2019 - Graph as a data store
GAB 2019 - Graph as a data storeGAB 2019 - Graph as a data store
GAB 2019 - Graph as a data store
 
Developing With Django
Developing With DjangoDeveloping With Django
Developing With Django
 
Betabit - syrwag 2018-03-28
Betabit - syrwag 2018-03-28Betabit - syrwag 2018-03-28
Betabit - syrwag 2018-03-28
 
goa Design first API Generation
goa Design first API Generationgoa Design first API Generation
goa Design first API Generation
 
Amazing Hiring tech sourcing course Boolean Search + Xray The Lokenbergs
Amazing Hiring tech sourcing course Boolean Search + Xray The LokenbergsAmazing Hiring tech sourcing course Boolean Search + Xray The Lokenbergs
Amazing Hiring tech sourcing course Boolean Search + Xray The Lokenbergs
 
How your Metadata Strategy Impacts Everything You Do
How your Metadata Strategy Impacts Everything You DoHow your Metadata Strategy Impacts Everything You Do
How your Metadata Strategy Impacts Everything You Do
 
Rest + Oauth Integration by Lightning By Mohammed Rizwan
Rest + Oauth Integration by Lightning By Mohammed RizwanRest + Oauth Integration by Lightning By Mohammed Rizwan
Rest + Oauth Integration by Lightning By Mohammed Rizwan
 
SEO Audit Tools, Tips and Tricks - SMX West 2016
SEO Audit Tools, Tips and Tricks - SMX West 2016SEO Audit Tools, Tips and Tricks - SMX West 2016
SEO Audit Tools, Tips and Tricks - SMX West 2016
 
Beer&Tech: Tech Documentation - cod == doc
Beer&Tech: Tech Documentation - cod == docBeer&Tech: Tech Documentation - cod == doc
Beer&Tech: Tech Documentation - cod == doc
 
ACSUG June 2020 - Azure Logic Apps: Best practices, tips and tricks
ACSUG June 2020 - Azure Logic Apps: Best practices, tips and tricksACSUG June 2020 - Azure Logic Apps: Best practices, tips and tricks
ACSUG June 2020 - Azure Logic Apps: Best practices, tips and tricks
 
Python - A Comprehensive Programming Language
Python - A Comprehensive Programming LanguagePython - A Comprehensive Programming Language
Python - A Comprehensive Programming Language
 

Recently uploaded

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Brandfolder - JSON + Postgres