Download - Integrating Heroku and Force.com Using Bulk and REST APIs

Transcript
Page 1: Integrating Heroku and Force.com Using Bulk and REST APIs

Integrating Force.com and HerokuIntegrating Force.com and HerokuUsing REST and Bulk APIs

Mark Puddick, Moroku, CTO

@MarkPudd

Page 2: Integrating Heroku and Force.com Using Bulk and REST APIs

Mark PuddickMark Puddick

CTO, MorokuCTO, Moroku

Page 3: Integrating Heroku and Force.com Using Bulk and REST APIs

Agenda

- Moroku Game System

- Authorization

- REST

- Bulk

- Polls Demonstration

Page 4: Integrating Heroku and Force.com Using Bulk and REST APIs

Game System - Objective

• We Gamify bank customers banking

• Allow Player to gain points for banking activities such as goal

setting

• Points, badges and leaderboard mechanics are used

• We use Heroku to run our Game Server

• Sync with Force.com

• Sync quizzes, analytics and players

Page 5: Integrating Heroku and Force.com Using Bulk and REST APIs

Game System - High Level Architecture

MobileApp

Bank Customers

Bank Admin

Moroku Game ServerGame FunctionalityAnalytics Summary

Generation

Moroku Game ConsoleConfiguration

Analytics ViewsRESTBulk API

Page 6: Integrating Heroku and Force.com Using Bulk and REST APIs

Why?

• High request volume with Heroku

• Heroku gives us some great options to scale

• Administration with Force.com

• User management

• Integration points

• Familiar look and feel

Page 7: Integrating Heroku and Force.com Using Bulk and REST APIs

Authentication

• Options

• Basic username/password

• Access Token/Refresh Flow

• Encrypted Token storage

• Configuration

• Sign on URL

Page 8: Integrating Heroku and Force.com Using Bulk and REST APIs

REST API

- Obtain Information about Salesforce or Force.com objects

- Perform SOQL queries

- Update or delete records

Page 9: Integrating Heroku and Force.com Using Bulk and REST APIs

Using REST API – SOQL to get Configuration

• Quiz configuration is done within Force.com

• Daily batch job syncs the quizzes with Heroku

• Heroku scheduler run the batches

• REST API used the get the quizzes

• Potential to run on demand

Page 10: Integrating Heroku and Force.com Using Bulk and REST APIs

Using REST API – SOQL to get Configuration

Daily Batch

Page 11: Integrating Heroku and Force.com Using Bulk and REST APIs

Using REST API -SOQL to update Analytics

• Analytics are generated around what players have been doing

• Generated from Postgres or Treasure Data

• Scheduled on Heroku Batch twice per day

• Reports, graphs and dashboard created for the bank

Page 12: Integrating Heroku and Force.com Using Bulk and REST APIs

Using REST API -SOQL to update Analytics

Twice daily batch

Page 13: Integrating Heroku and Force.com Using Bulk and REST APIs

Using BulkAPI

• Create Job – specifies the object and action

• Create Batch of content – player information

• Create subsequent batch if needed

• Close job

• Check status and results

Page 14: Integrating Heroku and Force.com Using Bulk and REST APIs

Bulk API – Update Customers Points

• Users points balance and goals uploaded

• Runs as a daily batch

• Leaderboards generated in Force.com

• Goal distribution shown in dashboard

Page 15: Integrating Heroku and Force.com Using Bulk and REST APIs

Bulk API – Update Customers Points

Daily Batch

Page 16: Integrating Heroku and Force.com Using Bulk and REST APIs

Example Application – Setup Poll and Sync

Sync

Page 17: Integrating Heroku and Force.com Using Bulk and REST APIs

Code

Github - [email protected]:markmoro/poll_demo.git

Page 18: Integrating Heroku and Force.com Using Bulk and REST APIs

All about

Moroku makes banking fun because:

•Financial Mastery is both very important and very difficult for lots of people.

•Fun is the most ancient and proven mechanism for learning skills and

delivering outcomes:   “People rarely succeed unless they have fun in what

they are doing”: Dale Carnegie, 7 Habits ……

.

Established January 2012, Sydney Australia

May 2012, Game System Beta Released

August 2012: Red Herring Asia 100

September 2013, First bank goes live

Page 19: Integrating Heroku and Force.com Using Bulk and REST APIs

Mark PuddickMark Puddick

CTO, Moroku

Page 20: Integrating Heroku and Force.com Using Bulk and REST APIs