Showing posts with label Continuous Deployment. Show all posts
Showing posts with label Continuous Deployment. Show all posts

Tuesday, February 19, 2013

Continuous Integration (CI) and Continuous Deployment (CD). Feature Bits


For more than a decade CI (Continuous Integration) helps us to deliver better code in quicker and saver manner. There are a lot of aspects and rules how to do it right and you can find a lot of information on the Internet.

Before sharing with you how things are being done at PicScout we thought it would be a great idea to give an overview of possible solutions for what is common to be called a feature bit.

In this post I will introduce a flavor called “Feature Toggles (Bits)”:

A few words about the CI:
Why do we need it?

Generally, we want:
  •  Prevent integration problems, referred to as "integration hell" and stop spending nights while trying to release a new version to production
  • Always work on latest code
  • Detect problems early and not during integration/deployment
  •  Be almost 100% sure about current code
  • Sleep good in the night…
How can we do it?
  • Commit early – small changes
  • Work on main trunk
  • Update your code from Code repository at least once a day.
  • All commits should be RFD - “Ready for deployment”. This means, all unit/integration/acceptance tests are green. Commits could be executed in regular way or in two-phase (pre-tested) approach.
  • Many more…

Okay, let's say we've worked hard to implement CI/CD recommendations.
That's obviously great, but imagine that now we introduce a new piece of code to our code base.
This code could be:
  •   Safe. (Could be deployed without affecting various system components)
    •   Internal algorithm/behavior was changed.
    •   Column or table was created
    •  Some internal bug was fixed
  •  Dependent
    •    Could be deployed only after making changes in other system components
This new code deployment can be done by using “Feature Toggle (Bit)”.
The main idea is: New code should be enabled/disabled using feature bits.

if (FeatureBitSettings.BitEnabled("ScanPdf"))
{
 // enable new behavior
}
else
{
 // old behavior
}
If you develop code, which is part of different components, feature bits should be added everywhere.
(Note: “if” – is one of the code smells, but for sake of save deployment it could be used).
Additionally, new tests with/without feature bits should be added/adjusted.

Feature bits stay in configuration files.

  true
  false


How it should work? Feature bits life cycle:
1.       Develop new code with feature bits.
2.       Test it: with feature bits On/Off.
3.       Set feature bits Off.
4.       Deploy it.
5.       Everything is fine? Enable feature bits to On (by changing configuration) in right order (if there are dependencies between components).
6.       In the case of problems you can do the rollback quickly by setting bits to Off.
7.       After running for some time (days/weeks) code declared safe.
8.       Remove feature bits from the code. Leave only the “On” code.
9.       Deploy it.
10.   Remove redundant feature bits from configuration.

As we might see, feature bits allow us handle different integration/deployment issues quickly and safely.

Monday, February 13, 2012

A Week of IL Tech Talks at PicScout

Sharing real life experience for the benefit of Israeli hi-tech community is one of the greatest things we have achieved during the last years.

Ori Lahav’s IL Tech Talks initiative definitely helped in promoting this in our community.
That’s why we happily hosted a full week of those tech talks at PicScout.

We learned a lot: From understanding client side performance, best development practices (here and here), scaling (here and here) to lean practices and management skills.

Amazingly, it appears that “good” things are somehow “reproduced” among the companies. The talks revealed that successful companies are build from the same “forces” in terms of practices and vision. These are exactly the same things we have done and continue to pursue at PicScout.

Unit testing, TDD and Continuous Delivery seems to free business and technology to move safely and together towards the goal. It was quite obvious from Wix’s and Outbrain’s experiences.

For us, being one of the scalable companies in Israel (in terms of billions image recognitions a month), it was very interesting to see others views on scalability.
Specifically (and personally), I would mention here the lecture by Eran Sandler.
Building a truly scalable architecture is hard. Sometimes, it isn’t even necessary till the right conditions are met. Eran’s lecture, introduced small and measured steps to gain scalability without re-writing the code.

Lean techniques (presented skillfully by Elad Sofer) made us to re-enforce our approach of continuous improvement. Building effective communication, seeking and eliminating waste and design for simplicity (yet “useful” products) are skills we all need to embrace and to grow.

Here are some (but not all) of our feedbacks:

Ilya: Once again I have got a validation on how Continuous Delivery and TDD help to create better software - talking about “Building a web infrastructure for 10M users”
Sharon: New ideas on management that will be tested soon ;) - talking about “Team Up”
Merav: Sometimes Agile principles perceived as the new management panacea; Understanding that those principles are here to serve you in a long term is what important - talking about “Lean Software Development”
Arik: I definitely learnt a few new best practices to make our web sites more effective - talking about “Web Performance 101”

We would like to thank all the presenters, who contributed from their own time to present and to share with us their real life experiences!








Thursday, December 29, 2011

ILTechTalks Week

During the second week of January, PicScout will host a week of IL Tech Talks.
We will have 2 talks a day starting from 16:30.

Please follow IL Tech Talks meet-up for more details.

Here's the agenda:


S - 8/1
M - 9/1
T - 10/1
W - 11/1
Th - 12/1
Team Up
(18:00)

The number of places is limited, so hurry up if you are interested.