SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Dan Woods
JavaScript, HTML5, Cryptography, Architecture
What is PhotoZero?
●   Photo storage
●   Client-side cryptography
●   Gallery sharing
●   HTML5, JavaScript application
●   Totally stateless
PhotoZero Motivation?
●   Can't trust corporate privacy policies
●   Privacy policies don't extend internationally
●   Once in the clouds, always in the clouds
●   Empowerment!
Imagine...
Imagine a day in the future where people are buying up GMail, Facebook, and
                    Twitter accounts like storage lockers...

 Once these companies get bought up, what happens to your privacy then?




       You can only trust yourself with your
                     security...
Things That I Learned
 People want PhotoZero!




  24H: 375 Photos; 48H: 800 Photos
Things That I Learned
              User Experience Is Everything!
●   I get frustrated and think its broken if I don't know something is going on
●   They won't use your service if it isn't useful to them
●   It isn't useful to them if they don't have an indication that it's working
●   Erroneous bugs will be reported which is a waste of your time and money
●   People like interacting with machines
Things That I Learned
           Mobile Experience is Everything!
●   85% of initial landings were from mobile browser
●   Average person spends over 2 full hours a day browsing mobile
●   Camera in phone; picture in phone
●   More facebookers use mobile than not
Things That I Learned
                Build On Familiar Interfaces
●   Don't make users "learn" how to use your application
●   Build on common interfaces: Facebook, Twitter, Apple
●   Photo gallery should "feel" like Facebook's
●   Feed scrolling should "feel" like Twitter
●   Walk on the path of giants
Things That I Learned
    Performance, Performance, Performance!!
●   They won't use your site if it's slow...
●   User experience suffers without good performance
    ○   Slow page renders
    ○   Users can't interact
    ○   No indication that something is happening
●   Almost everybody uses Facebook, use their performance as your baseline
    ○   You'll get a wide berth for improvements!
Tackling Performance
●   JavaScript "multi-threading" tricks
●   Split the work into manageable chunks
●   Asynchronously synchronize!
●   Use platform tools that are right for the job
●   Manage expectations
Tackling Performance
JavaScript "multi-threading" tricks... Some things I've tried:

●   Create iframe, call its javascript instead of calling it from your document
●   Function daisy-chaining for synchronicity
●   setInterval to emulate thread-like behavior


                                The Winner?
●   A Combination of All Three!


                   http://jsfiddle.net/ARR3j/
Tackling Performance
            Split the work into manageable chunks...

●   JavaScript execution time is dependent on the computer executing it
●   Chunk the workload to small enough pieces so any platform can handle it
●   Ensure that mobile platforms can handle the workload


                       PhotoZero Specifically
●   Break an image into 1k chunks, encrypt and encode those chunks
●   Asynchronously send the chunks to the server
●   Utilize "workers" to emulate background processing

                  http://jsfiddle.net/eQzcc/
Tackling Performance
                    Asynchronously Synchronize!

●   Give "workers" a reference to their position in the data set
    ○   Processing is done when all positions are flagged as completed
●   Let them finish on their own time and indicate when they are done
●   Firing workers asynchronously allows the faster chunks to finish without
    having to wait for the larger ones
●   This is particularly useful during encryption process as thumbnails may
    take longer to generate depending on images.


                   http://jsfiddle.net/qupBT/
Tackling Performance
     Use the Platform Tools That Are Right For the Job
●   For PhotoZero, PHP was a good back-end choice
    ○   Built-in MySQL, JSON support; supported by all cheap hosting
        providers; great community support; never any extra-libraries needed
●   jQuery is a well supported, extensible javascript library
    ○   If it's not built in or available as a plugin, I can leverage the library's
        framework to customize functionality
●   Android app uses PhoneGap to keep a single code base
●   PhoneGap is a bad choice for some applications
    ○   Next version of PZ app will be native with custom JavaScript
        extensions to WebView
    ○   60KB native versus 400+KB PhoneGap
    ○   Slow initial load times with PhoneGap
Tackling Performance
                     Manage User Expectations
●   Users are generally forgiving for longer load times, etc.
    ○   Facebook, case-in-point.
●   Giving users feedback at different stages of operation will make it seem
    faster
●   Ensure that your application employs the controls already at the user's
    disposal
    ○ Pushing the stop button should stop whatever is going on
    ○   Pushing the back button should take the user back to wherever they
        were -- even in a single page app
●   Bookmarks of hashes should bring the user back to where they were
●   Follow these rules and users will forgive you for taking a long time to do
    things
●   Render the DOM before doing any JS processing
User Experience
        Paramount to the Success or Failure of your App
●   Every page should be functional
    ○    Dedicate only a small part of your landing page to marketing
●   Use HTML5 localStorage when available
    ○    PZ uses localStorage for emulating statefulness
●   Cache when available
    ○    Use HTML5 localStorage to cache session data
    ○    Remember the cost of localStorage stringify/parsing when considering
         it for caching
    ○    ~2.5MB limit on cache with localStorage!
    ○    Use server-side caching for 95% read/5% write scenarios
    ○    Figure out your cache eviction strategy (time, refreshes?)
User Experience
             Familiarity and Interaction for the User
●   Build on what users already know
    ○   Facebook, Twitter, Flikr, Picasa, Shutterfly
    ○   User should not have to "learn" how to use your app
    ○   Functionality should extend to the user's device controls
         ■   back button, stop button, refresh button, bookmarks
●   Constantly give the user feedback
    ○   This way they will know when they need to click again, refresh again,
        stop, back, etc...
●   Let the user know when there is an explicit error
    ○   This way they know they should not refresh -- they will move on
User Experience
                   Thing are not as they appear...
●   Emulate statefulness in non-stateful applications
    ○   HTML5 localStorage is a great choice to serialize session data
●   PZ uses hash routers to figure out where the user wants to go
    ○   Works great for bookmarking and across refreshes
●   The user doesn't care that you built a single-page application
    ○   User wants your application to function as though it is not a single-
        page application


        http://fiddle.jshell.net/2Wy8d/2/show/
Architecture & Design
              Use Libraries and Frameworks
●   Choose a library or framework that will keep your application DRY
●   Write it yourself only if you're sure you're writing it to micro-scale
    ○   Don't get so committed to your own implementation of something else
        that is out there
    ○   PZ has its own hash router that can be swapped in favor of Ember,
        BackBoneJS, etc...
    ○   The only benefit of rewriting something yourself is to reduce
        complexity and dependencies
●   jQuery events provide a great way to build a lightweight custom framework
Architecture & Design
                 Write It Once, Write It Right
●   Structure functions and objects in a way that will allow core functionality to
    be reached from a variety of injection points
●   You know up front basically what your application will need to do
    ○   Login, logout, register, create, read, update, delete, etc...
●   Package application logic and business logic discretely
    ○   application logic: #!login landing should show the "#login" div
    ○   business logic: if #!login && localStorage.getItem("user") != null ...


                   http://jsfiddle.net/KFgEZ/
Architecture & Design
                         Think Functionally
●   Break your logic into the most atomic components possible!
●   Factor out as much as possible
    ○   Utilize JavaScript's dynamic nature to reach your goals
●   Breaking your logic into functional pieces will make it easier to debug later


                   http://jsfiddle.net/N6fmG/
Architecture & Design
                 Use Object Literal Notation
●   Object literal notation is easy to understand
●   You can give readable names to discrete logic units
●   You can wholesale segment/swap-out full portions of logic by reassigning a
    single variable
●   Object literal lends itself to maintainability by breaking logic into its own
    scope (Crypto vs. Photo)
Architecture & Design
                           Go With Events
●   Event driven architecture is the way to go for core functionality
●   Will enable your router to get users into the experience through a variety of
    injection points
●   Creates reusable code
●   Will allow you to install asynchronous "wire-taps" at critical points in the
    code without impacting user experience
●   Decouple core logic from routing logic, application logic, business logic
Architecture & Design
       DON'T TIE YOURSELF TO A DESIGN
                  PATTERN!

●   One size never fits all
●   Design patterns are continually evolving, which means that they are
    continually wrong for at least one occassion
●   The only important thing is that the code can become familiar
●   Allow your design to evolve with the application
Delivery
                            Iterate Rapidly
●   stand-up a version and tear it down when you're ready with a fix or feature
●   structure your application to allow for code-swapping without impacting
    user experience
●   if you keep the core functionality principles, then replace UI, layout, etc as
    part of your iteration without worry
●   rapid iterations will keep you interested in the project
    ○   how many of you have thrown away projects after losing interest?
Delivery
                Elicit Feedback From Users
●   Users are our "customers" and they are never wrong
●   Getting real-world feedback is unparalleled to any amount of QA
    ○   It'll keep you focused too
    ○   Don't develop in a "black box", you're setting yourself up for failure
●   Passively advertise when features are added or fixes are made
●   Give the user some visual indication that they're working with brand-new
    stuff
    ○ change the UI
    ○   increment a build number, etc
●   Use Twitter to divulge release notes
●   Notify API developers of new builds through social media

Weitere ähnliche Inhalte

Andere mochten auch

Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web FrameworkDaniel Woods
 
High Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring BootHigh Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring BootDaniel Woods
 
Groovy in the Cloud
Groovy in the CloudGroovy in the Cloud
Groovy in the CloudDaniel Woods
 
Netflix Open Source Meetup Season 4 Episode 1
Netflix Open Source Meetup Season 4 Episode 1Netflix Open Source Meetup Season 4 Episode 1
Netflix Open Source Meetup Season 4 Episode 1aspyker
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right WayDaniel Woods
 

Andere mochten auch (6)

Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web Framework
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
High Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring BootHigh Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring Boot
 
Groovy in the Cloud
Groovy in the CloudGroovy in the Cloud
Groovy in the Cloud
 
Netflix Open Source Meetup Season 4 Episode 1
Netflix Open Source Meetup Season 4 Episode 1Netflix Open Source Meetup Season 4 Episode 1
Netflix Open Source Meetup Season 4 Episode 1
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
 

Ähnlich wie Gainesville Web Developer Group, Sept 2012

Full stack development
Full stack developmentFull stack development
Full stack developmentArnav Gupta
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGearsAlessandro Molina
 
Services, tools & practices for a software house
Services, tools & practices for a software houseServices, tools & practices for a software house
Services, tools & practices for a software houseParis Apostolopoulos
 
Enterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETEnterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETAnant Corporation
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive uiPaul van Zyl
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipsterJulien Dubois
 
Front-End Developer's Career Roadmap
Front-End Developer's Career RoadmapFront-End Developer's Career Roadmap
Front-End Developer's Career RoadmapWebStackAcademy
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010Olaseni Odebiyi
 
Android Modularization
Android ModularizationAndroid Modularization
Android ModularizationYoung-Hyuk Yoo
 
Developing high performance and responsive web apps using web worker
Developing high performance and responsive web apps using web workerDeveloping high performance and responsive web apps using web worker
Developing high performance and responsive web apps using web workerSuresh Patidar
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?Vivek Parihar
 
AirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadAirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadKarthik Murugesan
 
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa... Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...Databricks
 
Writing Effective Self-Help Guides for World Domination
Writing Effective Self-Help Guides for World DominationWriting Effective Self-Help Guides for World Domination
Writing Effective Self-Help Guides for World DominationEmma Jane Hogbin Westby
 
Choosing the right JavaScript library/framework/toolkit for our project
Choosing the right JavaScript library/framework/toolkit for our projectChoosing the right JavaScript library/framework/toolkit for our project
Choosing the right JavaScript library/framework/toolkit for our projectHristo Chakarov
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projectsIBACZ
 
Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)ncoghlan_dev
 
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Toolsbarciszewski
 

Ähnlich wie Gainesville Web Developer Group, Sept 2012 (20)

Full stack development
Full stack developmentFull stack development
Full stack development
 
Service worker API
Service worker APIService worker API
Service worker API
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
Services, tools & practices for a software house
Services, tools & practices for a software houseServices, tools & practices for a software house
Services, tools & practices for a software house
 
Enterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETEnterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NET
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
Front-End Developer's Career Roadmap
Front-End Developer's Career RoadmapFront-End Developer's Career Roadmap
Front-End Developer's Career Roadmap
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
 
Developing high performance and responsive web apps using web worker
Developing high performance and responsive web apps using web workerDeveloping high performance and responsive web apps using web worker
Developing high performance and responsive web apps using web worker
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?
 
AirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadAirBNB's ML platform - BigHead
AirBNB's ML platform - BigHead
 
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa... Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 
Writing Effective Self-Help Guides for World Domination
Writing Effective Self-Help Guides for World DominationWriting Effective Self-Help Guides for World Domination
Writing Effective Self-Help Guides for World Domination
 
Choosing the right JavaScript library/framework/toolkit for our project
Choosing the right JavaScript library/framework/toolkit for our projectChoosing the right JavaScript library/framework/toolkit for our project
Choosing the right JavaScript library/framework/toolkit for our project
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
 
Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)
 
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Tools
 
Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
 

Mehr von Daniel Woods

Continuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStackContinuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStackDaniel Woods
 
Facilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at ScaleFacilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at ScaleDaniel Woods
 
Server-Side JavaScript with Nashorn
Server-Side JavaScript with NashornServer-Side JavaScript with Nashorn
Server-Side JavaScript with NashornDaniel Woods
 
Groovy for System Administrators
Groovy for System AdministratorsGroovy for System Administrators
Groovy for System AdministratorsDaniel Woods
 
Message Driven Architecture in Grails
Message Driven Architecture in GrailsMessage Driven Architecture in Grails
Message Driven Architecture in GrailsDaniel Woods
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in RatpackDaniel Woods
 

Mehr von Daniel Woods (7)

Continuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStackContinuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStack
 
Facilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at ScaleFacilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at Scale
 
Server-Side JavaScript with Nashorn
Server-Side JavaScript with NashornServer-Side JavaScript with Nashorn
Server-Side JavaScript with Nashorn
 
Future of Grails
Future of GrailsFuture of Grails
Future of Grails
 
Groovy for System Administrators
Groovy for System AdministratorsGroovy for System Administrators
Groovy for System Administrators
 
Message Driven Architecture in Grails
Message Driven Architecture in GrailsMessage Driven Architecture in Grails
Message Driven Architecture in Grails
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in Ratpack
 

Kürzlich hochgeladen

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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 2024Rafal Los
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 TerraformAndrey Devyatkin
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
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 2024The Digital Insurer
 
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 FresherRemote DBA Services
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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...Neo4j
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Kürzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Gainesville Web Developer Group, Sept 2012

  • 1. Dan Woods JavaScript, HTML5, Cryptography, Architecture
  • 2. What is PhotoZero? ● Photo storage ● Client-side cryptography ● Gallery sharing ● HTML5, JavaScript application ● Totally stateless
  • 3. PhotoZero Motivation? ● Can't trust corporate privacy policies ● Privacy policies don't extend internationally ● Once in the clouds, always in the clouds ● Empowerment!
  • 4. Imagine... Imagine a day in the future where people are buying up GMail, Facebook, and Twitter accounts like storage lockers... Once these companies get bought up, what happens to your privacy then? You can only trust yourself with your security...
  • 5. Things That I Learned People want PhotoZero! 24H: 375 Photos; 48H: 800 Photos
  • 6. Things That I Learned User Experience Is Everything! ● I get frustrated and think its broken if I don't know something is going on ● They won't use your service if it isn't useful to them ● It isn't useful to them if they don't have an indication that it's working ● Erroneous bugs will be reported which is a waste of your time and money ● People like interacting with machines
  • 7. Things That I Learned Mobile Experience is Everything! ● 85% of initial landings were from mobile browser ● Average person spends over 2 full hours a day browsing mobile ● Camera in phone; picture in phone ● More facebookers use mobile than not
  • 8. Things That I Learned Build On Familiar Interfaces ● Don't make users "learn" how to use your application ● Build on common interfaces: Facebook, Twitter, Apple ● Photo gallery should "feel" like Facebook's ● Feed scrolling should "feel" like Twitter ● Walk on the path of giants
  • 9. Things That I Learned Performance, Performance, Performance!! ● They won't use your site if it's slow... ● User experience suffers without good performance ○ Slow page renders ○ Users can't interact ○ No indication that something is happening ● Almost everybody uses Facebook, use their performance as your baseline ○ You'll get a wide berth for improvements!
  • 10. Tackling Performance ● JavaScript "multi-threading" tricks ● Split the work into manageable chunks ● Asynchronously synchronize! ● Use platform tools that are right for the job ● Manage expectations
  • 11. Tackling Performance JavaScript "multi-threading" tricks... Some things I've tried: ● Create iframe, call its javascript instead of calling it from your document ● Function daisy-chaining for synchronicity ● setInterval to emulate thread-like behavior The Winner? ● A Combination of All Three! http://jsfiddle.net/ARR3j/
  • 12. Tackling Performance Split the work into manageable chunks... ● JavaScript execution time is dependent on the computer executing it ● Chunk the workload to small enough pieces so any platform can handle it ● Ensure that mobile platforms can handle the workload PhotoZero Specifically ● Break an image into 1k chunks, encrypt and encode those chunks ● Asynchronously send the chunks to the server ● Utilize "workers" to emulate background processing http://jsfiddle.net/eQzcc/
  • 13. Tackling Performance Asynchronously Synchronize! ● Give "workers" a reference to their position in the data set ○ Processing is done when all positions are flagged as completed ● Let them finish on their own time and indicate when they are done ● Firing workers asynchronously allows the faster chunks to finish without having to wait for the larger ones ● This is particularly useful during encryption process as thumbnails may take longer to generate depending on images. http://jsfiddle.net/qupBT/
  • 14. Tackling Performance Use the Platform Tools That Are Right For the Job ● For PhotoZero, PHP was a good back-end choice ○ Built-in MySQL, JSON support; supported by all cheap hosting providers; great community support; never any extra-libraries needed ● jQuery is a well supported, extensible javascript library ○ If it's not built in or available as a plugin, I can leverage the library's framework to customize functionality ● Android app uses PhoneGap to keep a single code base ● PhoneGap is a bad choice for some applications ○ Next version of PZ app will be native with custom JavaScript extensions to WebView ○ 60KB native versus 400+KB PhoneGap ○ Slow initial load times with PhoneGap
  • 15. Tackling Performance Manage User Expectations ● Users are generally forgiving for longer load times, etc. ○ Facebook, case-in-point. ● Giving users feedback at different stages of operation will make it seem faster ● Ensure that your application employs the controls already at the user's disposal ○ Pushing the stop button should stop whatever is going on ○ Pushing the back button should take the user back to wherever they were -- even in a single page app ● Bookmarks of hashes should bring the user back to where they were ● Follow these rules and users will forgive you for taking a long time to do things ● Render the DOM before doing any JS processing
  • 16. User Experience Paramount to the Success or Failure of your App ● Every page should be functional ○ Dedicate only a small part of your landing page to marketing ● Use HTML5 localStorage when available ○ PZ uses localStorage for emulating statefulness ● Cache when available ○ Use HTML5 localStorage to cache session data ○ Remember the cost of localStorage stringify/parsing when considering it for caching ○ ~2.5MB limit on cache with localStorage! ○ Use server-side caching for 95% read/5% write scenarios ○ Figure out your cache eviction strategy (time, refreshes?)
  • 17. User Experience Familiarity and Interaction for the User ● Build on what users already know ○ Facebook, Twitter, Flikr, Picasa, Shutterfly ○ User should not have to "learn" how to use your app ○ Functionality should extend to the user's device controls ■ back button, stop button, refresh button, bookmarks ● Constantly give the user feedback ○ This way they will know when they need to click again, refresh again, stop, back, etc... ● Let the user know when there is an explicit error ○ This way they know they should not refresh -- they will move on
  • 18. User Experience Thing are not as they appear... ● Emulate statefulness in non-stateful applications ○ HTML5 localStorage is a great choice to serialize session data ● PZ uses hash routers to figure out where the user wants to go ○ Works great for bookmarking and across refreshes ● The user doesn't care that you built a single-page application ○ User wants your application to function as though it is not a single- page application http://fiddle.jshell.net/2Wy8d/2/show/
  • 19. Architecture & Design Use Libraries and Frameworks ● Choose a library or framework that will keep your application DRY ● Write it yourself only if you're sure you're writing it to micro-scale ○ Don't get so committed to your own implementation of something else that is out there ○ PZ has its own hash router that can be swapped in favor of Ember, BackBoneJS, etc... ○ The only benefit of rewriting something yourself is to reduce complexity and dependencies ● jQuery events provide a great way to build a lightweight custom framework
  • 20. Architecture & Design Write It Once, Write It Right ● Structure functions and objects in a way that will allow core functionality to be reached from a variety of injection points ● You know up front basically what your application will need to do ○ Login, logout, register, create, read, update, delete, etc... ● Package application logic and business logic discretely ○ application logic: #!login landing should show the "#login" div ○ business logic: if #!login && localStorage.getItem("user") != null ... http://jsfiddle.net/KFgEZ/
  • 21. Architecture & Design Think Functionally ● Break your logic into the most atomic components possible! ● Factor out as much as possible ○ Utilize JavaScript's dynamic nature to reach your goals ● Breaking your logic into functional pieces will make it easier to debug later http://jsfiddle.net/N6fmG/
  • 22. Architecture & Design Use Object Literal Notation ● Object literal notation is easy to understand ● You can give readable names to discrete logic units ● You can wholesale segment/swap-out full portions of logic by reassigning a single variable ● Object literal lends itself to maintainability by breaking logic into its own scope (Crypto vs. Photo)
  • 23. Architecture & Design Go With Events ● Event driven architecture is the way to go for core functionality ● Will enable your router to get users into the experience through a variety of injection points ● Creates reusable code ● Will allow you to install asynchronous "wire-taps" at critical points in the code without impacting user experience ● Decouple core logic from routing logic, application logic, business logic
  • 24. Architecture & Design DON'T TIE YOURSELF TO A DESIGN PATTERN! ● One size never fits all ● Design patterns are continually evolving, which means that they are continually wrong for at least one occassion ● The only important thing is that the code can become familiar ● Allow your design to evolve with the application
  • 25. Delivery Iterate Rapidly ● stand-up a version and tear it down when you're ready with a fix or feature ● structure your application to allow for code-swapping without impacting user experience ● if you keep the core functionality principles, then replace UI, layout, etc as part of your iteration without worry ● rapid iterations will keep you interested in the project ○ how many of you have thrown away projects after losing interest?
  • 26. Delivery Elicit Feedback From Users ● Users are our "customers" and they are never wrong ● Getting real-world feedback is unparalleled to any amount of QA ○ It'll keep you focused too ○ Don't develop in a "black box", you're setting yourself up for failure ● Passively advertise when features are added or fixes are made ● Give the user some visual indication that they're working with brand-new stuff ○ change the UI ○ increment a build number, etc ● Use Twitter to divulge release notes ● Notify API developers of new builds through social media