Code Monkey home page Code Monkey logo

datademo's Introduction

Data Demo

Deploy

Introduction

This is a simple demonstration showing how you can use Heroku and Heroku Connect to manipulate large volumes of data, using standard SQL in your apps, and have Heroku Connect seamlessly synchronise the changes to the Salesforce organisation.

The demo uses Account records and the concept of a related territory Account Manager - we use these objects to demonstrate the modification of this relationship on a large scale through a web app on Heroku.

Within Salesforce this is using accounts with a lookup to a custom object. There are other ways to model this relationship - this configuration has been used for simplicity.

We can reassign whole countries to new Account Managers on the click of a button. Behind the scenes, we're updating the association in the Heroku Postgres database - and these changes are then asyncronously replicated to Salesforce via Heroku Connect.

If there were workflow or triggers on the data in Salesforce then these would also be run as normal.

This demo isn't a reference architecture for how you would handle Account Manager assignment in the wild. Its not necessarily the only way to do large updates in SFDC. It's not something that customers would buy!

The main purpose is to show that you can manipulate large volumes of data within your apps on Heroku using the tools and languages you are familiar with - SQL queries on the database, and the libraries and/or ORM layers you are familiar with in your code.

Getting Started

  1. First, setup a Salesforce Org following the instructions in the Chatter Group for this demo.

  2. Next, hit the deploy to Heroku button - you will need a Heroku account.

    Deploy

  3. Once the button has deployed the app, go into your Heroku dashboard for the app you just created.

  4. Click on Heroku Connect in the list of addons for your app - this will take you to the Heroku Connect dashboard.

  5. Follow the steps to initialise Heroku Connect - leave the default settings as they are - authorise Heroku Connect using the login and password for the Salesforce Org you created in step 1.

  6. Go to Settings and Import/Export Configuration - import the connect_mappings.json file in the data/ folder of this repo.

  7. The data should now begin to synchronise from your Salesforce Org into the Postgres database on Heroku.

  8. Once synchronised, go back to your Heroku Dashboard and click on the 'Open Application' link - it is the icon to the right of the app name at the top of the page.

Queue Monitoring

The app uses Sidekiq to provide the backend queueing functionality - it mounts the Sidekiq dashboard at /sidekiq on your app URL.

You can modify the code to use simple HTTP authentication on the Sidekiq dashboard - check config.ru for details.

To run locally

To run locally requires some familiarity with getting Ruby apps up and running.

Install Ruby 2.1.6 using your preferred method (rbenv, etc) and bundle the Gems.

This app uses Postgres and Redis - when deployed to Heroku this will use the Heroku add-ons. When testng locally you will either need to use local versions of both these services, or point to the services attached to an app on Heroku - be careful not to mix environments!

The app uses environment variables for REDIS_URL and DATABASE_URL - you can export these to your environment or set the values in a .env file.

To run locally using Foreman (included with the Heroku toolbelt):

foreman start

Technical Notes

This is a simple demo - it is not production level code!

It should not currently be considered an example of best practice coding - additionally this demo will also be refactored over time to make use of better Javascript development patterns - and perhaps updated to use a framework like React.

Issues

Please submit issues using Github issues https://github.com/heroku/datademo/issues

datademo's People

Contributors

chrisanderton avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.