Tuesday, June 28, 2016

Escaping Ruby Strings

The Rules

1. If possible, use single quotes (')

2. If you have a single line that needs interpolation, without inline double quotes, do the following:

"#{name} says, 'Hey!'"

3. If you have multiple lines use %[ <MUILTI_LINE_INTERPOLATION> ]


Note that %[ ] handles interpolation.

Example


name = 'Bob'

msg = %[#{name} says, "Hey!
What's up?"]

>> puts msg
Bob says: "Hey!
What's up?"


References

Don't escape in Strings





This work is licensed under the Creative Commons Attribution 3.0 Unported License.

Thursday, June 9, 2016

Today's Cloud Architecture

Automating deployments with Constant Integration (CI) and Constant Deployments (CD) have improved our Software Development Life Cycle (SDLC) dramatically.

Most corporations doing any software development have figured out that it is better to integrate changes early. It reduces risk and helps find issues earlier in the life cycle.

Here is a typical Cloud Architecture for software deployed to "The Cloud":
This was acceptable Cloud Architecture last year.

Features

  • Build Automation
  • Github workflow (pull requests & code review)
  • Constant Integration (to the "cloud")
  • Constant Deployment (via Bamboo)
  • Managed Releases (integrated with Jira tickets)

Q: What's wrong with that picture?


There are quite a few areas for process improvement requiring a different way to approach application development, testing, deployment and monitoring.

Answer: A lot

  • Heterogeneous Development Environment
  • Time Consuming Build Process
  • Time Consuming Deploy Process
  • Stateful Ansible/Chef/Puppet Packaging
  • Code Complexity
  • Extra Image Creation Time
  • Costly Server Startup Time
  • Manual or Roll-ur-own HA

There are a lot of inefficient, stateful, slow, not-easily-repeatable parts to the way many cloud deployments are done today.

Stateful Ansible/Chef/Puppet Packaging


Notice that output files of one software package are inputs to the other software packages, making our solutions complex and non-deterministic.

Questions For You to Ponder...

  1. How does your company manage it's Software Development Life Cycle (SLDC)?
  2. How long does it take from the time you get a feature request (or bug report) to a delivered solution?
  3. How well utilized are the CPUs of your computing resources?
  4. How resilient are your applications to failure?
  5. Can you handle rolling software deployments?
  6. How much complexity and technical debt is your company's IT infrastructure running on?

Disruptive Innovation

There are a lot of inefficient, stateful, slow, not-easily-repeatable parts to the way many cloud deployments are done today.

Arguably the most exciting area of improvement is the change to the way the developer's workstation is configured.

The same immutable server environment that has been hardened for production is leveraged for the developer (and used throughout all environments).

Declarative, portable, disposable and environment variables configured.

That's Disruptive Innovation.

References



This work is licensed under the Creative Commons Attribution 3.0 Unported License.