SlideShare a Scribd company logo
1 of 54
Download to read offline
Scalable Cloud Apps
                  That Won't Keep You Up At
                             Night

                      Aaron Douglas @astralbodies Twitter/ADN

                          Red Arrow Labs - Milwaukee, WI


Friday, March 8, 13
So you have an app
                          (or an idea)


Friday, March 8, 13
You want people to
                      download and use it.


Friday, March 8, 13
Most apps need to
                       integrate with
                         something.


Friday, March 8, 13
Because integration
                       (collaboration) is
                          interesting


Friday, March 8, 13
Interesting apps =
                       MOAR MONEY


Friday, March 8, 13
Why should I use the
                           “Cloud”?


Friday, March 8, 13
Scalability &
                      Infrastructure


Friday, March 8, 13
Cross Platform



Friday, March 8, 13
Our App Idea



Friday, March 8, 13
• Conference App
                      • Speakers
                      • Sessions
                      • Map
                      • Comments & Notes
                      • Photos
Friday, March 8, 13
Why not iCloud?

                      • Still a hot mess with Core Data
                      • iOS and Mac only
                      • Hard to debug


Friday, March 8, 13
Options



Friday, March 8, 13
We’re Going to Use
                            Parse


Friday, March 8, 13
What Parse Provides
                      •   Data storage - RESTful API & Native SDKs
                      •   Queries
                      •   ACLs / Users
                      •   Cloud Code & Push Notifications
                      •   File Storage
                      •   In-App Purchases
                      •   GeoPoints & Spatial Queries


Friday, March 8, 13
Friday, March 8, 13
Add To Your Project

                      $ vi Podfile
                      pod 'Parse'

                      $ pod install




Friday, March 8, 13
Friday, March 8, 13
Friday, March 8, 13
AppDelegate.m

    #import <Parse/Parse.h>

    ...

    [Parse setApplicationId:@"3lZSGBNTs03wQigx2apDHwUv6ZczMVaIib8nUz"
                  clientKey:@"rstZrElVxBiB5tzsWn10QK9AfrRR0GkQQj16Hj"];




Friday, March 8, 13
Objects
                      • Session
                      • Schedule
                      • Speaker
                      • Attendee Notes
                      • Attendee Schedule
                      • ... and on and on
Friday, March 8, 13
PFObject
                      • Key-Value pairs
                      • Schema-less
                      • JSON data types: NSString, NSNumber,
                        NSDate, NSData, NSArray, NSDictionary
                      • Associations - 1:1, 1:N, N:N
                      • objectId, updatedAt, createdAt
Friday, March 8, 13
PFObject
               PFObject   *speaker = [PFObject objectWithClassName:@"Speaker"];
               [speaker   setObject:@"Marty" forKey:@"firstName"];
               [speaker   setObject:@"McFly" forKey:@"lastName"];
               [speaker   setObject:@"Hill Valley, CA" forKey:@"location"];

               NSLog(@"Object ID before save: %@", speaker.objectId);

               [speaker save]; // MAGIC HAPPENS HERE

               NSLog(@"Object ID after save: %@", speaker.objectId);


         2013-03-03 16:19:08.923 CocoaConfParse[4803:c07] Object ID before save: (null)
         2013-03-03 16:19:09.468 CocoaConfParse[4803:c07] Object ID after save: 6iXsTrvWd0




Friday, March 8, 13
Back on Parse.com...




Friday, March 8, 13
Refresh

    [speaker refresh];

    [speaker refresh:&error];

    [speaker refreshInBackgroundWithBlock:^(PFObject *object, NSError
    *error) {
        // Code
    }];




Friday, March 8, 13
Removing Data


               [speaker removeObjectForKey:@"favoriteStarWarsCharacter"];

               [speaker deleteInBackground];




Friday, March 8, 13
Relationships
           PFObject *session = [PFObject
           objectWithoutDataWithClassName:@"Session"
           objectId:@"6iXsTrvWd0"];

           [sessionComment setObject:session forKey:@"session"];


    PFObject *session = [sessionComment objectForKey:@"session"];

    [session fetchIfNeededInBackgroundWithBlock:^(PFObject *object,
    NSError *error) {
        NSString *title = [post objectForKey:@"title"];
    }];




Friday, March 8, 13
Query by ID
                      PFQuery *query = [PFQuery queryWithClassName:@"Speaker"];
                      PFObject *object = [query getObjectWithId:@"jFgtbb2aCb"];

                      NSLog(@"Name: %@ %@",
                            object[@"firstName"],
                            object[@"lastName"]);



                 2013-03-03 17:08:52.484 CocoaConfParse[6892:c07] Name: Marty McFly




Friday, March 8, 13
Querying
                      PFQuery *query = [PFQuery queryWithClassName:@"Speaker"];
                      [query whereKey:@"lastName" equalTo:@"McFly"];
                      query.cachePolicy = kPFCachePolicyNetworkElseCache;

                      PFObject *object = [query getFirstObject];

                      NSLog(@"Name: %@ %@",
                            object[@"firstName"],
                            object[@"lastName"]);

                 2013-03-03 17:08:52.484 CocoaConfParse[6892:c07] Name: Marty McFly




Friday, March 8, 13
Queries

                      • NSPredicate
                      • 1000 records max (100 default)
                      • Relational queries
                      • Cache policies

Friday, March 8, 13
Asynchronous
                      PFObject *speaker = ...;

                      [speaker save];

                      [speaker saveEventually];

                      [speaker saveInBackground];

                      [speaker saveInBackgroundWithBlock:
                          ^(BOOL succeeded, NSError *error){}];




Friday, March 8, 13
Users
      [PFUser enableAutomaticUser];

      PFUser *currentUser = [PFUser currentUser];
      [currentUser setObject:[NSDate date] forKey:@"lastLaunched"];
      [currentUser saveInBackground];


      PFUser *user = [PFUser user];
      user.username = @"martymcfly";
      user.password = @"awesomesauce";
      [user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError
      *error) {

      }];

      [PFUser logInWithUsernameInBackground:@"martymcfly"
      password:@"awesomesauce" block:^(PFUser *user, NSError *error) {

      }];

Friday, March 8, 13
ACLs
                      PFObject *feedback =
                          [PFObject objectWithClassName:@"SessionFeedback"];
                      [feedback setObject:@"I enjoyed it." forKey:@"comment"];

                      feedback.ACL = [PFACL ACLWithUser:[PFUser currentUser]];

                      [feedback saveInBackground];




Friday, March 8, 13
Built-In Views




Friday, March 8, 13
App Structure

                      • Where does Parse start & end?
                      • Service Layers
                      • Parse everywhere


Friday, March 8, 13
Data Transfer Objects


                      • Map PFObject to some object in your code
                      • Parse is contract/schema-free


Friday, March 8, 13
Push Notifications

                      • Still requires APN setup
                      • Simplifies addressing & registration
                      • Cross platform (Android & iOS)


Friday, March 8, 13
Push Registration
          - (void)application:(UIApplication *)application
          didRegisterForRemoteNotificationsWithDeviceToken:(NSData
          *)deviceToken
          {
              // Store the deviceToken in the current
              // Installation and save it to Parse.
              PFInstallation *currentInstallation =
                  [PFInstallation currentInstallation];

                      [currentInstallation setDeviceTokenFromData:deviceToken];
                      [currentInstallation saveInBackground];
          }




Friday, March 8, 13
Channels
                PFInstallation *currentInstallation = [PFInstallation
            currentInstallation];
                [currentInstallation addUniqueObject:@"Speakers"
            forKey:@"channels"];
                [currentInstallation saveInBackground];



                      PFPush *push = [[PFPush alloc] init];
                      [push setChannel:@"Speakers"];
                      [push setMessage:@"Thanks for all the fish!"];
                      [push sendPushInBackground];




Friday, March 8, 13
In-App Purchases

                      • Wraps StoreKit
                      • Receipt verification
                      • Asset download
                      • PFProductTableViewController

Friday, March 8, 13
What about server-side
                         calls?


Friday, March 8, 13
• Create new speakers & sessions
                      • Attendees register preferences
                      • Push notifications when session changes
                      • Welcome emails


Friday, March 8, 13
Cloud Code lets you
                  deploy server-side code


Friday, March 8, 13
Cloud Code

                      •   RESTful API

                      •   JavaScript Language

                      •   Triggers & Validation

                      •   Modules




Friday, March 8, 13
Installing the CL Tool
               $ curl -s https://www.parse.com/downloads/cloud_code/
               installer.sh | sudo /bin/bash

               $ parse new CocoaConfCloudCode
               Email: astralbodies@gmail.com
               Password:
               1:CocoaConf
               Select an App:1

               $ cd CocoaConfCloudCode




Friday, March 8, 13
$ vi cloud/sessions.js



               Parse.Cloud.define("numberOfSpeakers", function(request,
               response) {
                 var query = new Parse.Query("Speaker");
                 query.find({
                   success: function(results) {
                     response.success(results.count);
                   },
                   error: function() {
                     response.error("Speaker lookup failed");
                   }
                 });
               });




Friday, March 8, 13
$ parse deploy
               $ curl -X POST 
                 -H "X-Parse-Application-Id: MN28ox..." 
                 -H "X-Parse-REST-API-Key: RItKo..." 
                 -H "Content-Type: application/json" 
                 -d '{}' 
                 https://api.parse.com/1/functions/numberOfSpeakers

               {
                 "result": 1
               }




Friday, March 8, 13
Friday, March 8, 13
Modules




Friday, March 8, 13
Cloud Code

                      • Still in its infancy
                      • No scheduled events
                      • Take a look at iron.io


Friday, March 8, 13
Cost

                      • Free (1 million API requests / Pushes / 1GB)
                      • $199/month (15mil / 5mil / 10GB)
                      • Enterprise >$199


Friday, March 8, 13
Portability

                      • Import
                      • Export
                      • Service layer to abstract
                      • Never really want to lock into a technology

Friday, March 8, 13
Code



Friday, March 8, 13
Questions?



Friday, March 8, 13

More Related Content

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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 AutomationSafe Software
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Scalable Cloud Apps That Won't Keep You Up At Night

  • 1. Scalable Cloud Apps That Won't Keep You Up At Night Aaron Douglas @astralbodies Twitter/ADN Red Arrow Labs - Milwaukee, WI Friday, March 8, 13
  • 2. So you have an app (or an idea) Friday, March 8, 13
  • 3. You want people to download and use it. Friday, March 8, 13
  • 4. Most apps need to integrate with something. Friday, March 8, 13
  • 5. Because integration (collaboration) is interesting Friday, March 8, 13
  • 6. Interesting apps = MOAR MONEY Friday, March 8, 13
  • 7. Why should I use the “Cloud”? Friday, March 8, 13
  • 8. Scalability & Infrastructure Friday, March 8, 13
  • 10. Our App Idea Friday, March 8, 13
  • 11. • Conference App • Speakers • Sessions • Map • Comments & Notes • Photos Friday, March 8, 13
  • 12. Why not iCloud? • Still a hot mess with Core Data • iOS and Mac only • Hard to debug Friday, March 8, 13
  • 14. We’re Going to Use Parse Friday, March 8, 13
  • 15. What Parse Provides • Data storage - RESTful API & Native SDKs • Queries • ACLs / Users • Cloud Code & Push Notifications • File Storage • In-App Purchases • GeoPoints & Spatial Queries Friday, March 8, 13
  • 17. Add To Your Project $ vi Podfile pod 'Parse' $ pod install Friday, March 8, 13
  • 20. AppDelegate.m #import <Parse/Parse.h> ... [Parse setApplicationId:@"3lZSGBNTs03wQigx2apDHwUv6ZczMVaIib8nUz" clientKey:@"rstZrElVxBiB5tzsWn10QK9AfrRR0GkQQj16Hj"]; Friday, March 8, 13
  • 21. Objects • Session • Schedule • Speaker • Attendee Notes • Attendee Schedule • ... and on and on Friday, March 8, 13
  • 22. PFObject • Key-Value pairs • Schema-less • JSON data types: NSString, NSNumber, NSDate, NSData, NSArray, NSDictionary • Associations - 1:1, 1:N, N:N • objectId, updatedAt, createdAt Friday, March 8, 13
  • 23. PFObject PFObject *speaker = [PFObject objectWithClassName:@"Speaker"]; [speaker setObject:@"Marty" forKey:@"firstName"]; [speaker setObject:@"McFly" forKey:@"lastName"]; [speaker setObject:@"Hill Valley, CA" forKey:@"location"]; NSLog(@"Object ID before save: %@", speaker.objectId); [speaker save]; // MAGIC HAPPENS HERE NSLog(@"Object ID after save: %@", speaker.objectId); 2013-03-03 16:19:08.923 CocoaConfParse[4803:c07] Object ID before save: (null) 2013-03-03 16:19:09.468 CocoaConfParse[4803:c07] Object ID after save: 6iXsTrvWd0 Friday, March 8, 13
  • 25. Refresh [speaker refresh]; [speaker refresh:&error]; [speaker refreshInBackgroundWithBlock:^(PFObject *object, NSError *error) { // Code }]; Friday, March 8, 13
  • 26. Removing Data [speaker removeObjectForKey:@"favoriteStarWarsCharacter"]; [speaker deleteInBackground]; Friday, March 8, 13
  • 27. Relationships PFObject *session = [PFObject objectWithoutDataWithClassName:@"Session" objectId:@"6iXsTrvWd0"]; [sessionComment setObject:session forKey:@"session"]; PFObject *session = [sessionComment objectForKey:@"session"]; [session fetchIfNeededInBackgroundWithBlock:^(PFObject *object, NSError *error) { NSString *title = [post objectForKey:@"title"]; }]; Friday, March 8, 13
  • 28. Query by ID PFQuery *query = [PFQuery queryWithClassName:@"Speaker"]; PFObject *object = [query getObjectWithId:@"jFgtbb2aCb"]; NSLog(@"Name: %@ %@", object[@"firstName"], object[@"lastName"]); 2013-03-03 17:08:52.484 CocoaConfParse[6892:c07] Name: Marty McFly Friday, March 8, 13
  • 29. Querying PFQuery *query = [PFQuery queryWithClassName:@"Speaker"]; [query whereKey:@"lastName" equalTo:@"McFly"]; query.cachePolicy = kPFCachePolicyNetworkElseCache; PFObject *object = [query getFirstObject]; NSLog(@"Name: %@ %@", object[@"firstName"], object[@"lastName"]); 2013-03-03 17:08:52.484 CocoaConfParse[6892:c07] Name: Marty McFly Friday, March 8, 13
  • 30. Queries • NSPredicate • 1000 records max (100 default) • Relational queries • Cache policies Friday, March 8, 13
  • 31. Asynchronous PFObject *speaker = ...; [speaker save]; [speaker saveEventually]; [speaker saveInBackground]; [speaker saveInBackgroundWithBlock: ^(BOOL succeeded, NSError *error){}]; Friday, March 8, 13
  • 32. Users [PFUser enableAutomaticUser]; PFUser *currentUser = [PFUser currentUser]; [currentUser setObject:[NSDate date] forKey:@"lastLaunched"]; [currentUser saveInBackground]; PFUser *user = [PFUser user]; user.username = @"martymcfly"; user.password = @"awesomesauce"; [user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { }]; [PFUser logInWithUsernameInBackground:@"martymcfly" password:@"awesomesauce" block:^(PFUser *user, NSError *error) { }]; Friday, March 8, 13
  • 33. ACLs PFObject *feedback = [PFObject objectWithClassName:@"SessionFeedback"]; [feedback setObject:@"I enjoyed it." forKey:@"comment"]; feedback.ACL = [PFACL ACLWithUser:[PFUser currentUser]]; [feedback saveInBackground]; Friday, March 8, 13
  • 35. App Structure • Where does Parse start & end? • Service Layers • Parse everywhere Friday, March 8, 13
  • 36. Data Transfer Objects • Map PFObject to some object in your code • Parse is contract/schema-free Friday, March 8, 13
  • 37. Push Notifications • Still requires APN setup • Simplifies addressing & registration • Cross platform (Android & iOS) Friday, March 8, 13
  • 38. Push Registration - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { // Store the deviceToken in the current // Installation and save it to Parse. PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setDeviceTokenFromData:deviceToken]; [currentInstallation saveInBackground]; } Friday, March 8, 13
  • 39. Channels PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation addUniqueObject:@"Speakers" forKey:@"channels"]; [currentInstallation saveInBackground]; PFPush *push = [[PFPush alloc] init]; [push setChannel:@"Speakers"]; [push setMessage:@"Thanks for all the fish!"]; [push sendPushInBackground]; Friday, March 8, 13
  • 40. In-App Purchases • Wraps StoreKit • Receipt verification • Asset download • PFProductTableViewController Friday, March 8, 13
  • 41. What about server-side calls? Friday, March 8, 13
  • 42. • Create new speakers & sessions • Attendees register preferences • Push notifications when session changes • Welcome emails Friday, March 8, 13
  • 43. Cloud Code lets you deploy server-side code Friday, March 8, 13
  • 44. Cloud Code • RESTful API • JavaScript Language • Triggers & Validation • Modules Friday, March 8, 13
  • 45. Installing the CL Tool $ curl -s https://www.parse.com/downloads/cloud_code/ installer.sh | sudo /bin/bash $ parse new CocoaConfCloudCode Email: astralbodies@gmail.com Password: 1:CocoaConf Select an App:1 $ cd CocoaConfCloudCode Friday, March 8, 13
  • 46. $ vi cloud/sessions.js Parse.Cloud.define("numberOfSpeakers", function(request, response) {   var query = new Parse.Query("Speaker");   query.find({     success: function(results) {       response.success(results.count);     },     error: function() {       response.error("Speaker lookup failed");     }   }); }); Friday, March 8, 13
  • 47. $ parse deploy $ curl -X POST   -H "X-Parse-Application-Id: MN28ox..."   -H "X-Parse-REST-API-Key: RItKo..."   -H "Content-Type: application/json"   -d '{}'   https://api.parse.com/1/functions/numberOfSpeakers {   "result": 1 } Friday, March 8, 13
  • 50. Cloud Code • Still in its infancy • No scheduled events • Take a look at iron.io Friday, March 8, 13
  • 51. Cost • Free (1 million API requests / Pushes / 1GB) • $199/month (15mil / 5mil / 10GB) • Enterprise >$199 Friday, March 8, 13
  • 52. Portability • Import • Export • Service layer to abstract • Never really want to lock into a technology Friday, March 8, 13