Showing posts with label Stability. Show all posts
Showing posts with label Stability. Show all posts

Thursday, January 25, 2018

Stability Principles

Last year I started to blog about something I'm calling "Stability Mindset". I'm still working on the ideas but I think I had enough time to time and experiences to evolve the concept to some basic guiding principles.

You might be wondering if I'm just trying to do some kind of ugly re-branding of Reliability like Software Reliability Engineering(SRE) but I don't think is the case - I see is different things or at least a specific subset of SRE. If you are interested in a broader spectrum you can check out google insights on the matter. Google has this amazing book you can check it out about SRE.

I thought a lot if this was just SRE for mere mortals but I don't think it is. I really think is a different kind of problem or at least different subset for sure. Today I'm writing this post because I want to capture some of my recent findings and also because I did a retrospective exercise with my team today I promise I you share some of my thoughts.




Why It starts with a Mindset?

Last year I think I did a fair job grasping some of the good elements of what I consider this new mindset. Some of the major elements of this concept included:

  • Code / Release practices like Retry/Fallbacks/Timeouts
  • Proper Observability: Visibility, Dashboards, Alerts, metrics
  • Software and Infrastructure Automation
  • Testing

Besides the fact I still think these aspects are valid and still ok I do think there is more. There are many reasons why I think there is more and I will explain in this very post, however, don't get me wrong all things I said on the previous post are still important and this is more like an evolution of the idea rather them a correction or replacement.

Explain things can be hard. It's easy to understand something and use your gut feeling to tell something is wrong. Sometimes It's hard to express this to others members of your team and be clear and direct. It could get even harder to tell exactly what things they should do and what they need stop doing -- in other words specific behavior and practices.

Engineering means to deal with different kinds of problems, solutions, and platforms. Having said that stability is different when you are doing observability or when you are working on Cassandra backups or when you are doing in-memory database. However, I do believe the core principles are kind of the same and that's what I try to capture and share today.

It's not a process but how easy can you do it?

Stability does not means freezing. Old ops mentality often thinks if they "control" the env and don't let much stuff in they are safe. This was never true and this does not work on the current level of innovation that business needs to operate today. IMHO Stability does not need more process, actually, stability needs more discipline.

A process is something you can do it with compliance and you can check if you are doing or not. Compliance might work well for security but as long as you have development or people working with development background this might not be the case. So you can give feedback to people that their solutions need to be more "stable" but what that means? ...And more importantly how they do it? What they start doing? what they need to stop doing?

This need to explain to others added with the fact that some people get it more easily them others made me stop and think about something more direct and clear. That's why I try to come up with some of this principles. So the idea behind the principles is to make easier to understand what stability means and thus made the behavior and practices changes to archive it.

Senior means different things to different people

Senior engineer for one company might mean that the person can deliver high-quality work without any communication or support. For other companies like my company, it means you can deliver quality work alone but also you can learn anything and you can teach others to do it. I'm other companies have other definitions what a senior engineer means and this is fine.

So you might be wondering why I'm bringing this up. The reason is that people have different backgrounds and tell me how you measure someone and you will have some behavior in return for that kind of measurement. This means you might don't have it but maybe is not because of your lack of skills but maybe because your company does not care or don't need to care about this things.  In other words, I do believe in people and I do believe people can learn and improve so this is not black and white you have it you are great you don't have it you suck. No, Not at All!

Lean is one of the roots of agile and also one of the roots of DevOps. Lean does believe a lot on the right "vision" and in people empowerment. This is about empowerment and makes people able to deliver more "quality work" which quality means stability.

Asgard is not a place

Sorry if you did not watch last Thor movie but they said "Asgard is not a place" at the end of the movie was a ship or a piece of land by actually was whatever people were. That's how I think about stability is not something fixed with exact rules(a.k.a process). This is so true that for my team, for instance, production is whatever we do. We run software on AWS with multiple accounts, somethings production means what is running on PROD account, other times means what is running on SHARED-Infrastructure account and other times even means what is running on a TEST account.

Stability should be a mindset and in whatever you do so does not matter if you are working with Cassandra(The Source of Truth) for my project or something small like reporting tools for dependencies. When you are in a CORE team and there are people depending on your work -- everything you do is Asgard -- everything you do is production so all needs to be stable.

This is simple to understand and very hard to put in practice since sometimes things can stop working even if you did not change a single line of code. I'm sure everyone is familiar with Spectre and Meltdown vulnerabilities they are a good and recent sample of this. There is another great sample which is Gradle how never had a 3rd party dependency downloading some extra jar and blowing up your server bootup? I've been there.

Stability Principles

All right so right now this is the guiding principles of stability for me:

  • Isolation
  • Tests
  • Observability
  • Always Working
  • Configuration Management
  • Proactivity
  • Brazillian "Skol" principle

Isolation: Isolation is key. You need to have proper separation between DevOps Engineering or Software Engineering and production. So if your solution has a Jenkins job. You need to have 2 Jenkins job - one for development and another for production. Isolate only the "code" or servers machines is not enough. There is much more in isolation, for instance, we do use Slaves in our Jenkins and if there are many jobs on the same slave you will queue up and development bug might affect production since "Jenkins" is part of your "production" solution them the solution or have separated slaves.

Tests: If you can automate great if you cant or is too expensive at least you should know your CORE features and re-test all these features after your PR - this makes you go slower, however, it make you more stable. If you can automate is always a good idea, however, somethings in the DevOps Engineering filed are not testable at all like CollectD for instance or the effort to test is just instance since there are lots of remote and distributed async work.

Observability: Well you need to know if you are ok or not. So you need to have key metrics, basic dashboards, good alerts. This is basic and I don't think I need to explain much about this. In my current project, I don't do any customer-facing work and most of the things my team do are for support other teams so easy to fall into situations where it could take some time to detect that there is a problem. So the golden rules for my team have observability of everything that can fail and at least have some alert or some message on a slack chat.

Always Working: All Brazilians know an expression called "the obvious is hidden from sight" so this is the core assumption of the stability mindset. You need to internalize the idea that the software - whatever you do needs to be always working. All elements and step in your solution are equality important. So if your solution has java coding, ansible roles, Jenkins jobs, and a web UI. All these elements need to be working all the time and you cant just care about the java part. Stability is all or nothing.

Configuration Management: Rock solid configuration management practices like code versioning, code version control, tags on GitHub not only made the work safer but gives is the ability to easily fix a specific problem and develop new features in parallel.

Proactivity: This is an attitude. If you internalize that you have full ownership of everything you do and you are the last barrier and if you fail people will see the impact you will act more carefully and will work beyond what people ask you todo. We work with quarters and we have goals but you cant just follow the goals you need have some extra care.

Brazillian "Skol" principle: Down here in Brazil we have Pilsen beer called "skol" the beer is nothing special however there was a TV and talking about that the beer flows very well and you drink smoothly that the beer has something like a circle, not a square. Square means a bad thing and the idea here is you get stuff that is wrong and you make it right always. Like the boy scout. You always left the environment in a better shape then you find it. So no matter if was you who did the code wrongly or left it not working -- you are working on it so now it's your responsibility to fix it.

Sorry I just realize my "skol" metaphor will suck if you are not Brazilian or don't know Brazilians references -- so think as the boy scout rule. Always let it better than you found it no matter if was your fault. Some cultural references are very hard to explain because they just don't have translation well if you are Brazillian I hope you get it :D




What's Next? 

I'm talking about this subject because I care and have passion but also because I don't see much material about what I'm talking. Don't get me wrong there is great SRE stuff by many companies like Google, Twitter, Facebook, Netflix, however, I'm not talking about the scale or scaling problems but a different nature of problems.

I still doing coaching and coding everything. Still learning about stability mindset and how to develop better and more stable software. I will keep posting my finding here. Hope you guys enjoyed. Take care.

cheers,
Diego Pacheco

Tuesday, September 19, 2017

The Stability Mindset

The Stability Mindset

I have background on software development. Currently, I'm leading a team of highly effective engineering's where we are responsible of some of the components we delivery in production and I need to say that is not the standard reality on it market. Development is used to break things and move faster, however, lots of developers never cared about production or about “polishing” they systems. This effect happens some several reasons like:
  • Having different people to develop and operate software
  • Having different departments for development and Operations
  • Having development teams focus too much in new features rather than real UX

So there is this culture clash when we have developers doing DevOps Engineering(I say that for my own experience). We developers are not used to keep something running no matter what. To be always available and reliable. It takes some time to get this “Stability Mindset” but once you get it is hard to get out of your veins.



What is stability?

IMHO Stability is not about freezing things. So you need to engineer new features but you need to make sure you don't disrupt your service. How do you make sure you don't add disruptions? There are several practices for instance:
  • Testing, Testing, Testing
  • Telemetry and Alerts Automation
  • System internals Observability(error observability, app metrics, health checkers, distributed tracking, etc…)
  • Roll Out strategy: Change one client per time, step-by-step.
  • Have a fallback or rollback strategy is something goes wrong.
  • Coding for Stability Mindset

Coding Stability Mindset

Some time ago lots of folks down here in brazil was talking about “Defensive Programing” and i really think is something similar but for Stability. So for instance I work a lot with cloud and for instance lots of things I do run in background so If I do have proper Observability - easily could have lots of things going wrong and we will know on the worst way possible. What I mean by proper Observability, I mean basic things, like for everything you engineer you add:
  • OS automation(like ansible + Jenkins)
  • Notifications(I like to create Slack channels that ping me if something goes wrong)
  • Log everything(don't forget add logrotate)
  • Look Dashboards everyday(It help to build mental patterns and know you workloads in sense of “feeling” so you might smell is something is not ok.)
  • When you call any API have: Retries, Fallbacks, Timeouts.
  • Expose System/App metrics so you can understand what's happening internally

Is you release some shared component or service without this thing you can have proper debuggability/observability so you might not be proactive enough to leverage your user's experiences.  Another key thing in order to improve users experiences(developers) is great documentation and also abstractions. Don't expose all parameters, hide things and have good default this make adoption of thing easier. This concerns can be added later however they often take lots of time. I don't think a component/service can be released without this items I don't feel comfortable at least.

Being Lean on Binaries

It's usual to have components that are integrated into microservices code in this cases you need make sure to be as much lean as possible. Add only what is strictly necessary it might be better to “copy” some code and adding frameworks? Why? Because you can create some JAR HELL easily with your consumers.

That's something very unusual for developers. We often are familiar with re-use however in this scenarios re-use can be very tricky and might not pay off in a long run. How never had issues with Guava? AWS SDK?  This could be considered another item of the “Coding for Stability” since you might avoid problems for your end users by having this concerns before building anything.

Productivity as end Goal

In the end of the day, we want make developers more productive. We don't want to make developers more “restrict” or be heavily “Opinionated” of some solutions. There is high need for developer teams independence, however, is we don't have Stability mindset running in our veins we might provide poor user experience and end up with something that's a problem and slow down developers rather than speed up productivity.  Stability Mindset is something very hard to get from the beginning but as you practice you can get it and deliver better solutions.

Cheers,

Diego Pacheco

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.