<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Egor Litvinenko]]></title><description><![CDATA[Egor Litvinenko is a senior software developer. Working mostly with Java technologies and focusing on system integration and performance.]]></description><link>https://egorlitvinenko.github.io</link><image><url>themes/uno/assets/images/background-cover.jpg</url><title>Egor Litvinenko</title><link>https://egorlitvinenko.github.io</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 20 Sep 2017 16:20:11 GMT</lastBuildDate><atom:link href="https://egorlitvinenko.github.io/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[BPMN и блокчейн]]></title><description><![CDATA[<div class="paragraph">
<p>Сегодня большинство из вас слышало о blockchain, поэтому перейду сразу к делу.
Я занимался разработкой BPMN процессов и сервера, обслуживающего их.
BPMN (Business Process Model and Notation) - это стандарт графического представление элементов для описание бизнес-процессов (БП) в BPM (Business Process Management) - управление процессами.
Традиционно BPM считается внутренней кухней организации. Другими словами большие организации создают БП для оптимизации процессов управления, которые используются внутри. Иногда БП используются между двумя организациями, когда есть большой уровень доверия.
БП могут быть очень и очень большими, не помещаться в монитор, ватман и т.д., состоять из множества подпроцессов, таблиц принятия решений (Decision Tables) и многое другое.
Вот пример простого бизнес процесса с <a href="https://ru.wikipedia.org/wiki/BPMN">Википедии</a>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b2/Quotation_BPMN_Example.png" alt="BPMN">
</div>
</div>
<div class="paragraph">
<p>И я задумался о том, что алгоритм blockchain мог бы найти применение в оптимизации бизнес процессов между различными организациями.
В этом случае организации, участвующие в бизнес процессе, получают достоверный источник данных, который нельзя подделать; аналитики -  возможность создавать БП знакомым способом.</p>
</div>
<div class="paragraph">
<p>Я вижу тут два применения:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Создание контрактов для блокчейн с помощью бизнес-процессов, как замена программированию;</p>
</li>
<li>
<p>Создание бизнес-процессов, в которых критические данные сохраняются в блокчейн (соответственно наследуя свойства безопасности и достоверности) и хранятся там для подтверждения выполнения процесса.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Собственно для вступления всё.
Далее опишу сделанный мной proof of concept (доказательство концепции), который показывает, что это может быть реализовано.
Для демонстрации я использую тестовую сеть Ethereum - <a href="https://rinkeby.etherscan.io" class="bare">https://rinkeby.etherscan.io</a>. Это сеть аналогична главной, разница только в технических деталях алгоритма, вкратце, он проще. И сделана специально для разработчиков. В качестве основы для BPMN среды разработки я взял <a href="http://camunda.org">Camunda</a>. Camunda одна из самых известных во всем мире создателей инструментов для BPM. Например, ею пользуются в <a href="http://www.zalando.com/" class="bare">http://www.zalando.com/</a>. Я взял их исходные коды (у них открытая лицензия, не волнуйтесь, это легально) и сделал БП, запускаемой на Camunda, интегрированной с blockchain.</p>
</div>
<div class="paragraph">
<p>БП на blockchain выглядит  так :</p>
</div>
<div class="videoblock">
<div class="content">
<iframe width="850" height="500" src="https://www.youtube.com/embed/MmgodsCUNx8?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="paragraph">
<p>Хотелось бы предположить, что однажды все организации (и крупные, и средние), будут взаимодействовать подобным образом, чтобы снизить свои издержки и автоматизировать процессы, одновременно сделав их прозрачными.</p>
</div>]]></description><link>https://egorlitvinenko.github.io/2017/09/20/BPMN.html</link><guid isPermaLink="true">https://egorlitvinenko.github.io/2017/09/20/BPMN.html</guid><category><![CDATA[bpmn]]></category><category><![CDATA[blockchain]]></category><dc:creator><![CDATA[Egor]]></dc:creator><pubDate>Wed, 20 Sep 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Self learning applications]]></title><description><![CDATA[<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Status: Article in progress</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_prehistory">Prehistory</h3>
<div class="paragraph">
<p>What is your batch size? When I did tests for parsing csv and write to CH (now on <a href="https://github.com/egorlitvinenko/testparsing">Github</a>), I saw that I have some variables: ring buffer size and batch size of Clickhouse driver, which I don’t know apriory, because ring buffer size is a <a href="https://github.com/LMAX-Exchange/disruptor/wiki/Frequently-Asked-Questions">CPU L3 cache size</a> and batch size depends on many factors, even on my laptop it could be changed depends on logging settings. And I realized that we could have another familly of applications, which should define their parameters dynamically at runtime.</p>
</div>
</div>
<div class="sect2">
<h3 id="_think_about_it">Think about it</h3>
<div class="paragraph">
<p>Let’s imagine what does influence on batch size of application?
If your database is remote, then it is at least network connection. If your database is local, then it is disk speed. What else? You also could mention branch predictions, cache coherence, false sharing and other effects reffered to multithreading processing, where batches decrease thread switches. What else? If you use compressing to reduce IO you should find batch size as a golden middle between CPU load and compressing. Or just row size. Really, when we set batch size we don’t think about that, generally. There are many effects and reasons.
And all of them could be changed from x86 to x64 or PowerPC, or from node to node, or even on one node by different performance profile and load.</p>
</div>
<div class="paragraph">
<p>Batch size is only one variable. For instance, if we create parsing application, which read file → parse → write to database in multiple threads (typically two threads with pipe streams), there will new parameters – queue sizes for threads. So we could have a set of parameters, which influence on one big task.</p>
</div>
<div class="paragraph">
<p>So who know what should batch size equal? The only answer is runtime. Moreover, theoretically runtime could determine what batch size is best in particular scenarious (when we have different load on server, for instnace).</p>
</div>
</div>
<div class="sect2">
<h3 id="_what_we_have">What we have?</h3>
<div class="paragraph">
<p>In modern live it makes sense to suppose that someone already did it for us. I found this articles:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://www.computerworld.com/article/2560247/app-development/self-taught&#8212;&#8203;software-that-learns-by-doing.html" class="bare">http://www.computerworld.com/article/2560247/app-development/self-taught&#8212;&#8203;software-that-learns-by-doing.html</a></p>
</li>
<li>
<p><a href="https://www.forbes.com/sites/teradata/2015/04/08/the-holy-grail-of-business-automation-self-learning-applications/#23e57971982f" class="bare">https://www.forbes.com/sites/teradata/2015/04/08/the-holy-grail-of-business-automation-self-learning-applications/#23e57971982f</a></p>
</li>
<li>
<p><a href="https://www.forbes.com/sites/teradata/2015/03/06/need-new-business-insights-listen-to-your-things/#4f2cc59a743e" class="bare">https://www.forbes.com/sites/teradata/2015/03/06/need-new-business-insights-listen-to-your-things/#4f2cc59a743e</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>They talk about IoT and something close, but not the same. The difference is above articles are about collecting data from devices, and I’m talking about application. Maybe from some point of view is the same, because I also mean that we have some device (computer), where we run application and collect feedbacks. But the main difference is it’s not about machines only. People also could participate in this process. Also in practice it could be not about “big data”. For big data we need a lot of experiments, and our dynamic algorithms should be responsive enough and appropriate even we don&#8217;t have too much collected data.
From the other side there are many runtime optimizations in JIT and HotSpot too, but this article about higher layer.</p>
</div>
</div>
<div class="sect2">
<h3 id="_algorithm">Algorithm</h3>
<div class="paragraph">
<p>Let’s describe simple model, which will represent and solve the task of batch size (from the start).</p>
</div>
<div class="imageblock">
<div class="content">
<img src="https://egorlitvinenko.github.io/images/SelfLearningApp-Sequence.png" alt="SelfLearningApp Sequence.png">
</div>
</div>
</div>]]></description><link>https://egorlitvinenko.github.io/2017/08/11/Self-learning-applications-Abstract.html</link><guid isPermaLink="true">https://egorlitvinenko.github.io/2017/08/11/Self-learning-applications-Abstract.html</guid><category><![CDATA[Machine learning]]></category><category><![CDATA[optimization]]></category><category><![CDATA[software engineering]]></category><dc:creator><![CDATA[Egor]]></dc:creator><pubDate>Fri, 11 Aug 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Hello, world]]></title><description><![CDATA[<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-java" data-lang="java">public static void main(String... args) {
        System.out.println("Hello, world");
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="imageblock">
<div class="content">
<img src="https://egorlitvinenko.github.io/images/hello_savepoint.png" alt="hello savepoint.png">
</div>
</div>]]></description><link>https://egorlitvinenko.github.io/2017/08/08/Hello-World.html</link><guid isPermaLink="true">https://egorlitvinenko.github.io/2017/08/08/Hello-World.html</guid><category><![CDATA[Egor Litvinenko]]></category><category><![CDATA[HubPress]]></category><category><![CDATA[Hello World]]></category><dc:creator><![CDATA[Egor]]></dc:creator><pubDate>Tue, 08 Aug 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Speed table]]></title><description><![CDATA[<div class="paragraph">
<p>Status - Just to know where to see quickly.</p>
</div>
<table class="tableblock frame-all grid-all spread">
<caption class="title">Table 1. Some speed examples</caption>
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">What</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ns</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">µs</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">L1 cache reference</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.5</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.00005</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Main memory reference</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">100</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.01</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Compress 1K bytes w/ cheap algorithm</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Compress 1K bytes with Zippy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Send 2K bytes over 1 Gbps network</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">20,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">20</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">SSD random read</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">150,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">150</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Read 1 Mb sequentially from memory</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">250,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">250</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Round trip within same datacenter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">500,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">500</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Read 1 Mb sequentially from network</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">10,000,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">10,000</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Read 1 Mb sequentially from disk</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">30,000,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">30,000</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Send packet CA &#8594; Netherlands &#8594; CA</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">150,000,000</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">150,000</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Sources:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://www.youtube.com/watch?v=h9AICWfaEVQ&amp;t" class="bare">https://www.youtube.com/watch?v=h9AICWfaEVQ&amp;t</a></p>
</li>
<li>
<p><a href="https://gist.github.com/hellerbarde/2843375" class="bare">https://gist.github.com/hellerbarde/2843375</a></p>
</li>
</ul>
</div>]]></description><link>https://egorlitvinenko.github.io/1970/01/01/Speed-table.html</link><guid isPermaLink="true">https://egorlitvinenko.github.io/1970/01/01/Speed-table.html</guid><category><![CDATA[cache speed]]></category><category><![CDATA[RAM]]></category><category><![CDATA[disk]]></category><category><![CDATA[network]]></category><dc:creator><![CDATA[Egor]]></dc:creator><pubDate>Thu, 01 Jan 1970 00:00:00 GMT</pubDate></item></channel></rss>