Wednesday, November 11, 2020

Heroku a primer

What it Heroku? 

Heroku is cloud platform (platform as a service - PaaS) that lets companies build, deliver, monitor and scale apps. It is a polyglot platform and thereby gives option to developers to write code in language of their choice (viz. node, python, java, etc. or even a custom buildpack). A typical journey from code to app goes like this - 
build system receives the code (which can be on any language) > buildpack is fetched (specific to coding language) > language runtime is fetched (specific to coding language)> address dependencies > a slug (buildpack + code) is produced which is injected into a dyno to run the app
Dyno is heart of Heroku which is virtualized Linux containers that are designed to execute code based on a user specific command so that app can scale based on its resource demand. It is ephemeral in nature. It does have option for private dyno (available with enterprise edition) which gets its own dedicated virtual network (private space). Dynos can be scaled both horizontally (additional dyno) as well as vertically (dyno size - 512 mb, 1024 mb). This scalability mode gives adequate redundancy and reliability/uptime needed for high frequency portal (e.g. Ecommerce portal) and private mode ensure that data transactions are secure. 

Similarity with Salesforce Ecosystem

Like Salesforce AppExchange marketplace, Heroku offer element market to get addons/buildpacks from where readily deployable code and feature can be fetched and run it in plug and play mode.

Features - Heroku Data Services

Heroku offers fully managed data services which are designed to work together e.g. - Postgres (Managed Relational DaaS), Redis (Managed Key-Value Store as a Service - To distribute the job order or queuing) and Kafka (Managed Kafka as a Service - To manage continuous train of messages. Producer and Consumer are handled via the broker where topic-based entries are split into partitions) which are natively supported.

One interesting feature which comes with Postgres is - follower and fork feature which enables up-to-date read-only copy and snapshot of master database respectively. Followers comes handy for scenario to reduce load on master DB while Forking enables validating/testing the schema migration. Heroku Postgres hobby instance can be useful for stub/simulation-based development where data can be hosted on Postgres and accessed in Salesforce development via ODATA or plain integration (leverage dataclips as an API)

Features - Heroku Enterprise

Heroku Enterprise gives and added level of security feature by giving option to private spaces (topping with shield as addon). Typically, common runtime allows to run and manage dynos in single multi-tenant network in isolated setup with an option to receive communication only from routing layer. But on other hand private space has its own network, routing layer and control plane that aren't shared with other application outside the space and thereby giving additional benefit on top of common runtime. Dyno in private space can communicate with each other directly over private network unlike common runtime.

Features - Continuous Delivery/Deployment (Heroku Flow)

It brings together Heroku pipelines, review apps, Heroku CI and GitHub integrations into an easy-to-use structured workflow for continuous delivery. This close loop setup gives a near-real-time view of application followed by GitHub commit thereby other coding patterns capability to Salesforce to see the changes immediately followed by changes in configuration.

Where Heroku can be used?

Simple answer could be for any custom application for any purpose – be it to extend CRM functionality or to create industry defining B2C UX, or to do data transformation and cleansing, or data analytics or high capacity storage or transportation. But typically, while extending CRM feature or salesforce capability a typical question can come on utility of communities over Heroku. Salesforce Community cloud also give rich user experience and UI but depending on complexity of the use case or primary focus area one option over other can be chosen (e.g. if the application is primarily focused on core functionality coving UI/API then communities is preferred approach but if there is heavy dependency on public content, usage, large data storage or processing then Heroku based application is more preferred approach.)

Where from now?

This was just a tip of the iceberg to get started with Heroku and its utility. To get started with Heroku, signup for a free Heroku account here - https://signup.heroku.com/. Like Salesforce development edition trial org, Heroku trial instance is also available free of cost.


Additional Resources : -
  • Refer to Heroku documentation @ https://devcenter.heroku.com/categories/reference 
  • Heroku Success stories can be found @ https://www.heroku.com/customers/case-studies
  • Partner resources are available @ https://partners.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A0000004nd8
  • 12 Factor App (Design consideration in containerized world) - https://prezi.com/8uldpq91vm4e/the-twelve-factor-app/