The Wayback Machine - https://web.archive.org/web/20150401031059/http://cloudcomputing.sys-con.com:80/node/3317499

Click here to close now.

Welcome!

Cloud Expo Authors: Ian Khan, Liz McMillan, Ed Featherston, John Wetherill, Mike Kavis

Related Topics: AJAX & REA, MICROSERVICES, Cloud Expo, DevOps Journal

AJAX & REA: Blog Post

Declarative vs. Imperative Models By @ScriptRock | @DevOpsSummit [#DevOps]

DevOps has converged on several prominent themes including continuous software delivery, automation, & configuration management

Declarative vs. Imperative Models for Configuration Management: Which Is Really Better?

As a group of concepts, DevOps has converged on several prominent themes including continuous software delivery, automation, and configuration management (CM). These integral pieces often form the pillars of an organization’s DevOps efforts, even as other bigger pieces like overarching best practices and guidelines are still being tried and tested. Being that DevOps is a relatively new paradigm - movement - methodology - [insert your own label here], standards around it have yet to be codified and set in stone. Organizations are left to identify tools and approaches most suitable for their use cases, and will either swear by or disparage them depending on their level of success.

In terms of CM, it's a given that one particular methodology may work for a company but not for another. However, seldom do differing approaches generate as much dissent as the declarative and imperative models for CM. The recurring debate over which is superior has garnered staunch supporters on both sides and warrants a closer inspection.

Defining Declarative and Imperative Models
Differences between the declarative and imperative models can be summed up in one sentence: imperative focuses on how and declarative focuses on what. In a software engineering context, declarative programming means writing code to describe what the program should do as opposed to how it should do it. One describes what needs to happen; the minutiae for making it so are left to the system. In contrast, imperative programming involves writing code that follows explicit steps to solving a problem, completing a task, or achieving a desired result. It's telling the system specifically how to do something with the expectation that the desired outcome will result.

An example of imperative vs. declarative code. Image courtesy of Puppet Labs.

Imperative/declarative constructs also carry over to IT domains such as CM. In fact, a particular CM tool's approach is greatly influenced by the underlying language upon which it was built (which is in turn either imperative or declarative by nature).

The following is a list of prominent offerings and their respective approaches to CM:

Declarative Imperative
X
X
X
X X
X X

Puppet, for instance, is declarative: the sysadmin describes a desired end state and the tool attempts to reach it. Its domain-specific-language (DSL) is used for creating high-level descriptions of desired server state, as opposed to instructions and actions to be carried out. Manifests-- Puppet files that contain configuration information-- can be used any number of times to achieve the same results. If the desired end state has already been reached, Puppet simply ignores the item in question. Users need only worry about the desired end state of the system to be configured, not the sequence of steps required to get there.

Here's an example of a Puppet Manifest resource declaration:

This entry describes an end state containing a file called /tmp/test123 with the contents "This is a test". If a matching file (and contents) is found on the target system, Puppet assumes the desired end state has already been reached. Subsequently, one doesn't need to worry about the Manifest executing this piece numerous times.

In contrast, Chef (Puppet's arch-nemesis) is imperative. Users define commands and their execution order in configuration instructions called Recipes, which can in turn be organized into Cookbooks for easier management.

Take a look at the following Chef Recipe:

This Recipe checks for JDK 7 on the target node-- if it exists, Chef will install OpenJDK 7. If not, a warning is raised. Note that Chef Recipes are structured as sequential lists of commands, as opposed to Puppet Manifests, which only contain descriptions of desired end states.

A growing trend among CM vendors is to make their offerings open to either model, thereby winning the hearts of both camps. Even tools like Chef that are primarily imperative in nature can be set up in a declarative manner:

In contrast to the previous example, the above Recipe describes a desired end state as opposed to listing a series of commands to be executed.

Sizing Up The Big Boys: How Does Puppet Compare to Chef?

So which model is better for CM? To address this question one needs to qualify for who and what. Also-- given the current buzz level and adoption rate of DevOps, it's no surprise that pundits are progressing in sophistication: conversations around DevOps have evolved from what it is to how to do it. And how to do it depends on who you're asking.

Let's therefore analyze the debate from three perspectives: that of a programmer, sysadmin, and full stack developer.


Passionate about writing efficient, structured, and easy-to-understand code, the programmer isn't the biggest fan of declarative models that employ unwieldy abstractions. He's accustomed to dictating how things should happen with for loops, conditional statements, variables, and the like. The business logic of the software he works on is mostly imperative in nature.

Best Fit: Imperative CM tools like Chef


The sysadmin likes to run a tight shop, and for good reason: if infrastructure goes down, the company screeches to a halt. He's a Bash wizard, proficient in Python and Perl, and prefers using them over learning new languages like Ruby. He prefers the declarative over the imperative model, but is cognizant of the challenges the former has in managing dynamic cloud infrastructures.

Best Fit: Hybrid CM tools like Ansible, or SaltStack


The full stack developer can traverse the stack with ease and loves the idea of abstracting infrastructure to code. A Ruby/RoR ninja, she's a fan of both Chef and Puppet. She can appreciate the merits of each model; to her, either type of tool makes her job of continuously building and releasing quality software faster, more efficient, and less error-prone.

Best Fit: Either model. Puppet, Chef, and SaltStack are viable options.


Note that our programmer could just as likely be a Python pro and thus highly proficient with Ansible (whose modules are written in Python). Whatever the case, matching an organization's IT skills makeup to the appropriate model/tool is a pragmatic approach for determining which is more suitable. If a firm is into traditional software development with programmers at the helm, an imperative tool might be the best fit. A fast-moving SaaS on a schedule of continuous rollouts will appreciate the flexibility and scalability of a well-implemented declarative CM solution. A shop that swears on Ruby and has the expertise to boot may choose to "cook" with certain tools, overriding the model debate entirely.

A key point to remember is that both declarative and imperative models are fallible: the former requires trusting that desired states have been reached (with little means of verification), while the latter requires complicated troubleshooting when things go awry. Both models can be problematic in certain edge scenarios; subsequently, no individual tool should be implemented as the be-all and end-all for CM, regardless of which approach has been adopted. The chosen solution should instead comprise only part of the CM toolchain, with another rounding it out as an overwatch, making sure all CM and automation tools are performing as expected.

GuardRail serves this purpose: by providing total systems visibility through robust scanning, monitoring, and comparison capabilities, our platform bridges the crucial gap between expecting your systems/environment to be a certain way and actually verifying that it meets those expectations.

Try GuardRail for Free

In short, competing vendors vying for mind and market share will passionately champion their offering's respective approach. Though debates around declarative/imperative models take on new levels of intensity and fervor in commercial CM arena, the truth is that many tools possess qualities from both-- albeit they may be based more heavily in one mode. Therefore it's perhaps more useful to think of the declarative and imperative models as a spectrum of possibilities with respective solutions falling closer to either end.

Source(s):

http://searchdatacenter.techtarget.com/news/2240187079/Declarative-vs-imperative-The-DevOps-automation-debate

http://sharknet.us/2014/02/15/automated-configuration-management-language-choice/

http://devops.com/features/approaches-to-application-release-automation/

http://networkenhancers.blogspot.com/2014/10/what-is-difference-between-declarative.html

http://cloudn1n3.blogspot.com/2014/11/from-devops-to-puppet-part-2.html

http://www.laurencegellert.com/2012/08/what-is-a-full-stack-developer/

https://ifireball.wordpress.com/2015/01/03/comparison-of-puppet-and-ansible/

http://docs.saltstack.com/en/latest/ref/states/ordering.html

Read the original blog entry...

More Stories By ScriptRock Blog

ScriptRock makes GuardRail, a DevOps-ready platform for configuration monitoring.

Realizing we were spending way too much time digging up, cataloguing, and tracking machine configurations, we began writing our own scripts and tools to handle what is normally an enormous chore. Then we took the concept a step further, giving it a beautiful interface and making it simple enough for our bosses to understand. We named it GuardRail after its function — to allow businesses to move fast and stay safe.

GuardRail scans and tracks much more than just servers in a datacenter. It works with network hardware, Cloud service providers, CloudFlare, Android devices, infrastructure, and more.

@CloudExpo Stories
SYS-CON Events announced today that robomq.io will exhibit at SYS-CON's @ThingsExpo, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. robomq.io is an interoperable and composable platform that connects any device to any application. It helps systems integrators and the solution providers build new and innovative products and service for industries requiring monitoring or intelligence from devices and sensors.
Today, IT is not just a cost center. IT is an enabler and driver of business. With the emergence of the hybrid cloud paradigm, IT now has increasingly more capabilities to create new strategic opportunities for a business. Hybrid cloud allows an organization to utilize multi-tenant public clouds, dedicated private clouds, bare metal hosting, and the associated support and services for the right use cases through an on-demand, XaaS model. This model of IT creates tremendous opportunities for busi...
Business as usual for IT is evolving into a “Make or Buy” decision on a service-by-service conversation with input from the LOBs. How does your organization move forward with cloud? In his general session at 16th Cloud Expo, Paul Maravei, Regional Sales Manager, Hybrid Cloud and Managed Services at Cisco, discusses how Cisco and its partners offer a market-leading portfolio and ecosystem of cloud infrastructure and application services that allow you to uniquely and securely combine cloud busi...
Internet of Things (IoT) will be a hybrid ecosystem of diverse devices and sensors collaborating with operational and enterprise systems to create the next big application. In their session at @ThingsExpo, Bramh Gupta, founder and CEO of robomq.io, and Fred Yatzeck, principal architect leading product development at robomq.io, will discuss how choosing the right middleware and integration strategy from the get-go will enable IoT solution developers to adapt and grow with the industry, while at...
Businesses are looking to empower employees and departments to do more, go faster, and streamline their processes. For all workers – but mobile workers especially – utilizing the cloud to reconnect documents and improve processes without destructing existing workflows can have a dramatic impact on productivity. In his session at 16th Cloud Expo, Mark Grilli, vice president of Acrobat Solutions marketing at Adobe Systems Incorporated, will outline new ways that the cloud is changing the way peo...
One of the hottest areas in cloud right now is DRaaS and related offerings. In his session at 16th Cloud Expo, Dale Levesque, Disaster Recovery Product Manager with Windstream's Cloud and Data Center Marketing team, will discuss the benefits of the cloud model, which far outweigh the traditional approach, and how enterprises need to ensure that their needs are properly being met.
With the arrival of the Big Data revolution, a data professional is expected to master a broad spectrum of complex domains including data processing, mathematics, programming languages, machine learning techniques, and business knowledge. While this mastery is undoubtedly important, this narrow focus on tool usage has divorced many from the imagination required to solve real-world problems. As the demand for analysis increases, the data science community must transform from tool experts to "data...
SYS-CON Events announced today that Solgenia will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY, and the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Solgenia is the global market leader in Cloud Collaboration and Cloud Infrastructure software solutions. Designed to “Bridge the Gap” between Personal and Professional S...
WSM International has launched a DevOps services division that offers assessment, consulting and implementation to large enterprises and organizations with complex infrastructures. The concept of DevOps is to blend information technology (IT) software development with operations to optimize the computing infrastructure according to the specific needs of the organization. According to a recent press release from Gartner, "By 2016, DevOps will evolve from a niche strategy employed by large cloud ...
SYS-CON Events announced today that QTS Realty Trust, one of the nation’s largest and fastest-growing providers of data center facilities and cloud services and a leader in security and compliance, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. QTS Realty Trust, Inc. (NYSE: QTS) is a leading national provider of data center solutions and fully managed services, and a leader in security and compliance...
SYS-CON Events announced today that WSM International (WSM), the world’s leading cloud and server migration services provider, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. WSM is a solutions integrator with a core focus on cloud and server migration, transformation and DevOps services.
SYS-CON Events announced today that MangoApps will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY., and the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. MangoApps provides private all-in-one social intranets allowing workers to securely collaborate from anywhere in the world and from any device. Social, mobile, and eas...
Sematext is a globally distributed organization that builds innovative Cloud and On Premises solutions for performance monitoring, alerting and anomaly detection (SPM), log management and analytics (Logsene), and search analytics (SSA). We also provide Search and Big Data consulting services and offer 24/7 production support for Solr and Elasticsearch.
SYS-CON Events announced today that Emcien will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Emcien’s vision is to let anyone use data to know the future. Emcien has built an automated, predictive analysis product that improves the lives of real people. Emcien allows people to automate their data analysis so they can build a better future.
The speed of software changes in growing and large scale rapid-paced DevOps environments presents a challenge for continuous testing. Many organizations struggle to get this right. Practices that work for small scale continuous testing may not be sufficient as the requirements grow. In his session at DevOps Summit, Marc Hornbeek, Sr. Solutions Architect of DevOps continuous test solutions at Spirent Communications, will explain the best practices of continuous testing at high scale, which is r...
SYS-CON Events announced today that Litmus Automation will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Litmus Automation’s vision is to provide a solution for companies that are in a rush to embrace the disruptive Internet of Things technology and leverage it for real business challenges. Litmus Automation simplifies the complexity of connected devices applications with Loop, a secure and scalable clou...
The world's leading Cloud event, Cloud Expo has launched Microservices Journal on the SYS-CON.com portal, featuring over 19,000 original articles, news stories, features, and blog entries. DevOps Journal is focused on this critical enterprise IT topic in the world of cloud computing. Microservices Journal offers top articles, news stories, and blog posts from the world's well-known experts and guarantees better exposure for its authors than any other publication. Follow new article posts on T...
Hosted PaaS providers have given independent developers and startups huge advantages in efficiency and reduced time-to-market over their more process-bound counterparts in enterprises. Software frameworks are now available that allow enterprise IT departments to provide these same advantages for developers in their own organization. In his workshop session at DevOps Summit, Troy Topnik, ActiveState’s Technical Product Manager, will show how on-prem or cloud-hosted Private PaaS can enable organ...
SYS-CON Events announced today the IoT Bootcamp – Jumpstart Your IoT Strategy, being held June 9–10, 2015, in conjunction with 16th Cloud Expo and Internet of @ThingsExpo at the Javits Center in New York City. This is your chance to jumpstart your IoT strategy. Combined with real-world scenarios and use cases, the IoT Bootcamp is not just based on presentations but includes hands-on demos and walkthroughs. We will introduce you to a variety of Do-It-Yourself IoT platforms including Arduino, Ras...
Even though it’s now Microservices Journal, long-time fans of SOA World Magazine can take comfort in the fact that the URL – soa.sys-con.com – remains unchanged. And that’s no mistake, as microservices are really nothing more than a new and improved take on the Service-Oriented Architecture (SOA) best practices we struggled to hammer out over the last decade. Skeptics, however, might say that this change is nothing more than an exercise in buzzword-hopping. SOA is passé, and now that people are ...