SlideShare a Scribd company logo
Better Data Management
       with TaffyDB

       taffydb.com
Who here considered
 themselves a JavaScript
Programmer 5 years ago?
Three Types of JavaScript Developer
Three Types of JavaScript Developer
Three Types of JavaScript Developer
Three Types of JavaScript Developer
Three Types of JavaScript Developer
Three Types of JavaScript Developer
It all started with arrays
It all started with arrays

var todos = [
    [quot;Home To Dosquot;,1,false,[
       [quot;Replace light bulbsquot;,false,quot;Ianquot;],
       [quot;Clean out deskquot;,false,quot;Ianquot;]]
    ],
    [quot;Work To Dosquot;,0,true,[
       [quot;Fix bug with formquot;,false,quot;Ianquot;],
       [quot;Draft requirements docquot;,false,quot;Ianquot;],
       [quot;Learn JavaScript Objectsquot;,false,quot;Ianquot;]]
    ]
];
It all started with arrays

var todos = [
     [quot;Home To Dosquot;,1,false,[
        [quot;Replace light bulbsquot;,false,quot;Ianquot;],
        [quot;Clean out deskquot;,false,quot;Ianquot;]]
     ],
     [quot;Work To Dosquot;,0,true,[
        [quot;Fix bug with formquot;,false,quot;Ianquot;],
        [quot;Draft requirements docquot;,false,quot;Ianquot;],
        [quot;Learn JavaScript Objectsquot;,false,quot;Ianquot;]]
     ]
];
// update Fix bug with form to complete
todos[1][3][0][1] = true;
Functions like this

function checkTask (list,task) {
   for(var li = 0;li<todos;li++) {
      if (todos[li][0] == list) {
          for (var ta = 0; ta < todos[li][3]; ta++) {
             if (todos[li][3][ta][0] == task) {
                 todos[li][3][ta][1] == true;
             }
          }
      }
   }
}
checkTask(quot;Work To Dosquot;,quot;Draft requirements docquot;);
JavaScript Object Literals




                   {}
JavaScript Object Literals

Useful for storing related name value pairs:

     {country:quot;United Statesquot;,
     government:quot;Democracyquot;,
     president:quot;Barrak Obamaquot;}
JavaScript Object Literals

Useful for storing related name value pairs:

     {country:quot;United Statesquot;,
     government:quot;Democracyquot;,
     president:quot;Barrak Obamaquot;}

Also useful for composing instructions for functions:

find({government:quot;Democracyquot;})
// find all records where government == Democracy
This is TaffyDB
This is TaffyDB

• A wrapper for object literals (records)
This is TaffyDB

• A wrapper for object literals (records)
• Provides a JavaScript centric API (using arrays/objects)
This is TaffyDB

• A wrapper for object literals (records)
• Provides a JavaScript centric API (using arrays/objects)
• Uses familiar database concepts
This is TaffyDB

•   A wrapper for object literals (records)
•   Provides a JavaScript centric API (using arrays/objects)
•   Uses familiar database concepts
•   But it isn't a DB - no persistence
This is TaffyDB

•   A wrapper for object literals (records)
•   Provides a JavaScript centric API (using arrays/objects)
•   Uses familiar database concepts
•   But it isn't a DB - no persistence

•   Thin (under 12K)
•   Opensource and Free
•   Maintained (v1.7.1)
•   One global object, no prototype modification
Create a data collection


// create a populated data collection
var jsConfSpeakers = TAFFY([
    {quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;},
    {quot;namequot;:quot;Francisco Tolmaskquot;,quot;topicquot;:quot;Objective-Jquot;},
    {quot;namequot;:quot;Chris Andersonquot;,quot;topicquot;:quot;CouchDBquot;},
    {quot;namequot;:quot;Jeff Hayniequot;,quot;topicquot;:quot;Web Apps on the Desktopquot;},
    {quot;namequot;:quot;Stoyan Stefanovquot;,quot;topicquot;:quot;Kick Ass Web Appsquot;}
]);
Insert




jsConfSpeakers.insert(
   {quot;namequot;:quot;Richard D. Worthquot;,quot;topicquot;:quot;jQuery UIquot;}
 );
Getting records


jsConfSpeakers.first();
// returns {quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;}
Getting records


jsConfSpeakers.first();
// returns {quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;}
// TaffyDB filtering is overloaded
// 0 and [0] will both return the first record

jsConfSpeakers.get(0);
jsConfSpeakers.get([0]);
// returns [{quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;}]
Remove

// delete is a reserved word
// use remove function instead

jsConfSpeakers.remove(0);
Update


jsConfSpeakers.update({quot;topicquot;:quot;TBDquot;},0);
// updates the first record, sets topic = quot;TBDquot;
Advanced filtering

// Use Object Literals to construct quot;where clausesquot;

jsConfSpeakers.find({name:quot;Chris Andersonquot;});
// returns [2]
Advanced filtering

// Use Object Literals to construct quot;where clausesquot;

jsConfSpeakers.find({name:quot;Chris Andersonquot;});
// returns [2]
jsConfSpeakers.find({topic:{like:quot;Web Appsquot;}});
// returns [3,4]
Advanced filtering

// Use Object Literals to construct quot;where clausesquot;

jsConfSpeakers.find({name:quot;Chris Andersonquot;});
// returns [2]
jsConfSpeakers.find({topic:{like:quot;Web Appsquot;}});
// returns [3,4]

jsConfSpeakers.find({
         topic:{like:quot;Web Appsquot;},
         name:{like:quot;Jeffquot;}});
// returns [3]
// quot;where topic like Web Apps and name like Jeffquot;
Let's see it in action...
.forEach() in details

collection.forEach(
  function (r,index) {
      //whatever logic here
  },[optional filter]);
.forEach() in details

collection.forEach(
  function (r,index) {
      //whatever logic here
  },[optional filter]);


// modify r and return it to update the record
collection.forEach(
   function (r,index) {
       r.field = quot;new valuequot;;
       return r;
   });
TaffyDB is Batteries Included
TaffyDB is Batteries Included

Events:
• onUpdate, onInsert, onRemove
TaffyDB is Batteries Included

Events:
• onUpdate, onInsert, onRemove

JSON Support
TaffyDB is Batteries Included

Events:
• onUpdate, onInsert, onRemove

JSON Support

typeOf() methods
TaffyDB is Batteries Included

Events:
• onUpdate, onInsert, onRemove

JSON Support

typeOf() methods

Object Methods
• isSameObject, mergeObject, etc
TaffyDB is Batteries Included

Events:
• onUpdate, onInsert, onRemove

JSON Support

typeOf() methods

Object Methods
• isSameObject, mergeObject, etc

Utility Methods
Does it scale?
Sites Using TaffyDB
Joe's Goals (joesgoals.com)
QuoteWizard (quotewizard.com)
VitaList (vitalist.com)
MostRecent (mostrecent.net)
http://taffydb.com

Learn - Download - Find Help
      Contribute Code

More Related Content

What's hot

CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
charsbar
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache Spark
Holden Karau
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
Knoldus Inc.
 
Rails database optimization
Rails database optimizationRails database optimization
Rails database optimization
Karsten Meier
 
Cassandra and Spark, closing the gap between no sql and analytics codemotio...
Cassandra and Spark, closing the gap between no sql and analytics   codemotio...Cassandra and Spark, closing the gap between no sql and analytics   codemotio...
Cassandra and Spark, closing the gap between no sql and analytics codemotio...
Duyhai Doan
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Zalando Technology
 
OData RESTful implementation
OData RESTful implementationOData RESTful implementation
OData RESTful implementation
Hari Wiz
 
Getting Started with React
Getting Started with ReactGetting Started with React
Getting Started with React
Nathan Smith
 
Graphql
GraphqlGraphql
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodbLee Theobald
 
Building Data Mapper PHP5
Building Data Mapper PHP5Building Data Mapper PHP5
Building Data Mapper PHP5
Vance Lucas
 

What's hot (11)

CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache Spark
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
 
Rails database optimization
Rails database optimizationRails database optimization
Rails database optimization
 
Cassandra and Spark, closing the gap between no sql and analytics codemotio...
Cassandra and Spark, closing the gap between no sql and analytics   codemotio...Cassandra and Spark, closing the gap between no sql and analytics   codemotio...
Cassandra and Spark, closing the gap between no sql and analytics codemotio...
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
 
OData RESTful implementation
OData RESTful implementationOData RESTful implementation
OData RESTful implementation
 
Getting Started with React
Getting Started with ReactGetting Started with React
Getting Started with React
 
Graphql
GraphqlGraphql
Graphql
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
 
Building Data Mapper PHP5
Building Data Mapper PHP5Building Data Mapper PHP5
Building Data Mapper PHP5
 

Similar to Better Data Management using TaffyDB

Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
Atlassian
 
Relaxing With CouchDB
Relaxing With CouchDBRelaxing With CouchDB
Relaxing With CouchDB
leinweber
 
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...ActsAsCon
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
BradNeuberg
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
Ted Husted
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
Ted Husted
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
Andy McKay
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
John Quaglia
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
John Brunswick
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for you
Simon Willison
 
Google apps script database abstraction exposed version
Google apps script database abstraction   exposed versionGoogle apps script database abstraction   exposed version
Google apps script database abstraction exposed versionBruce McPherson
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
Ben Scofield
 
Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....
Raffi Krikorian
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
Out with Regex, In with Tokens
Out with Regex, In with TokensOut with Regex, In with Tokens
Out with Regex, In with Tokens
scoates
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Yohei Sasaki
 
Pascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax SecurityPascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax Security
amiable_indian
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amfrailsconf
 

Similar to Better Data Management using TaffyDB (20)

Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
 
Relaxing With CouchDB
Relaxing With CouchDBRelaxing With CouchDB
Relaxing With CouchDB
 
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Ajax
AjaxAjax
Ajax
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for you
 
Google apps script database abstraction exposed version
Google apps script database abstraction   exposed versionGoogle apps script database abstraction   exposed version
Google apps script database abstraction exposed version
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
 
Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
 
Out with Regex, In with Tokens
Out with Regex, In with TokensOut with Regex, In with Tokens
Out with Regex, In with Tokens
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
 
Pascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax SecurityPascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax Security
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amf
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 

Better Data Management using TaffyDB

  • 1. Better Data Management with TaffyDB taffydb.com
  • 2. Who here considered themselves a JavaScript Programmer 5 years ago?
  • 3.
  • 4. Three Types of JavaScript Developer
  • 5. Three Types of JavaScript Developer
  • 6. Three Types of JavaScript Developer
  • 7. Three Types of JavaScript Developer
  • 8. Three Types of JavaScript Developer
  • 9. Three Types of JavaScript Developer
  • 10.
  • 11. It all started with arrays
  • 12. It all started with arrays var todos = [ [quot;Home To Dosquot;,1,false,[ [quot;Replace light bulbsquot;,false,quot;Ianquot;], [quot;Clean out deskquot;,false,quot;Ianquot;]] ], [quot;Work To Dosquot;,0,true,[ [quot;Fix bug with formquot;,false,quot;Ianquot;], [quot;Draft requirements docquot;,false,quot;Ianquot;], [quot;Learn JavaScript Objectsquot;,false,quot;Ianquot;]] ] ];
  • 13. It all started with arrays var todos = [ [quot;Home To Dosquot;,1,false,[ [quot;Replace light bulbsquot;,false,quot;Ianquot;], [quot;Clean out deskquot;,false,quot;Ianquot;]] ], [quot;Work To Dosquot;,0,true,[ [quot;Fix bug with formquot;,false,quot;Ianquot;], [quot;Draft requirements docquot;,false,quot;Ianquot;], [quot;Learn JavaScript Objectsquot;,false,quot;Ianquot;]] ] ]; // update Fix bug with form to complete todos[1][3][0][1] = true;
  • 14. Functions like this function checkTask (list,task) { for(var li = 0;li<todos;li++) { if (todos[li][0] == list) { for (var ta = 0; ta < todos[li][3]; ta++) { if (todos[li][3][ta][0] == task) { todos[li][3][ta][1] == true; } } } } } checkTask(quot;Work To Dosquot;,quot;Draft requirements docquot;);
  • 15.
  • 17. JavaScript Object Literals Useful for storing related name value pairs: {country:quot;United Statesquot;, government:quot;Democracyquot;, president:quot;Barrak Obamaquot;}
  • 18. JavaScript Object Literals Useful for storing related name value pairs: {country:quot;United Statesquot;, government:quot;Democracyquot;, president:quot;Barrak Obamaquot;} Also useful for composing instructions for functions: find({government:quot;Democracyquot;}) // find all records where government == Democracy
  • 20. This is TaffyDB • A wrapper for object literals (records)
  • 21. This is TaffyDB • A wrapper for object literals (records) • Provides a JavaScript centric API (using arrays/objects)
  • 22. This is TaffyDB • A wrapper for object literals (records) • Provides a JavaScript centric API (using arrays/objects) • Uses familiar database concepts
  • 23. This is TaffyDB • A wrapper for object literals (records) • Provides a JavaScript centric API (using arrays/objects) • Uses familiar database concepts • But it isn't a DB - no persistence
  • 24. This is TaffyDB • A wrapper for object literals (records) • Provides a JavaScript centric API (using arrays/objects) • Uses familiar database concepts • But it isn't a DB - no persistence • Thin (under 12K) • Opensource and Free • Maintained (v1.7.1) • One global object, no prototype modification
  • 25. Create a data collection // create a populated data collection var jsConfSpeakers = TAFFY([ {quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;}, {quot;namequot;:quot;Francisco Tolmaskquot;,quot;topicquot;:quot;Objective-Jquot;}, {quot;namequot;:quot;Chris Andersonquot;,quot;topicquot;:quot;CouchDBquot;}, {quot;namequot;:quot;Jeff Hayniequot;,quot;topicquot;:quot;Web Apps on the Desktopquot;}, {quot;namequot;:quot;Stoyan Stefanovquot;,quot;topicquot;:quot;Kick Ass Web Appsquot;} ]);
  • 26. Insert jsConfSpeakers.insert( {quot;namequot;:quot;Richard D. Worthquot;,quot;topicquot;:quot;jQuery UIquot;} );
  • 27. Getting records jsConfSpeakers.first(); // returns {quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;}
  • 28. Getting records jsConfSpeakers.first(); // returns {quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;} // TaffyDB filtering is overloaded // 0 and [0] will both return the first record jsConfSpeakers.get(0); jsConfSpeakers.get([0]); // returns [{quot;namequot;:quot;John Resigquot;,quot;topicquot;:quot;Surprise!quot;}]
  • 29. Remove // delete is a reserved word // use remove function instead jsConfSpeakers.remove(0);
  • 31. Advanced filtering // Use Object Literals to construct quot;where clausesquot; jsConfSpeakers.find({name:quot;Chris Andersonquot;}); // returns [2]
  • 32. Advanced filtering // Use Object Literals to construct quot;where clausesquot; jsConfSpeakers.find({name:quot;Chris Andersonquot;}); // returns [2] jsConfSpeakers.find({topic:{like:quot;Web Appsquot;}}); // returns [3,4]
  • 33. Advanced filtering // Use Object Literals to construct quot;where clausesquot; jsConfSpeakers.find({name:quot;Chris Andersonquot;}); // returns [2] jsConfSpeakers.find({topic:{like:quot;Web Appsquot;}}); // returns [3,4] jsConfSpeakers.find({ topic:{like:quot;Web Appsquot;}, name:{like:quot;Jeffquot;}}); // returns [3] // quot;where topic like Web Apps and name like Jeffquot;
  • 34. Let's see it in action...
  • 35. .forEach() in details collection.forEach( function (r,index) { //whatever logic here },[optional filter]);
  • 36. .forEach() in details collection.forEach( function (r,index) { //whatever logic here },[optional filter]); // modify r and return it to update the record collection.forEach( function (r,index) { r.field = quot;new valuequot;; return r; });
  • 38. TaffyDB is Batteries Included Events: • onUpdate, onInsert, onRemove
  • 39. TaffyDB is Batteries Included Events: • onUpdate, onInsert, onRemove JSON Support
  • 40. TaffyDB is Batteries Included Events: • onUpdate, onInsert, onRemove JSON Support typeOf() methods
  • 41. TaffyDB is Batteries Included Events: • onUpdate, onInsert, onRemove JSON Support typeOf() methods Object Methods • isSameObject, mergeObject, etc
  • 42. TaffyDB is Batteries Included Events: • onUpdate, onInsert, onRemove JSON Support typeOf() methods Object Methods • isSameObject, mergeObject, etc Utility Methods
  • 44.
  • 45.
  • 51. http://taffydb.com Learn - Download - Find Help Contribute Code