Quick Look at Heroku & MuleSoft

Quick Look at Heroku & MuleSoft

2023, Oct 31    

Here I wanted to share my point of view on two cloud platforms that are often confused for their API capabilities, MuleSoft and Heroku. For starters, let’s set the context on these platforms. MuleSoft is a best-in-class Integration Platform as a Service (iPaaS) that offers a flexible way to build and manage APIs and Integrations, connecting systems. Heroku is a Polyglot Cloud Platform for building modern applications in the cloud. The confusion comes from the fact that developers can build and run API on both platforms.

The number of customers I worked with are confused on the difference between an application or a Web API and Integrations. Often I hear customers say “I can build API on Heroku for my integrations”. While this is true developers often build web or mobile applications and User Experience APIs for these apps hosted on Heroku. However, Heroku is NOT an Integration platform. Let’s dive into this a bit deeper.

Platform:

Heroku

Heroku is great at deploying and running web apps in the cloud on a massive scale. Especially modern apps that follow the 12-factor app methodology. Important distinction here we are talking about apps that are developed in traditional code. Here is the list of awesome things Heroku provides for developers and businesses. In this article I discuss the Heroku platform in general. The reader should be clear there are two types of licenses on this platform, Standard and Heroku Enterprise. **Some of the Enterprise features around organizations and security compliance apply to Enterprise only

  1. Simple scalability via dyno app containers
  2. Support for most programming languages
  3. Pipelines for managing Changes promotion DEV QA PROD
  4. Review apps to test ideas and validate with stakeholders
  5. Built-in support for CI/CD with GitHub
  6. Easy DevOps and monitoring
  7. Full-featured CLI for scripting automation of CICD process
  8. Support for Enterprise Security & Industry Compliance
  9. Marketplace with add-on components for extending the platform

What do all these features mean for Developers? To me, this means as a developer I can use skills I have in a language I like and use my favorite development tools to build apps and deploy them in the cloud. The barrier to learning Heroku is relatively low since no need to learn new languages, development tools or extensive infrastructure skills. My developer workflow remains mostly the same.

Heroku works with the concept of build-packs for each programming language + framework that enables, builds, and deploys apps on Heroku using any supported programming language. Currently Heroku supports officially eight language buildpacks:

More build-packs are available from open source and community for other languages such as Server-side Swift and others.

MuleSoft & Anypoint

MuleSoft is a bit of a mix of low-code + code + infrastructure. What I mean by this is MuleSoft Anypoint platform consists of many tools, some are no-code to low-code and some require code and infrastructure configurations. At its core though MuleSoft is Java. The MuleSoft being an Integration platform, as such Integration developers inevitably will be involved in some networking/infrastructure decisions.

Typical API Design is done in RAML - kind of code or metadata configuration. But API design can be done in visual UI tool or directly as traditional code in editor. Therefore it can be considered low-code.

API Implementation is where developer will spend some part of the project time is low-code visual environment such as Anypoint Studio IDE (Eclipse tool) or new Anypoint CodeBuilder (VSCode tool). Most of development can be done in this visual environment configuring connector properties and wiring flow-steps. The result source will be a Mule XML a sort of metadata file/s. In most cases there is no need to change XML directly. However, there are times when it is required, such as refactoring large flows into smaller compact modules. Some time code will be required. For example, complex transformations need to use Dataweave, a function programming language. There are also situations that need external Java code included as module into the MuleSoft flow. All this is specialized coding skills with variety of tools.

API Management is mostly no-code configurations and working with defining an API proxy or existing policies. Applying API policy or creating a custom policy.

Infrastructure challenge

Integration by default connect two or more systems over some network. And this will require networking and some infrastructure skills at some level of depth. Such things like understanding Virtual Private Cloud (VPC), Transit Gateways (TGW), VPN, Dedicated Load Balancers, TSL termination, network routing, various security protocols, certificates, IP ranges and CIDR blocks etc. All these are configured from Anypoint Control Plane UI in the browser, but one does need to understand how these work under the hood. Not to mention deciding the resource sizing for the apps like CPU and Memory. These skills are typically built as a specialized career working in data centers or large Cloud provider companies. In an enterprise developer teams are normally separate from Network/Infrastructure & Security teams that manage data center servers and networks. There fore finding a developer who also have such skills at depth is a major challenge.

DevOps & Deployment

Heroku

Heroku environment can be connected directly to the GitHub repository to enable automated builds, providing CI/CD out of the box. No need to learn any other DevOps tools. Heroku can be used with external DevOps tools such as Green CI, Jenkins, or others. Heroku Pipelines can set up multiple environments for DEV, STAGE, and PROD, to follow your development process and compliance. The promotion of the application from Dev to Stage or Prod is a single button click or can be automated by CI/CD based on your source-control commits.

MuleSoft

MuleSoft API or apps as we call it are built into a jar file and then deploy into target runtime environment, (CloudHub, RTF, On-Prem). Mule runtimes can reside almost anywhere, (even can run inside Heroku) so is the deployment target. The app is build and deployment is managed by traditional maven tool where Java dependencies are managed by hierarchy of pom & bom files. That is familiar to Java Spring developers, incidentally Mule Runtime is built in Java Spring so it keeps same build tooling. This makes MuleSoft very easy to adopt into traditional DevOps CICD pipelines. In addition to maven there is also Anypoint CLI and Platform API that even has a Postman collection. All these tools are useful in DevOps.

Runtime Environment

Heroku

Heroku app development fits well with the 12-factor app methodology to build modern cloud apps for scale. The base of the platform is Heroku Dyno which hosts app containers with allocated resources, CPU memory, etc. While the Heroku platform itself runs on AWS users/developers do not have any direct access to AWS resources, all admin functions are done via Heroku admin UI or CLI. An important fact is Heroku file storage is ephemeral, which means at run time there is available access to storage, but files stored are temporary and this storage can be deleted at any time after the app finished processing or scaled/reallocated to another dyno. Therefore Heroku & 12-factor app emphasizes stateless app design and any state information must be stored in Backing Services such as databases or external storage services.

MuleSoft

MuleSoft is center around Mule Runtime is a small Java environment that can deploy almost anywhere Java can run. As mentioned earlier several deployment options are available from cloud to Kubernetes or hard-metal-servers. Mule apps developed for one type of deployment normally can deploy and run on any Mule runtime, that is an advantage, build once run anywhere. There are of course some limitations on specialized features that may exists as reliable on the server but may not be reliable in the cloud, such as local disk storage or use of Object Store functionality where to persist temp data (in-memory or on disk) and will the disk-store survive restart or app redeployment. These are all interesting architecture and development considerations.

Using right tool for the job

Till now we discussed what Heroku can do for the developer and do it well. Now I will discuss things Heroku cannot do for you or it is simply not a good fit. One such case is Enterprise integrations and API Management or governance. Heroku is NOT an integration platform and does not provide any features to design and manage your APIs. Another area is doing complex data transformations or providing API Proxy or security.

These are things that iPaaS like MuleSoft and API Gateways are built for. Managing and designing your APIs, API security and governance around API access is difficult to build.

Another interesting factor is Cloud vs. On-Premise, which may sound strange to discuss actual hardware here. Integrations still largely exist to connect legacy data and SaaS-hosted data, as such the problem is where to put your Integrations. Heroku only offers 1 option is on the Cloud. MuleSoft being a flexible Integration platform offers multiple runtime options: CloudHub, Runtime Fabric (RTF), or bare metal on-prem (necked-mule) and service mesh. This flexibility allows the enterprise to deploy API where it is needed without making major changes to the networks & security.

While CloudHub 1.0 & 2.0 are MuleSoft’s cloud options that run on AWS, and the underlying infrastructure is similar to Heroku. Other options allow deployments anywhere.

The Anypoint Runtime Fabric (RTF) is a Kubernetes container based deployment option available on hosted K8S services (EKS, AKS, GKS, OpenShift).

The Customer Hosted may be installed inside the data center or on AWS/Azure.

Note from September 2023 RTF support has been extended to number of other services target for China deployments like Alicloud, Rancher and AWS Anywhere.

Connectors

MuleSoft

MuleSoft is likely well known as Integration platform because of its large library of connectors. Connector is what enables Mule app quickly link systems and implement complex integration patterns. At its core connector is prepackaged 3rd party system connectivity with set of available operations that we can do from Mule app to effect external system. Typically this is done via API provided by the external system, that connector simply provides interface on top of API.

MuleSoft connectors typically published on public Exchange for reuse. Connectors vary in capability and support are divided into categories:

  • Premium - developed and supported by MuleSoft team
  • Select - some are built by MuleSoft and other partners
  • MuleSoft Certified - primarily built by partners or Open Source community

For systems that do not have a connector yet, a custom connector can be built using Mule SDK.

Heroku

Heroku provides a Elements Marketplace with many add-on apps. These are more similar to Salesforce AppExchange than connector ecosystem. Heroku Add-On is more of app adding full functionality or installing a system into Heroku Dyno. Such example is Heroku Postgres or Heroku Kafka and Papertrail add-ons. Not exactly a connector but does provide functionality and links to 3rd party services.

API Design

MuleSoft

MuleSoft offers a robust API design system & tooling. The API Design Center, RAML or OpenAPI Specification (OAS) 2.0 & 3.0, and Anypoint Exchange work together to deliver simple developer experience.

These tools allow the quick build of API interfaces using RAML and Mocking service to publish on Exchange for feedback and testing. This enables multiple teams to work in parallel delivering more value.

One of many examples of this approach may look like this: Mobile team needs to build a native app that needs some data for the mobile Experience API layer. This API can be made fast and delivered for validation by both teams and iterate on the design of this interface. At the same time, processing/system APIs can start to implement the interface while Mobile experience can use Mock service to start building the app and iterate with their stakeholders.

This process provides a rapid delivery of quality software because of the quick feedback loop with stakeholders at all levels. This ability to validate the Mobile experience in a real app before everything is built on the back end enables true agile development methodology to come to life.

This aspect of API design is possible to achieve on Heroku but requires additional framework/s or external tools. One such example can be Swagger & OAS. External tools may be Apiary etc. While such tools do exist it is all DIY developer effort, not forget the development team must be skilled in all these extra tools & frameworks that take a significant time/effort to learn and adopt into enterprise-grade development methodology. MuleSoft delivers all these built into the platform with documented playbooks to execute.

Heroku

To do similar API designs for Heroku requires use of external tools and frameworks. One such example can be use of Swagger or other external API Tools including MuleSoft API Designer.

API Management & Governance

MuleSoft

Once we build an API it is time to run and manage this new app. Open REST API is easy to create anywhere, but to grant controlled access requires well-designed secure infrastructure. Because enterprises are required to protect access to data and systems for industry compliance, IP, PII, or other reasons.

This is where MuleSoft shines as best in class with API manager, Exchange, Anypoint API Community Manager (ACM),API Experience Hub, and underlying policies. We can complete most of our None Functional security requirements (NFR) by simply applying existing policies, granting access to apps or people we need to, and protecting our assets from intruders. Developers can apply custom policies as well as standard ones, employ OAuth or SAML authentication, add rate limits to cover overload on back-end systems, etc. And all this without writing any code or changing application logic.

These rich and simple features are difficult to get on other platforms and require additional tools and separate software packages that often do not work well together.

Heroku

Heroku does not offer any API management features inside the platform. To add API Manager or Governance will require use of external API Management platforms. MuleSoft API Manager offers automated API proxy service that can be used in tandem with Heroku hosted API code.

Conclusion

Hopefully this article provided comprehensive overview on both platforms and clarified existing biases & confusions. Both platforms have rich set of features and are great at doing what they were designed for. In many situations these two platform can be used together to complement each other. Putting preferences and biases aside use the right tool for the jobs to be done.