Organizations are looking to take greater control over their Salesforce development processes. They see DevOps as a better way to build and ship applications, not just outside Salesforce, but within Salesforce as well. A key component of Salesforce DevOps is metadata. There are many capable tools to create and manage metadata that are becoming popular in the wider DevOps world. They have a bearing on Salesforce development. However, the Salesforce platform has unique features that need to be kept in mind when it comes to metadata for Salesforce development. That’s what we discuss in this article — the various tools and methods to use metadata to improve DevOps practices, especially in the context of Salesforce. (For more on Salesforce DevOps teams, specifically why they need version control, check out our TechGenix article here.)
What is metadata?
Metadata is the data that describes other data.
— Shyam Oza, director of product management at Kaseya, writing at SalesforceBen
Data is the core object in Salesforce such as Account name, Lead source, and Contact name. Metadata exists one layer above this core data. For example, the Account settings metadata would include the account name, among other data.
Metadata is used to describe more than objects and fields and more complex elements such as the logic, code, and page layouts. If objects are the bricks used to build Salesforce applications, metadata is the concrete that holds these bricks together. With such a pivotal and fundamental role, organizations need to give careful thought to how they manage metadata within Salesforce.
Why metadata matters?
Application customization
Salesforce applications are becoming more customized by the day. Organizations are no longer content with off-the-shelf solutions and are looking to create unique applications that meet their business needs. The key to achieving this level of application customization with Salesforce is to leverage metadata. Metadata makes building custom applications quicker and more repeatable.
Process automation
Metadata is essential for automating and getting the most out of Salesforce. Metadata enables custom application logic to implement workflow automations that quicken processes, save time, and reduce the chance of human error creeping into processes.
Declarative development
Salesforce development is now more declarative. Organizations now want to focus more on code creation and less on the compiling, packaging, and deploying code. Metadata makes this possible. It simplifies the processes that follow code creation and systematizes it.
Is metadata used outside of Salesforce?
It’s easy to think of metadata as another quirk of the Salesforce ecosystem that isn’t applicable to the broader world of DevOps. However, this is not true. The broader DevOps and cloud-native computing movement also see metadata as a key enabler for its processes. Let’s look at some examples of metadata in use in the broader world of DevOps outside of Salesforce.
Grafeas
Grafeas is an open-source metadata management tool that helps deploy code at scale. Grafeas manages metadata about environments, containers, and software artifacts. Created by Google, it is an open-source project that is gaining adoption by many. The e-commerce platform Shopify talks about how it uses metadata: “Here at Shopify, we use Grafeas as the central place to store all the metadata about our deploys, helping us build 6,000 containers a day, and making our lives easier.” In short, Grafeas helps organizations like Shopify manage and deploy containers at scale.
Kubernetes and Helm
Kubernetes has a metadata feature called Labels that describes applications “in a way that can be queried.” Labels are used to group and identify objects in Kubernetes. Annotations are another form of metadata in Kubernetes. They can be structured or unstructured and can leverage Labels. Tools like Helm Charts take advantage of Labels and Annotations to deliver declarative environments that are repeatable and automated. Kubernetes being the leading cloud-native platform for orchestration, it is significant that this capability is built into Kubernetes.
The Update Framework (TUF) and Notary
The Update Framework (TUF) is a CNCF (Cloud-Native Computing Foundation) graduated project that “enhances security by adding verifiable records about the state of a repository or application.” These records are forms of metadata such as encryption keys, hashed files, and version numbers.
TUF is a specification and not a tool. The principles of TUF are implemented by a tool called Notary. Created by Docker, the key feature of Notary is its ability to gauge the freshness of any update to the system. It uses metadata in the form of timestamps, and every update has this timestamp that is short-lived. Once a timestamp is outdated, Notary prevents the update from being deployed into the system. This ensures only fresh, validated updates make it to production — resulting in more secure system updates every time.
These various developments make it clear that metadata is central to the approach of DevOps and cloud-native computing. This has a ripple effect on applications built within the Salesforce ecosystem.
How metadata enables Salesforce DevOps
Purpose-built for Salesforce
The tools mentioned above are powerful, but they can’t be used as-is when building a Salesforce application. In fact, some of them aren’t even compatible with a Salesforce environment and are built with Kubernetes as the underlying platform in mind. Salesforce development teams need a metadata management solution that is Salesforce-aware. Something that can be adapted from the larger DevOps world, or if that’s not possible, use the same principles and apply them to Salesforce applications. This is possible using the many Salesforce DevOps solutions that are available today. One example of this is AutoRABIT. These Salesforce DevOps tools include metadata as a central way to manage repositories and deployments within Salesforce. Let’s dig deeper into how they work and what they do.
Enable CI/CD
Metadata is crucial for CI/CD processes. It enables development teams to pull code from a repository and work on it asynchronously. When developers commit new changes, the CI/CD tool can use metadata to compare versions and look for conflicts and issues with the code. This shortens the feedback loop for new code, improves quality, and enables code to be written in small chunks and in a continuous manner.
Declarative environments and deployments
Metadata allows for selective or full deployments. Rather than deploying an entire application or service every time a change is made, a Salesforce CI/CD tool can use metadata to check for new changes and deploy only those changes incrementally, thereby quickening and simplifying deployment and putting emphasis on code creation rather than environment management. This takes a keen awareness of the state of the system and being able to differentiate between what’s existing and what’s new.
Automated backup and restore
While Salesforce data should be backed up, so should its metadata. This helps preserve the Salesforce experience by remembering the parent-child relationships between different Salesforce data points. These backups should be automated and should be easy to restore quickly. More so, with the recent discontinuation of Salesforce’s data recovery solution, automated backups of metadata is essential. Along with backup, Salesforce metadata needs long-term archival storage for compliance purposes.
As Salesforce teams become increasingly DevOps-centric, metadata and metadata management solutions are the backbones enabling this shift. Tools like AutoRABIT are ushering in a fundamentally new way of developing Salesforce applications. Leverage metadata and modern DevOps methodologies to transform the way your organizations build and ship Salesforce applications. This is the way the broader world of DevOps and cloud-native computing is headed, and it has a bearing on the world of Salesforce as well.
Featured image: Pixabay