<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Moran Danieli-Cohen</title>
    <description>The latest articles on DEV Community by Moran Danieli-Cohen (@msscohen).</description>
    <link>https://dev.to/msscohen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2827%2FPAcxddGJ.jpg</url>
      <title>DEV Community: Moran Danieli-Cohen</title>
      <link>https://dev.to/msscohen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/msscohen"/>
    <language>en</language>
    <item>
      <title>Performing Rapid Code Rollbacks Using Configuration</title>
      <dc:creator>Moran Danieli-Cohen</dc:creator>
      <pubDate>Tue, 28 Mar 2017 19:03:42 +0000</pubDate>
      <link>https://dev.to/msscohen/performing-rapid-code-rollbacks-using-configurtion</link>
      <guid>https://dev.to/msscohen/performing-rapid-code-rollbacks-using-configurtion</guid>
      <description>&lt;p&gt;&lt;i&gt;Originally published at &lt;u&gt;&lt;a href="http://www.msscohen.com/posts/rolling-code-releases-back-rapidly-using-the-project%E2%80%99s-configuration"&gt;msscohen.com - a mind of a software engineer&lt;/a&gt;&lt;/u&gt;&lt;i&gt;&lt;/i&gt;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;A common code release looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8fKbFRQ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/before.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="System before change consists of three components" src="https://res.cloudinary.com/practicaldev/image/fetch/s--8fKbFRQ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/before.jpg"&gt;&lt;/a&gt;&lt;br&gt;
&lt;i&gt;System before change consists of three components&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6y64Ulls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/after1.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="System after change: One component is replaced with an improved component" src="https://res.cloudinary.com/practicaldev/image/fetch/s--6y64Ulls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/after1.jpg"&gt;&lt;/a&gt;&lt;br&gt;
&lt;i&gt;System after change: One component is replaced with an improved component.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;If something goes wrong and and a &lt;u&gt;&lt;a href="http://guides.beanstalkapp.com/deployments/best-practices.html"&gt;rollback is possible&lt;/a&gt;&lt;/u&gt;, the rollback should replace the new production code with the old production code (replace C2' with C2). The rollback plan usually means: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Revert the current release by committing the opposite diff to the project's version control.&lt;/li&gt;
&lt;li&gt;Deploy the above change to production.&lt;/li&gt;
&lt;li&gt;Restart the project's services to apply the new code.&lt;/li&gt;
&lt;li&gt;Once the rollback process is completed, additional fixes may be needed such as repairing damaged data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rollback process may seem trivial but when working with distributed systems, performing a commit and releasing a new version to dozens of servers may take time. This time is valuable since it is the time where a buggy production version is working which may result in more corrupted data, more data loss, additional downtime and so on.&lt;/p&gt;

&lt;p&gt;One way to handle this situation is by applying an architectural pattern which will allow rollbacks by changing a single parameter in the project's configuration file. The following is a diagram of such architecture:
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WJKm3Fuh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/after2.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="Architectural pattern adjusted for rapid rollbacks" src="https://res.cloudinary.com/practicaldev/image/fetch/s--WJKm3Fuh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/after2.jpg"&gt;&lt;/a&gt;&lt;br&gt;
&lt;i&gt;Architectural pattern adjusted for rapid rollbacks: data is copied and distributed to the old and new components using a Hub; The Switch component decides which path to enable using corresponding configuration keys.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;This architecture presents two new components:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Hub&lt;/b&gt;: Copies and distributes traffic to several outputs. For file systems, this component will copy files to several directories; For messaging queues, this component will route messages to multiple queues (for example by using a &lt;u&gt;&lt;a href="http://rubybunny.info/articles/exchanges.html#fanout_exchanges"&gt;fanout exchange&lt;/a&gt;&lt;/u&gt;); For HTTP servers, this component will copy the HTTP request and send it to multiple destinations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EXGcvrZa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/hub.jpeg" class="article-body-image-wrapper"&gt;&lt;img alt="Hub" src="https://res.cloudinary.com/practicaldev/image/fetch/s--EXGcvrZa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/hub.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Switch&lt;/b&gt;: Choose which source of traffic to output according to configuration. You can either implement a generic switch or apply a switch per endpoint which enables or disables each endpoint's output according to a dedicated configuration key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X34dgu2K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/switch.jpeg" class="article-body-image-wrapper"&gt;&lt;img alt="Switch" src="https://res.cloudinary.com/practicaldev/image/fetch/s--X34dgu2K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.msscohen.com/assets/switch.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the advantages of this pattern is that you can deploy the new code without using it (when the switch is off), so you can test the code with real production data and stress, and activate it with a simple configuration change. Also, the hub and the switch are generic components which may be used for additional use cases.&lt;/p&gt;

&lt;p&gt;A disadvantage of this pattern is that for small releases writing a hub, writing a switch and duplicating all incoming data might be overkill. Another disadvantage is that once the new release is stable enough, the next release should delete the of old version (C2, and possibly the hub and the switch).&lt;/p&gt;

&lt;p&gt;I apply this pattern for either high risk changes or for large releases. In one of the biggest projects I managed, I kept the new version in production for a few months without enabling it using this pattern. During these months, we added more and more components and tested the system's behavior with live production data without affecting customers. Only when we were confident that our system was reliable, we enabled it.&lt;/p&gt;

&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;p&gt;Switch and hub components implemented in &lt;u&gt;&lt;a href="http://read.cs.ucla.edu/click/elements"&gt;Click modular router&lt;/a&gt;&lt;/u&gt;. Click is a software architecture for building flexible and configurable routers originally developed at MIT.&lt;/p&gt;

</description>
      <category>architecture</category>
    </item>
    <item>
      <title>3 Effective Ways to Maintain High Energy Levels at Work for Software Engineers</title>
      <dc:creator>Moran Danieli-Cohen</dc:creator>
      <pubDate>Mon, 06 Feb 2017 18:56:21 +0000</pubDate>
      <link>https://dev.to/msscohen/3-effective-ways-to-maintain-high-energy-levels-at-work-for-software-engineers</link>
      <guid>https://dev.to/msscohen/3-effective-ways-to-maintain-high-energy-levels-at-work-for-software-engineers</guid>
      <description>&lt;p&gt;Originally posted on &lt;u&gt;&lt;a href="http://www.msscohen.com" rel="noopener noreferrer"&gt;msscohen.com - career hacks for software engineers&lt;/a&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Although software engineering is often considers a dream profession, in real life it is sisyphean work which often requires many hours at the office under the fluorescents lamps, a freezing air conditioner and no sunlight. On the other hand, writing simple code which works is a craftsmanship and like so it requires inspiration, focus and high energy levels. In this article I will try to demonstrate how to balance between the two and manage to maintain energy levels high in a demanding workplace.&lt;/p&gt;

&lt;h2&gt;1. Find Solutions for Energy Waste&lt;/h2&gt;

&lt;p&gt;I returned to work 5 months after having my first child. My baby was still waking up 2-3 times at night and I was exhausted. My fatigue levels were so high that I decided to stop driving to avoid accidents. Thinking about returning to work and managing to function normally seemed like an impossible mission. I decided to analyze my daily routine and see if I can avoid energy waste. &lt;/p&gt;

&lt;p&gt;Knowing myself, my most productive time of the day is the morning. Therefore, in order to be effective I should make sure that my energy levels are high in the morning hours and are being used correctly. &lt;/p&gt;

&lt;p&gt;Analysis of my morning hours showed that most of my energy is spent even before I arrived to the office. In those days I woke up at 5:00 am to feed my child, dressed him up, prepared myself, took him to his daycare and then took a 2 buses ride to get to work. When I arrived to work at 8:00 am, I was already exhausted. &lt;/p&gt;

&lt;p&gt;I considered replacing the 2 buses ride with a cab. The price of a cab is expensive - about 10$ in each way. Meaning, 400$ a month. Once I realized that by paying for a cab I'm actually paying for a more productive work day, it seemed more reasonable. Looking at the total value instead of the price of an individual cab ride, I started taking a cab about everywhere - meetups, courses and conferences that I wouldn't go to otherwise.&lt;/p&gt;

&lt;p&gt;To conclude: check what is your most productive time of the day, analyze where your energy is wasted in this time and find solutions for energy waste by concentrating on the big picture and not on an individual action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.msscohen.com%2Fassets%2Fbreak3.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="a real break" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.msscohen.com%2Fassets%2Fbreak3.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;2. Take a Real Break&lt;/h2&gt;

&lt;p&gt;One of the workers I know doesn't take breaks. None. He arrives early and leaves the office at 19:00. Sometimes he continues working from home too. There are days he doesn't go to lunch breaks either: He just grabs something and eats at his desk while he continues working or he rushes to the nearest restaurant, buys something to go and disappears back to the office. There are managers with similar behaviour. &lt;/p&gt;

&lt;p&gt;Unintentionally, this behaviour creates stress, burnout and it is a killer antidote for creativity. Managers who act this way create the same level of expectations from their workers, even if they don't ask it explicitly.&lt;/p&gt;

&lt;p&gt;One of the main evils of this profession is that in most companies workers are still measured by the time clock and not by performance. &lt;u&gt;&lt;a href="%E2%80%9D(https://www.sciencedaily.com/releases/2011/02/110208131529.htm%E2%80%9D"&gt;Recent studies&lt;/a&gt;&lt;/u&gt; show that breaks are good for the brain: they increase creativity, improve focus and keep us healthy since we're not designed to sit all day. &lt;/p&gt;

&lt;p&gt;So in order to maintain energy levels high, next time you feel tired, not in focus or stuck with a bug for hours, continuing to work will only make you feel more tired. Try taking a break instead and the bug will be resolved before you notice. &lt;/p&gt;

&lt;p&gt;The meaning of break is not simply stop working. The meaning of a real break is giving rest for your brain. During break time do something which will help calm your mind like getting some fresh air, listening to your favorite music, drinking green tea and water, stretching exercises, and taking a shower or a quick nap if possible. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.msscohen.com%2Fassets%2Fchange_tasks3.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="shift between different tasks" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.msscohen.com%2Fassets%2Fchange_tasks3.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;3. Shift Between Different Tasks&lt;/h2&gt;

&lt;p&gt;The software engineering profession is full of tasks that require different skills: reading emails, writing code, performance testing, talking to stakeholders, learning a new topic, reviewing code, debugging an issue, writing documentation, designing a feature, etc. &lt;/p&gt;

&lt;p&gt;If you're working on a task which requires one skill and feel like you are running out of energy, switching to a task which requires a different skill is similar to taking a break for a specific part of the brain. So you can switch to another task which gives the part of the brain that was working some rest and then go back to that task later. &lt;/p&gt;

&lt;p&gt;For instance if you code for 2 hours and feel lack of energy, try talking to stakeholders or reading emails, which require different skills. If you learn a new topic and need some rest, try reviewing code or debugging an issue. After some time, go back to the original task and you'll notice increased energy levels. &lt;/p&gt;

&lt;p&gt;To summarize, in order to maintain energy levels high at a demanding profession such as software engineering: find solutions for energy waste by concentrating on the big picture and not on an individual action, take a break and do something that will calm your mind, and shift between different tasks to allow a specific part of the brain to rest.&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>personaldevelopment</category>
    </item>
  </channel>
</rss>
