So much focus is lost on asking – What are the blockers? – that the organisation forgets to enable its people to do the work.
Failing to enable those that do the work is the biggest blocker in an organisation.
So much focus is lost on asking – What are the blockers? – that the organisation forgets to enable its people to do the work.
Failing to enable those that do the work is the biggest blocker in an organisation.
If your business involves technology and you find yourself thinking along any of the following…
…then it is a sign that you should think about having a your business might need a CTO.
Whatever can go wrong, will go wrong
Murphy
Let’s see what can go wrong with each of the four points.
Good technical people in your network that you can rely on is the best thing to have for your business. Otherwise, finding technical talent can be exciting if “looking for co-founder speed-dating” is your thing.
Your next best option is to get guidance from a technical lead who has been there, done that; and will
Getting somebody external to build your tech – outsourcing – is a frequently favoured approach. It promises to deliver a bespoke solution, tailored to your needs, often advertised at a low cost. If you have not worked with outsourcing companies before, or if you have not managed product development with a partner before, this could be a bumpy and costly ride.
Delivering a successful project with external partners requires a great deal of preparation and dedication during the execution from your side, including
Finding a suitable and affordable off the shelf product, commercial or free open source, is a great way to get started. If you have the luxury of choice, then a thorough, objective analysis of options should reveal the most fitting one.
A single package rarely meets all needs. A new set of challenges will rise from customising it, or from integrating it with additional solutions.
Circumstances could lead to considering building your own tech. It is a decision not to be taken lightly.
Mitigate the risks by getting help for
Kicking the tech decision tin can down the proverbial road tends to build up technology debt. It risks future development, innovation and growth by increasing cost, timeline and limiting scope.
Think about tech strategically, make it part of your roadmap to address technology debt.
Addressing tech at the growth stage will throw up more of the same issues described earlier with the added twist of dealing with legacy.
Avoid being limited by tech at this stage by
Making technology work to create value for your business is often not a trivial task. The runaway costs, scope creeps, schedule overruns together with unnecessary complications and complexity can be overwhelming.
If still not convinced, or cannot commit to getting a CTO on board, perhaps consider working with an interim or part-time CTO.
Early stage technology decisions will have a profound impact on your business for a long time.
The common metaphor for multi-tenant systems is the block of flats where tenants share the building and its services (water, gar, electricity, security, etc) but each tenant may organise and furnish their flat differently.
The part – that is often left out – is where the landlord limits each tenant how much change they can make to the flats, how many guests they can invite, how much of the services they can use. These limits what make multi-tenant buildings viable by protecting the infrastructure for everyone’s benefit.
SaaS and PaaS and IaaS are good examples of shared environments where the multi-tenancy metaphor works well.
The service providers – landlords – manage these environments closely, and enforce the limits strongly. This way everybody benefits the same way and providers can maintain their service levels (SLAs).
This metaphor struggles when transitioning to the next level of abstraction – sharing resources within one tenancy.
Multiple projects, new features, updates, fixes from multiple sources draining resources within the same tenancy.
The river metaphor for a shared environment is more suitable1
Each project and feature is an industrial installation – a factory plant, a power station, or any other build directly connected to the water ways.
Well behaving projects will keep the environment clean and liveable for everybody.
Projects with weak or no governance will pollute the waterways and ruin it for themselves and everybody else. Those downstream will have to work extra hard to clean up and maintain it for the rest.
Why does the river metaphor work better?
Because the societal and policy issues better resonate with the equivalent governance issues. It emphasises the negative effects of badly managed changes as opposed to showcasing the positive effects of a well managed environment.
It highlights the need for better and stronger governance in the absence of hard limits.
1Inspired by Seth Godin’s podcast episode: The river of time
There is simplicity in the scope, time, cost trinity.
There is always more to talk about, factor in, consider.
Quality, however, is part of scope!
Imagine…
You are a techie in a corporate.
The platform you are working on offers a vast range of tools and capabilities.
You find the next task/user story/requirement to work on.
You immediately think of a way to implement a solution to complete the task and tick the box.
You have choices…
OR
If you are an individual contributor, your choices will be limited.
If you are managing a team, then and ask yourself – What can I do to foster the former behaviour over the latter?
Either way, if you feel conflicted about this and prefer to have you and your team showing high productivity on some dashboard, then send a link to this article to your superiors.
Designs suffer from
Challenging these should be part of the behaviour.
People need to appreciate that they are working in a shared environment.
They should not feel interrogated or confronted, it should be natural, and they should feel comfortable discussing these.
Make it part of every design discussions.
Make time for it.
Make it part of the culture.
Infrastructure as Code (IaC) as in cloud infrastructure, not infrastructure code as in writing your own middleware library.
In most cases IaC refers to some kind of template-based solution.
Template in this article refers to AWS CloudFormation template
It is strongly debatable if templates are code. If anything, code inside templates is generally an anti-pattern.
Think of templates as an “intermediary language” rather than code.
Templates are executed by respective platform “engines” driving actual cloud infrastructure configuration management.
Consider it “code” as far as an asset managed in version control together with the rest of the source code.
Templates will be sufficient for most infrastructure (IaC) jobs. Most templating languages will have constructs to express logic, for example: conditions. Most will also allow to include inline code as part of the configuration, nonetheless it is code mixed with template, for example: AWS velocity template for DynamoDB.
Writing Infrastructure as Code templates this way – in YAML or JSON – has been reasonable, but not without concerns. A good article on the topic is In defense of YAML.
The AWS SAM is a good example of simplifying CloudFormation templates, notice the Transform: 'AWS::Serverless-2016-10-31'
elements in SAM. A single SAM element may transform into a list of CloudFormation elements deploying a series of resources as a result.
Another example is serverless.com their templating language supports multiple platforms while also simplifies the templating compared to CloudFormation.
One of my concerns however is the mixing of Infrastructure as Code with Function as a Service definitions. For example, the definition of a function AWS::Serverless::Function
in the same place with an Gateway API AWS::Serverless::Api
and related Usage Plan AWS::ApiGateway::UsagePlan
.
I would like to keep application and infrastructure concerns separate.
My immediate approach was going to be to split up the template into multiple files and use AWS::Include to bring them back together.AWS::Include
does not work for all parts of the schema. Trying to use AWS:Include
under Resources
to include a set of functions simply does not work.
Next approach was going to be Nested Stacks. It is the recommended approach for large stacks anyway, so it seemed like a winner. It turns out Nested stacks are great for reusable templates – see Use Nested Stacks to Create Reusable Templates and Support Role Specialization – not so much for decomposing an application (template).
The AWS API gives access to the platform and resources through a range of SDK-s (Python SDK is called boto3). It is truly a low level access to resources that is typically used for developing software on the platform.
Infrastructure could be managed using the SDK. There are many good automation examples on how AWS Lambda can react to events from the infrastructure and respond with changes to it.
Managing more than a few resources using the SDK is not feasible, considering the coordination it would require: dependencies, delay in resource setup.
The troposphere library allows for easier creation of the AWS CloudFormation JSON by writing Python code to describe the AWS resources.
The GitHub project has many good examples
The examples would led you to believe that using troposphere is not much different than writing a CloudFront or SAM template in Python. Depending on your use case however, there are opportunities to explore:
Having the infrastructure and deployment configuration close to the implementation code has its own pros and cons.
Ideally troposphere would only be used in development time (not runtime if we can avoid it), therefore the deployment package would not include this library.
# Development requirements, not for Lambda runtime
# pip install -r requirements-dev.txt
awacs==0.9.0
troposphere==2.4.6
I use template.py
in the root of the project, the same place where the template.yaml
(or .json) would be, for producing the CloudFormation template.
I have followed two patterns for defining platform resources in the source code.
The resource definitions are part of the class implementation.
Note that the troposphere library is only imported at the time of getting the resources. Then it is only used when generating the CloudFormation template. None of these would need to run in the lambda runtime.
# the application component
class ApplicationComponent(...):
# class attributes and methods
# ...
@classmethod
def cf_resources(cls):
from troposphere import serverless
# return an array of resources associated with the application component
return [...]
# the template generator
from troposphere import Template
t = Template()
t.set_transform('AWS::Serverless-2016-10-31')
for r in ApplicationComponent.cf_resources():
t.add_resource(r)
print(t.to_yaml())
I use decorators for Lambda function implementations. The decorator registers a function (on the function) returning the associated resources (array).
# the wrapper
def cf_function(**func_args):
def wrap(f):
def wrapped_f(*args, **kwargs):
return f(*args, **kwargs)
def cf_resources():
from troposphere import serverless
# use relevant arguments from func_args
f = serverless.Function(...) # include all necessary parameters
# add any other resources
return [f]
wrapped_f.cf_resources = cf_resources
return wrapped_f
return wrap
# the lambda function definition
@cf_function(...) # add any arguments
def lambda1(event, context):
# implementation
return {
'statusCode': 200
}
# the template generator
from troposphere import Template
t = Template()
t.set_transform('AWS::Serverless-2016-10-31')
for r in lambda1.cf_resources():
t.add_resource(r)
print(t.to_yaml())
You could implement lambda handlers in classes by wrapping them as Ben Kehoeshows in his [Gist]
(https://gist.github.com/benkehoe/efb75a793f11d071b36fed155f017c8f).
AWS recently released the alpha version of their Cloud Development Kit (CDK). I have not tried it yet, but the Python CDK looks super similar to troposphere. Of course, they both represent the same CloudFormation resource definition in Python.
troposphere or AWS CDK, they both bring a set of new use cases for managing cloud infrastructure and let us truly define Infrastructure as Code.
I will explore the use of troposphere on my next project.