<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emmanouil Psanis on Medium]]></title>
        <description><![CDATA[Stories by Emmanouil Psanis on Medium]]></description>
        <link>https://medium.com/@emmanouil.psanis?source=rss-158db1d51f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rKYmfBfzjWpGD2MwKVE4Uw.jpeg</url>
            <title>Stories by Emmanouil Psanis on Medium</title>
            <link>https://medium.com/@emmanouil.psanis?source=rss-158db1d51f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:00:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emmanouil.psanis/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Distributed batch processing in microservice architecture]]></title>
            <link>https://medium.com/@emmanouil.psanis/distributed-batch-processing-in-microservice-architecture-1837674cefe7?source=rss-158db1d51f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1837674cefe7</guid>
            <category><![CDATA[high-performance]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[microservices-pattern]]></category>
            <category><![CDATA[batch-processing]]></category>
            <dc:creator><![CDATA[Emmanouil Psanis]]></dc:creator>
            <pubDate>Tue, 19 Dec 2023 17:41:46 GMT</pubDate>
            <atom:updated>2023-12-19T17:41:46.974Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*DwKI90NZOHblNgrcxkS6Lw.png" /></figure><h3>Microservice architecture scaling focus</h3><p>Microservice architecture provides, amongst its other benefits, targeted scaling of services that undergo heavy stress. Recent design paradigms such as Reactive programming have further elevated the scaling capabilities of a microservice.</p><p>While the predominant requirement of microservices is to serve synchronously and efficiently a large volume of requests, its counterpart is frequently overlooked. Namely, asynchronous batch processing in a distributed system such as microservice architecture has escaped the design focus. In this article we will highlight optimisation potentials in a workflow spanning more than one microservice and demonstrate a workflow that maintains the batch processing discipline downstream.</p><h3>Pitfalls of async processing</h3><p>As a rule of thumb, asynchronous processing implies long processing time. Since the user will be notified about the processing outcome in a later time, it is common to neglect the efficiency of the underlying algorithm.</p><blockquote>Just because a user waiting for a response is removed from the equation, stress to the underlying resources should not be dismissed</blockquote><p>The stress to infrastructure resources becomes apparent as the volume of the input increases. DB sessions, CPU cycles, memory consumption still remain subject to stress under heavy workload and can even apply back-pressure to other, seemingly unrelated services.</p><h3>Batch processing in an isolated microservice</h3><p>Batch processing offers unique opportunities for optimisation. Since the same process is applied on a large volume of input data, data pre-fetching and caching are prime tools on a developer’s arsenal. Batch processing within a single service span is a common task and there are existing frameworks that focus on workflow optimisation. E.g. Spring Batch loads chunks of data in memory and writes back to the DB after processing is done, while Spring Cache can be used to cache computationally intensive task results or calls to external services.</p><blockquote>The combination of Spring Batch and Spring Cache can lead to a cost amortisation of operations over the input volume.</blockquote><h3>Batch processing spanning multiple microservices</h3><p>If a processing workflow spans multiple microservices, the traditional design is to push an item downstream as soon as it has been processed, either via an API call or a message queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*el9q95g56AXFmbOpH92kew.png" /><figcaption>Fig. 1 — Serialisation of a batch</figcaption></figure><p>As demonstrated on Fig. 1, this design converts batch processing to a serialised one downstream, thus forfeiting all the optimisation potential described above.</p><blockquote>The challenge is to maintain batch processing across microservices. Each microservice could then be viewed as a pipeline stage of a distributed process while maintaining efficient resource usage</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*iwRLr7XvdDoHuoMUS0b5rg.png" /><figcaption>Fig. 2–microservice processing spanning a 4-stage pipeline</figcaption></figure><h3>Key elements</h3><p>In order to maintain batch processing to all microservices down the pipeline, we need two key elements:</p><ol><li>Tag all messages with a unique, shared batch ID</li><li>Block the execution of a pipeline stage until previous processing stage is completed for all batch input</li></ol><p>The entry service does some initial preprocessing of the batch and tags all input with a shared, unique label. After processing and tagging, the service pushes the messages to the next service in the pipeline. The key is for the receiving service to simply store the <a href="https://www.enterpriseintegrationpatterns.com/patterns/messaging/DocumentMessage.html"><em>document</em> <em>messages</em></a> delaying processing until an <a href="https://www.enterpriseintegrationpatterns.com/patterns/messaging/EventMessage.html"><em>event message</em></a> is sent by the upstream microservice signalling the end-of-batch (EOB) processing. At this point all messages are received by the downstream service and are ready to be processed in batch, using the unique tag as an identifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*Q73q6yx4rBnCTfVkUj3vMA.png" /><figcaption>Fig. 3a — Document messages (blue) are stored in the DB for future processing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*embLKN55EEOonjtOh3jjnA.png" /><figcaption>Fig. 3b — Upon reception of the event message (green) we trigger batch processing of the unprocessed messages</figcaption></figure><h3>Remarks</h3><ol><li>The batch ID can be reused for all downstream microservices.</li><li>In the case study above we used the push model of the <a href="https://en.wikipedia.org/wiki/Observer_pattern">observer pattern</a> where we first push the document messages and then we publish an event message to trigger processing. An alternative could be to publish only the event message and let the downstream service pull the data from the upstream service.</li><li>A message queue is used to push messages across microservices. The same topic must be used both for document and event messages to avoid race conditions. The topic must have a single partition to prevent race conditions. If more than one partitions are present, sequential consistency becomes more challenging.</li><li>As in every pipeline processing, the efficiency of the system if maximised if the pipeline is fed: upstream microservices should process the next batch if data while downstream microservices process previous batches</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*G_vIPxAJwwO9cj3qidRqdQ.png" /><figcaption>Fig. 4 — Keep pipeline fed for maximum efficiency</figcaption></figure><h3>Putting everything together</h3><p>In the following, minimal proof of concept we assume that our workflow spans 2 microservices — A and B. We also assume that there are some expensive operations (e.g. an external API call to get a configuration that is common for all the data in a batch) on both microservices that justifies the use of batch processing. Therefore, the execution cost can be amortised over the size of the batch if we cache the response and the resource utilisation can be optimised. Finally, we assume the 2 microservices use a single-partition message queue for message passing. For this example we use the spring batch and spring cache frameworks. The following steps take place in the system:</p><ol><li>(Micro-A) We load a chunk of items (x1|L, x2|L, x3|L, …) in memory. These items have already been labelled with a shared, unique label (L) as part of pre-processing.</li><li>(Micro-A) We process the in-memory items, one at a time. Assuming that computationally or I/O expensive operation results can be cached, we execute this code only once and we cache the result.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*uiLFduX9SUzP2I2xArMfbA.png" /><figcaption>Fig. 5 — Input read in chunks</figcaption></figure><p>3. (Micro-A) We post each processed item (y1|L, y2|L, y3|L, …) as a Document messages (DM|L) in our message queue (MQ-1). The processed items carry the same label (L) as the input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*zOKCHCzpmwCiJnSjwHBsBw.png" /><figcaption>Fig. 6 — Items processed and placed in the queue</figcaption></figure><p>4. (Micro-A) Repeat steps 1–3 while there is valid input</p><p>5. (Micro-B) While microservice A is producing messages in the topic, microservice B is consuming the Document Messages by simply storing them in the DB. No further processing happens at this stage!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*OSzhzRSh0XvmZATAWP_Pbg.png" /><figcaption>Fig. 7 — Topic listener in microservice B stores the input for future batch processing</figcaption></figure><p>6. (Micro-A) End of input. We flush the in-memory cache and inject in MQ-1 an event message containing the unique label (L) to signal the end of the batch with the corresponding label (EM|L)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*ZYAj-_afxm5013cPHikuBw.png" /><figcaption>Fig. 8 — Event message injected in the message queue</figcaption></figure><p>7. (Micro-B) Upon consumption of the event message (EM|L), microservice B launches a new job instance using the unique label L as a job parameter. Stored, unprocessed messages matching the label L are now parsed into input chunks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*i17JLQ7knoNROSpNIWFdjg.png" /><figcaption>Fig. 9 — Batch processing of items with label L can now safely begin in microservice B</figcaption></figure><h3>Conclusion</h3><p>In this article we established a workflow for batch processing in microservice architecture. The aim of this design is to maintain processing in batches as data flow to downstream services in order to minimise cinsumption of the underlying resources. While this workflow can add an initial processing lag downstream, since we wait for all items of a batch to arrive before we begin processing them, it compensates by execution optimisation stemming from caching and efficient use of infrastructure resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1837674cefe7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Innovation Partners of Tomorrow]]></title>
            <link>https://medium.com/leapest-by-edcast/the-innovation-partners-of-tomorrow-1da91fa3edc7?source=rss-158db1d51f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1da91fa3edc7</guid>
            <category><![CDATA[innovation-management]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[employee-engagement]]></category>
            <category><![CDATA[organizational-culture]]></category>
            <dc:creator><![CDATA[Emmanouil Psanis]]></dc:creator>
            <pubDate>Fri, 15 Feb 2019 09:41:34 GMT</pubDate>
            <atom:updated>2019-02-15T09:41:34.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ABaa_-oIOaoI2Qxd" /><figcaption>Photo by <a href="https://unsplash.com/@rawpixel?utm_source=medium&amp;utm_medium=referral">rawpixel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The employee-employer relationship has evolved rapidly in the past decades. <a href="http://peopleingenuity.com/resource/the-future-of-employee-engagement">External forces</a> such as global competition, the shift from manufacturing to services based economy and democratization of knowledge, transformed the worker from a unit of production to a unit of creativity. In the aftermath of this transformation, the notion of work was redefined to focus on <a href="https://www2.deloitte.com/insights/us/en/focus/technology-and-the-future-of-work/redefining-work-organizational-transformation.html">addressing unseen problems and opportunities</a>. This tectonic movement resulted in the <a href="https://www.forbes.com/sites/jacobmorgan/2013/09/10/the-evolution-of-work/#261b981b8067">evolution of work</a> and <a href="http://peopleingenuity.com/resource/the-future-of-employee-engagement">engagement of </a>employees. In my view, this opens the door to a cultural renaissance that will further elevate the employee from a unit of creativity to an innovation partner. This article explains how <em>Sustainable Learning Culture</em> promotes employees to become innovation partners.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*Y51ct02uc1oHkMq91PEezg.png" /></figure><h4>Employees as Units of Creativity</h4><p>In the post- “job for life” era, the employee is in the spotlight of the development process as she has been promoted from being a contributor to a creator. This radical shift changed the employee’s expectations from her job and has compelled organizations to adopt instruments such as <a href="https://www.custominsight.com/employee-engagement-survey/what-is-employee-engagement.asp">Employee Engagement</a> to retain and motivate their talent. In this new <a href="https://www.mindsetworks.com/science/">growth mindset</a>, remuneration is gradually <a href="http://info.learnkit.com/employee-training-and-engagement-study/">becoming a byproduct of employment</a> as personal fulfillment, recognition, work-life balance and self-development are taking over. Employees, increasingly, see their work as an ongoing training experience where they build their own, unique skill set <a href="https://joshbersin.com/2018/11/learning-in-the-flow-of-work-arriving-now/">in the process</a>. In contrast to the <em>à-la-carte training</em> of the past, this individuality contributes toward a contingent workforce and encourages creativity. As a result, enterprise training, which followed a top-down approach in the past, is now shifting rapidly towards a general consensus model where the Learning and Development (L&amp;D) manager selects training programs that align with the corporate requirements and the personal interests of employees. Thus, corporate training has become an investment to unleash the potential of employees.</p><h4><strong>Investing in Employees</strong></h4><p><a href="https://hbr.org/resources/pdfs/comm/achievers/hbr_achievers_report_sep13.pdf">Employee engagement drives performance</a> and organizations are increasingly adopting this as an instrument — <a href="https://insights.humancapital.aon.com/talent-rewards-and-performance/engagement-2018?utm_source=Ceros">studies</a> have shown a staggering 64% global employee engagement. This number proves that organizations that grasp the changes in<a href="https://www2.deloitte.com/insights/us/en/deloitte-review/issue-21/changing-nature-of-careers-in-21st-century.html"> the 21-century career</a> cater to their employees. Thus, it should not come as a surprise that professional training receives a proportional focus. As an employee at <a href="https://www.leapest.com/">Leapest by EdCast</a>, an online B2B marketplace for training resources serving the professional training ecosystem, I see firsthand the importance of professional training and the increasing supply and demand about it.</p><h4><strong>From Professional Training to a Learning Culture</strong></h4><p>The link between employee engagement, professional training, and a <em>Learning Culture</em> is a <em>Training Market</em> — wherein, the <em>employees</em> are the consumers, <em>Professional Training </em>is the product and a <em>Learning Culture</em> generates the demand. The growth of this market is correlated with employee engagement, innovation, and retention of top talent . As in every market, supply and demand work in tandem and a sustainable demand leads to a dependable market. An organization can encourage such demand by nurturing a strong <em>Learning Culture</em> which, in turn, translates to a fast-growing <em>Training Market</em> but in order to do so, it must first understand the ecosystem of a sustainable <em>Learning Culture</em>.</p><h4><strong>The ecosystem of the Learning Culture</strong></h4><p>Employees are constantly invited to<a href="https://www.modernworkplacelearning.com/cild/"> rethink workplace learning</a> but many companies often overlook <a href="https://www.jstor.org/stable/43695448">the dependence of the learning culture on a safe environment</a> <em>i.e.</em> an environment where employees are encouraged to put their recently acquired skills into practice while more experienced employees provide insight and guidance. In my view,<strong> a learning culture in isolation is like a firework of innovation: dazzling yet unsustainable</strong>. For a learning culture to be sustainable, an organization must:</p><ol><li>satisfy all the<a href="https://trainingindustry.com/articles/strategy-alignment-and-planning/creating-a-learning-culture-for-the-improvement-of-your-organization/?utm_content=cpdc"> fundamental steps</a> towards a strong <a href="https://www.shrm.org/hr-today/news/hr-magazine/Pages/0515-learning-culture.aspx">knowledge sharing culture</a>, <em>i.e. </em>formalize training and development plans, give recognition to learning, get feedback, promote from within and, finally, develop knowledge and information sharing into a formal process</li><li>provide a safe environment</li><li>provide transparency in the workplace</li></ol><p>These aspects are conducive to a learning culture and it is only when all conditions are satisfied that the learning culture, which according to leading thinkers is amongst<a href="https://www2.deloitte.com/insights/us/en/focus/technology-and-the-future-of-work/evolution-of-work-seven-new-realities.html"> the most important driving forces shaping the work-related realities of tomorrow</a>, can thrive. In my opinion, small companies should not only value but also promote a knowledge-sharing culture more than the large corporations due to the limited number of employees and the workload imbalance which is intrinsic to small teams with segmented knowledge. When it comes to transparency, I believe that value-driven organizations with employee-centric cultures are inherently more transparent.</p><p>Finally, the epitome of a learning culture is the application of the newly acquired skills in a safe work environment. A safe environment is a hotbed of innovation where employees expand their skill set and assume tasks outside their comfort zone. Such a work environment bears many benefits both for the employees and for the team. Specifically, when employees broaden their skills, the teams become more balanced and more independent. Previous bottlenecks are alleviated since now more employees have the skills to deliver the task at hand. When the teams are balanced, the project manager does not have to worry about resource allocation but focus on vital issues of task allocation and time management. In addition, a safe work environment cultivates a culture where risk-taking is accepted and encouraged. According to a 2007 <a href="https://psycnet.apa.org/record/2007-09950-011">review</a> of several meta-analyses, the sense of challenge is a major factor in employee-driven innovation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/0*RuhvqOjDvswZuNSl" /></figure><p>For example, in the case where a developer is falling behind the schedule, <em>e.g.</em> due to an underestimation of the complexity of a task, a colleague can pick up the slack by offloading some of her allocated tasks. As a result, a safe environment improves autonomy and safeguards delivery time estimations. Once again, I can personally add to the <a href="https://coreaxis.com/5-benefits-strong-learning-culture/">claim</a> that a strong learning culture encourages innovation, maximizes employee potential and, ultimately, inspire loyalty. Using these ingredients, a company can bolster the relationship between the employees and the management. An organization becomes a cohesive unit that grows bolder as employees gain confidence in their ever-expanding skills and their trust in the management increases. Finally, a strong learning culture sends out a strong message to the employees that <a href="https://www.hrtechnologist.com/articles/culture/5-proven-ways-to-create-a-lasting-legacy-of-employee-innovation/?utm_source=tweet_this&amp;utm_medium=social">employee-driven innovation</a> is a true priority and not merely something to which the organization pays lip-service. At the end of the day,</p><blockquote>“<a href="https://www.shrm.org/resourcesandtools/tools-and-samples/toolkits/pages/developingemployeecareerpathsandladders.aspx">training and development should be focused on preparing the employee for a lifetime of employability versus a lifetime of company employment</a>.”</blockquote><p>Most CEOs understand the importance of employee development but the strongest support to this claim comes from market-leading organizations which, when it comes to grooming innovators, usually set the standards.</p><h4><strong>Learning from the leaders</strong></h4><p>Every leading organization’s culture, at its core, has a strong <em>Learning Culture</em>. It is the key to thriving innovation and the focal point of most cultural transformations. Many <a href="http://fortune.com/future-50/">Fortune Future 50</a> companies underwent a cultural transformation.<a href="http://fortune.com/2017/10/20/how-intuit-reinvents-itself/"> Intuit did it</a> by focusing on employee engagement.<a href="https://www.shiftelearning.com/blog/learning-culture-improve-bottom-line"> Apple did it</a> in the early 2000s resulting in the largest market capitalization in the world, at the time. Microsoft is still undergoing this transformation.<a href="https://www.shiftelearning.com/blog/building-learning-culture"> Google</a> is another role model of a contemporary learning culture. Many other major players in the field are going through this transformation. And the rest will either follow or wither away.</p><h4><strong>Conclusion</strong></h4><p>A learning culture is a core requirement for the 21st-century employee who treats her job as a source of personal fulfillment rather than merely a source of income. Consequently, a learning culture is a key factor of employee engagement which, in turn, unlocks the full potential of the employees. A <strong>sustainable </strong>learning culture contributes to the retention of top talent while it encourages employees to expand their skills towards current and future company needs. When this culture is fueled by <strong>trust </strong>and applied in a <strong>safe work environment</strong>, the employees are empowered to develop approaches to solve problems, address opportunities, identify unseen problems, take initiatives and, finally, turn their passion into innovation. <strong>An employee in a safe work environment with a strong learning culture today is the innovation partner of tomorrow.</strong></p><p>If a strong <em>Learning Culture</em> is hidden in plain sight in all success stories, from innovating start-ups to leading industry, shouldn’t every company invest in it?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1da91fa3edc7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/leapest-by-edcast/the-innovation-partners-of-tomorrow-1da91fa3edc7">The Innovation Partners of Tomorrow</a> was originally published in <a href="https://medium.com/leapest-by-edcast">Leapest by EdCast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>