Tag Archives: AWS

Back to blog home page

Integrate Your Backand App with SalesforceIQ

Posted by on May 10, 2017

Building and maintaining customer relationships is crucial for driving sales to your platform. However, it can also be a complex process requiring integrating data from multiple sources and, more importantly, ensuring that data is accessible when it is needed. In our last post we examined Integrating with Salesforce CRM. In this article, we’ll look at integrating a Backand application with the popular SalesforceIQ platform, providing you with all of the tools you need to effectively leverage your customer data in your Backand application.

What is SalesforceIQ?

SalesforceIQ is an out-of-the-box CRM solution that quickly gives you access to dynamic information tied into a full CRM solution. With Automatic Data Capture and enterprise-level intelligence under the hood, SalesforceIQ acts like your own personal assistant so you can focus on what matters most: selling. SalesforceIQ, in addition to providing easy integrations with tools like Google and Microsoft Exchange, also gives you the capability to dynamically access and manage your data through a series of robust APIs.

Use Cases for Custom Integrations

SalesforceIQ is a powerful tool, but that power needs to be available to your developers and sales organization if it is going to be useful. While SalesforceIQ offers some mobile functionality, performing deeper integrations with your organization’s data will require some development work to effectively leverage your leads. Below are a few sample use-cases that can be executed while using Backand to drive an integration with SalesforceIQ:

  • You can use real-time communications to push notifications to your sales people via your mobile app
  • You can integrate SalesforceIQ with other internal systems, like HR, Ops, or internal tracking and monitoring
  • You can use SalesforceIQ with a custom database, to increase productivity by easily consolidating all of your relevant customer data into a single location
  • You can integrate SalesforceIQ with customer-facing applications, collecting and updating data from sales leads in real time

Connecting a Backand application to SalesforceIQ

Integrating Backand and SalesforceIQ is as simple as leveraging the full-featured API provided by Salesforce from within your Backand application. While traditionally you’d need to make these calls to the API from a server, you can achieve the same functionality in Backand by using our custom template action. This action provides an easy-to-use code template for making calls to the SalesforceIQ API, letting you update your user tracking data based upon user activity in your Backand app, or even update your Backand app’s UI based on what you know about your user in SalesforceIQ.

Working with the SalesforceIQ API provides you with full capabilities to create, retrieve, and update data on your users, as well as manage their information in SalesforceIQ. Communicating with their API is as simple as translating the cURL commands provided by Salesforce in their documentation into the appropriate $http calls that you can make from JavaScript. Simply provide the required authentication and identification headers, construct the URL, make the call, and handle the response when it arrives, dispatching it either directly to your application via a synchronous function call return, or emitting the data as an event using our Socket-based real-time communications functionality.

The Salesforce Action Template

We have created an action template that will give you jump start with SalesforceIQ. You can either trigger this action from an object’s database transaction event actions or create a new on-demand action that you can call from your app’s client code. The following JavaScript is provided by the template action, which is available as “SalesforceIQ” in the “CRM & ERP” section of action templates.

This code provides you with all of the basic tools you need to get connected to the SalesforceIQ API. It takes in your SalesforceIQ API Key and API Secret, and performs a call to the “/accounts” endpoint to fetch accounts.

Connecting to your SalesforceIQ account

To connect to SalesforceIQ, you’ll first need to register for an account if you haven’t done so. Once you’ve signed up, follow these steps to obtain your API Key and API Secret:

1. Open Settings under the gear icon
2. Open the ‘Integration’ tab under ‘My Account Settings’
3. Under ‘Create New Custom Integration,’ click ‘Custom’
4. Set the name to ‘Backand API,’ and provide a description
5. Copy the ‘API Key’ and ‘API Secret’ from the integration page into the JavaScript Action code
6. Click ‘Save’

When this is completed, you should now be able to access all of your SalesforceIQ accounts from the custom JavaScript action.

Setup client-side code

Once you’ve configured the action to connect to SalesforceIQ, you’ll need to call the action from your client-side code. To do so, use the following JavaScript to construct a GET request and trigger your SalesforceIQ action:

Simply replace ‘your object name’ with the object that contains your SalesforceIQ custom action, and replace ‘your action name’ with the name of the action that you provided while creating the integration.

With these changes, you’re now able to pull in any and all SalesforceIQ accounts available via their API! You can use a similar pattern to construct additional calls to the SalesforceIQ API – simply replace the URL and parameters in the custom SalesforceIQ action with the URL and parameters for the object you want to retrieve.

Adapting for AWS Lambda

For operations that have significant security concerns, or that represent complex business logic centered around an integration with Salesforce, it may benefit you to implement your Salesforce CRM integration as an AWS Lambda function using Backand’s Node.JS AWS Lambda server-side functions. You can even use most of the code we’ve already supplied, we simply need to modify the method we use to send HTTP requests to Salesforce to use a method compatible with Node.JS. Node implements HTTP communications using the ‘http’ module, which will need to be included. Once the module is ready, converting the code above is very straightforward. Take the HTTP request lines, provided below:

And replace these lines with the Node.JS equivalent:

You’ll need to provide a callback function that handles the response data. As the format of this function will depend heavily on your app’s data, we’ve left this blank in this post.

Conclusion

CRM software is only useful if it can be aware of activity on all of your organization’s customer touchpoints. By integrating your Backand app with Salesforce IQ, you can now incorporate your in-house and public web and mobile applications with the Salesforce IQ API, providing you valuable data on customer actions and behavior, while giving you more tools to gauge the success of your outreach efforts. You’re now free to truly customize your sales funnel and marketing efforts to take advantage of actual user behavior within your Backand-powered applications.

Back to blog home page

Integrate Your Backand App with Salesforce to Leverage Customer Data

Posted by on Apr 13, 2017

Building and maintaining customer relationships is crucial for driving sales to your platform. However, it can also be a complex process requiring integrating data from multiple sources and, more importantly, ensuring that data is accessible when it is needed. In this article, we’ll look at integrating a Backand application with the popular Salesforce CRM platform, providing you with all of the tools you need to effectively leverage your customer data in your Backand application.

In our next post, we’ll be discussing similar integration with the SalesforceIQ product.

Use Cases for Custom Integrations with Salesforce CRM

Salesforce CRM is a powerful tool, and it needs data streams to thrive and bring value to an organization. With Backand, you can integrate Salesforce CRM into your organization’s tech stack, allowing your sales organization to more effectively leverage your leads. Below are a few examples of use-cases that can leverage Backand to drive an integration with Salesforce CRM:

  • You can use real-time communications to push notifications to your sales people via your mobile app
  • You can integrate Salesforce.com with other internal systems, like HR, Ops, or internal tracking and monitoring
  • You can use Salesforce.com with a custom database, to increase productivity by easily consolidating all of your relevant customer data into a single location
  • You can integrate Salesforce.com with customer-facing applications, collecting and updating data from sales leads in real time

Connecting to Salesforce CRM

Integrating Backand and Salesforce CRM is as simple as leveraging the full-featured REST API provided by Salesforce from within your Backand application. While traditionally you’d need to make these calls to the API from a server, you can achieve the same functionality in Backand by using our custom template action. This action provides an easy-to-use code template for making calls to the Salesforce REST API, letting you update your user tracking data based upon user activity in your Backand app, or even update your Backand app’s UI based upon what you know about your user in Salesforce.

The Salesforce CRM Action Template

We have created an action template that will give you jump start with Salesforce CRM. You can either trigger this action with an object’s CRUD event handler, or call it on-demand from your client code. The following is the content of the ready action template call
Salesforce CRM under the CRM & ERP section:

The above code fetches the access token every time you call the action. You can improve the performance of this call by caching the token into a Backand Server-Side Cookie, and only performing the retrieval when the token has expired.

Setup access and get client and secret keys

Follow these steps to obtain your Salesforce CRM authentication information:

  1. Sign in to Salesforce CRM as a user with Admin rights
  2. Open Setup, found under the gear icon
  3. Open App Manager
  4. Click on New Connected App
  5. Provide Connected App Name, API Name, and Contact Email
  6. Check Enable OAuth Settings
    1. Check Enable for Device Flow
    2. Under Selected OAuth Scopes, select Full Access (or any other permissions you need)
  7. Click Save
  8. Copy Consumer Key into the client variable in the code
  9. Copy Consumer Secret into the secret variable in the code

Once you’ve obtained the consumer key and the consumer secret, you’ll need to enable server-side security in Salesforce. To do so, follow these steps:

  1. From App Manager, select your new App and Click Manage
  2. Click Edit Policies
  3. Change IP Relaxation to Relax IP Restriction, or add Backand’s IP to your organization’s IP restrictions
  4. Change Timeout Value to 24 hours
  5. Click Save

With that completed, you should now have full access to your CRM objects using the Salesforce REST API.

Setup client-side code

Once you’ve configured the action to connect to Salesforce, you’ll need to call the action from your client-side code. To do so, use the following JavaScript to construct a GET request and trigger your Salesforce action:

Simply replace ‘your object name’ with the object that contains your Salesforce custom action, and replace ‘your action name’ with the name of the action that you provided while creating the integration.

With these changes, you’re now able to pull in any and all Salesforce accounts available via their API! You can use a similar pattern to construct additional calls to the Salesforce API – simply replace the URL and parameters in the custom SalesforceCRM action with the URL and parameters for the object you want to retrieve.

Adapting for AWS Lambda

For operations that have significant security concerns, or that represent complex business logic centered around an integration with Salesforce, it may benefit you to implement your Salesforce CRM integration as an AWS Lambda function using Backand’s Node.JS AWS Lambda server-side functions. You can even use most of the code we’ve already supplied, we simply need to modify the method we use to send HTTP requests to Salesforce to use a method compatible with Node.JS. Node implements HTTP communications using the ‘http’ module, which will need to be included. Once the module is ready, converting the code above is very straightforward. Take the HTTP request lines, provided below:

And replace these lines with the Node.JS equivalent:

You’ll need to provide a callback function that handles the response data. As the format of this function will depend heavily on your app’s data, we’ve left this blank in this post. You’ll also need to use the same pattern of sending a Node HTTP request when obtaining the accessToken from Salesforce – simply make the appropriate changes to the $http call that obtains the access token, and you are ready to go.

Conclusion

Salesforce, as the world leader in CRM solutions, is used by thousands of companies around the world. This integration guide covered integrating Backand with your Salesforce installation, allowing you access to all of your customer and user insights. By leveraging the instructions above, you can modify your Backand application to interface directly with your organization’s CRM information, giving you true flexibility to provide unique internal and external application experiences without losing any data fidelity.

Back to blog home page

Webinar: How to Build an AWS Test Harness

Posted by on Apr 04, 2017

AWS Lambda is a powerful tool for federating your application architecture and reducing operational costs for web apps with sporadic activity. However, while many of the interfaces to work with AWS Lambda functions are intuitive, the process of debugging the code as it runs necessarily has some holes. In recognition of this, we’re hosting a webinar, that goes through some of the tools we’ve used to greatly ease local development and deployment of AWS Lambda functions. We’ll cover the Lambda function prototype, the tools available for troubleshooting by default, a test harness we’ve built for local debugging, and finally deploying a Lambda function using our CLI.

Join the session on Wednesday, April 19th at 11 am PST

Overview of AWS Lambda

The webinar will give a brief overview of AWS Lambda for anyone not familiar. We’ll discuss the supported languages, the details that are shared on the execution environment, and we’ll look at how Lambda functions can be invoked. This will focus on Node.JS Lambda functions.

Troubleshooting AWS Lambda

In the webinar, we will also discuss how to troubleshoot and debug AWS Lambda functions. There are some built-in tools for debugging Lambdas, but they fall short of what a competent developer will typically need. We’ll discuss the mechanics of a Lambda function, and what kinds of tools are available for debugging out-of-the-box. We’ll also discuss the shortcomings of this approach.

Creating a Lambda Test Harness

Once we’ve addressed some of the challenges of implementing Lambda functions, we’ll discuss some potential solutions. During this session, we’ll work on creating a test harness that you can use to execute your code. We’ll cover mimicking the call structure of AWS Lambda invocation, and discuss some helpful techniques.

Deploying via the CLI

We’ll finally discuss Lambda deployment in the webinar, demonstrating one technique for deployment using the Backand CLI and Custom Node.JS actions. We’ll walk through what deployment entails, and how you can circumvent some of the trickier parts of the integration (like API Gateway and other triggers).

Conclusion

Our AWS Lambda Test Harness webinar will cover a lot of introductory material on Node.JS AWS Lambda functions. We’ll cover how these functions are built, how to structure your code, and how to debug it locally. We’ll also cover how you can easily deploy and call your Lambda functions from your application, using Backand’s Custom Node.JS Lambda Actions. Sign up so that you don’t miss this introduction to AWS Lambda functions!

Join the session on Wednesday, April 19th at 11 am PST

Back to blog home page

Protecting Your Apps Against the Next AWS Outage

Posted by on Mar 01, 2017

On February 28th, Amazon Web Services had several issues that led to global outages in the AWS stack. This started at around 9:40 AM Pacific time, and was resolved by 2:00 PM Pacific. During this outage, many popular websites faced availability and functionality issues, as more than 30% of the web relies upon AWS for some aspect of its functionality. While major AWS outages are rare, when they happen they can be devastating. As such, we wanted to explore why the AWS outage was such a problem for many websites, and look at mitigation strategies to prevent the next failure.

All Your Functionality Under One Roof

One of the benefits of using AWS to manage your web application is that it gives you access to all of the functionality you need to provide scalable and robust storage. Let’s take a look at a sample architecture for a Ruby on Rails web application, built on top of AWS:

  • Domain name resolution resolves to an AWS Elastic Load Balancer (ELB)
  • The AWS ELB directs the traffic to one of several Elastic IPs
  • The Elastic IPs point at an Amazon EC2 instance running a popular web server, like nginx or Apache, which runs the application server code
  • The application server interacts with a database in Amazon RDS or Amazon DynamoDB to store application data
  • The application can also interact with Amazon Elasticsearch Service to ease searching and record location
  • The application can also integrate with a third party logging or user action tracking provider (which has a high probability of also being deployed on AWS)

This combination of tools gives Developers and DevOps engineers a powerful set of functionality that they can use to build, maintain, and deploy their web applications. By having everything in one location, you can reduce the knowledge load on your R&D and DevOps teams, increasing overall velocity while relying upon the sterling reputation of AWS to provide you with a measure of security that you’ve made the right choices in your architecture.

The Problem

The problem with the above should be obvious. If your app is built entirely on AWS, any outage – no matter how minor – has the chance to affect your application’s user base. For example, if the ElasticSearch service goes down, your users may no longer be able to search for products in your catalog, losing you sales. Or if an EC2 instance behind a load balancer goes down, you can lose current session data, causing a user to have to restart a purchase process. While even minor outages can have an effect, the problem faced is the compounding that occurs when two or more AWS services go down at once. During the recent outage, Amazon itself was unable to effectively update its own status dashboard.

So at this point, we can easily demonstrate that while having everything under one roof can provide development speed and maintenance gains, it does expose your app to risks of cascading failures. Tuesday’s outage led to popular communications providers like Slack experiencing issues with uploading and sharing files, for example. When the web is this interconnected, it pays to have backup plans. Let’s look at two different mitigation strategies – one within AWS, and one leveraging multiple providers.

Mitigating Disaster Within AWS

Tuesday’s failure was primarily located in the US-East-1 region. This region is often used by Amazon to roll out and test new features, and posters on HackerNews have reported that this region has historically had issues around new software rollouts and old hardware. Many DevOps engineers will make use of a single region to ease maintenance and support of a website, and when you are front-line support at a startup this kind of region usage is often sufficient to get things moving so that your engineers can move onto more pressing business problems. However, if you host all of your services within the same AWS region, you are highly susceptible to that region’s stability issues, and when it goes down you lose access to your entire application. So the most obvious strategy is to not restrict your application to a single AWS region. Simply choose one of the other AWS Regions available to your account, and change your internal practices to recognize this difference.

Another strategy is to duplicate your stack across multiple AWS regions and use other regions as a fallback for when a region goes down. Configuring a load balancer to switch between EC2 instances hosted across separate AWS regions can often mitigate the failures that occur when a single AWS region is unavailable. This is even supported as a feature in Amazon ELB. By dispersing your risk among different AWS regions, you can reduce the overall impact of a single region’s failure.

Diversifying Your Risk

While spreading your components across multiple regions can provide you with a more reliable recovery scenario when things go wrong, they do ignore one major potential risk – if the entirety of AWS is unavailable, it doesn’t matter what region your app is located in. This is the risk with keeping all of your technical infrastructure under one vendor. While Amazon takes excellent, pro-active steps to ensure that their infrastructure is redundant and can failover gracefully, you’re still subject to issues that affect the AWS stack as a whole. To fully prevent this kind of outage, you’ll need to work on exposing alternatives at each point in the tech stack:

  • For load balancing, you’ll need to find another provider for load-balancing your app. This can be as straightforward as using another provider’s load balancer (such as Google Cloud Load Balancing), or as complex as building your own load balancer using proprietary tools.
  • For machine hosting, again you’ll want to look at alternatives to EC2 (or Amazon Lambda, for serverless applications). These can be other cloud service providers like Microsoft Azure (which can also serve as a replacement for container services like Heroku, since many run on AWS), or even machine hosting providers like Rackspace.
  • For data storage, you have a variety of options. Plenty of other cloud providers give you access to a scalable and reliable database accessible from everywhere, but you can also build your own DB server using a service like Rackspace to provide hosting for your DBMS.

The key is that for every element of your tech stack, there is an alternative to AWS that can serve your needs just as well. Ensuring full resilience and availability of your application requires spreading your risk across multiple providers, and handling the case when one (or many) of these providers fail.

Conclusion

If you’re running a web application, the availability of your app is paramount to your project’s success. Keeping everything under one roof with a provider like AWS gives you the ability to focus exclusively on one stack, letting your engineers be more efficient, but it also exposes you to risks of downtime across the relevant service. While high-availability options can be expensive, if your sole source of revenue is traffic to your website then you are ultimately faced with the following question: how much is not having downtime worth to me? If you’re willing to sacrifice time, effort, and money to ensure you have alternatives at every level of your app’s tech stack, then you can easily write a high-availability application that you can feel confident will survive most outages.

Back to blog home page

Making a Node.js Project into an NPM Package

Posted by on Jan 05, 2016

We recently published an NPM package, backand-hosting-s3, intended to sync a local project folder to Backand AWS S3 bucket. This bucket serves our users as a static web site for their AngularJS projects. The package is to be used in GulpJS files and in the forthcoming Backand CLI (more on this soon).
After completing development, while trying to publish the package, we encountered a few salient holes in the vast amount of guides and articles.

Below we provide some instructions on these points that will hopefully make your life easier when trying to publish an NPM package.

Continue reading

Back to blog home page

Integrating an AngularJS App on Backand with Amazon S3

Posted by on Oct 30, 2015

Expanding Available Functionality

Amazon Web Services, or AWS, offer a lot of useful functionality for web developers: from hosting, to distributed computing, to data storage, and much more. We at Backand leverage AWS in several ways and in this post we’ll look at Amazon S3, and how you can integrate the object storage service into a Backand-powered application.
Continue reading