<?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[Strands Tech Corner - Medium]]></title>
        <description><![CDATA[Strands Tech Corner is the publication from the Technology team at Strands, where we publish our work, methodologies and experiences. - Medium]]></description>
        <link>https://medium.com/strands-tech-corner?source=rss----53ec1aeebc21---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Strands Tech Corner - Medium</title>
            <link>https://medium.com/strands-tech-corner?source=rss----53ec1aeebc21---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:13:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/strands-tech-corner" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reduce boilerplate with Redux Toolkit]]></title>
            <link>https://medium.com/strands-tech-corner/reduce-boilerplate-with-redux-toolkit-d56047455d63?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/d56047455d63</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Carlos Ruana]]></dc:creator>
            <pubDate>Tue, 10 May 2022 16:00:40 GMT</pubDate>
            <atom:updated>2022-05-10T16:05:17.680Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will try to convince you why using Redux Toolkit library is a <strong>must</strong> if you plan to use Redux or you are already using it.</p><p>This article does <strong>not</strong> discuss whether you should use Redux vs React context or any of the multiple other alternatives available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*DVO5iVIcJnbzmrHvXgeEhQ.png" /></figure><p>TL;DR This is why:</p><ul><li>You will have to write a lot less boilerplate code.</li><li>Writing actions and reducers way more easy.</li><li>Avoid adding many other libraries for immutability, entities and collection management, etc</li></ul><p>The fist thing you need to know about Redux Toolkit is that is a just a wrapper on top of Redux that does not change any of the logic for creating and maintaining you application state. It adds some utilities to make you live much more easy.</p><h3>configureStore</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*PR8Ge_3A2mBeawuy3itiqA.png" /></figure><p>Although it is not the main star feature, configuring the store with Redux Toolkit it is also easier. Those are the main benefits:</p><ul><li>Automatically adds redux-thunk middleware to the store</li><li>Redux DevTools Extension is already turned on</li></ul><h3>createSlice</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*nriHKLMqCOQhN1DVCwsY2w.png" /></figure><p>This is where the magic starts, and now writing Redux logic is all about configuration. Give it a <strong>name</strong>, an <strong>initialState</strong> and your <strong>reducers</strong> logic and Redux Toolkit already provides you with:</p><ul><li>createSlice uses the <strong>key</strong> of the reducers object (on the above example: <em>increment</em>, <em>decrement</em>, <em>incrementbyAmount</em>) to automatically generate <strong>action creators</strong> and <strong>action types</strong> with the same string name, which you are ready to export for dispatching from you application, so no more manually creating and maintaining constants on other files or writing complex action creators.</li><li>Those reducers are passed to createReducer() which provides immutable logic to update the state.</li></ul><h3>createReducer</h3><p>It provides with some logic to avoid mutating the state by accident (uses Immer library internally) although it allows you to write the code as you were really mutating the state.</p><p>Lets see what that means with an easy example. First <strong>without using</strong> createReducer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*lh5whXNBLisl98cVo_UFyg.png" /></figure><p>And now <strong>using</strong> it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*z0SjPSVXfattJW3Rbxmzrg.png" /></figure><p>Although at first sight it seems anti-pattern assigning the new value directly to any part of the sate (at least it did to me), it is obvious how it avoids the mess of creating a copy of the previous state in a very nested object when you only want to do a single update.</p><p>Once more Redux Toolkit does the work for you and creates a copy of the new state object before merging it into the store.</p><p>In my team to <strong>get rid of Immutable.js</strong> was necessary as the performance benefits it provides were not worth the difficulties using the library API and some of the times we end up converting Immutable objects to regular objects to work with in the views, loosing all the performance benefits anyway. So Immer bundle size is lighter than Immutable one and together with the other Redux toolkit utilities, it provides everything we need. I would recommend using <strong>Immer</strong> with Redux even if you decide not to use Redux Toolkit.</p><h3>createAction</h3><p>Let’s see that one also better with an example on how normally <em>action creator </em>functions are build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*esuhD88Hcrdp53z3OGX12A.png" /></figure><p>And how we can do it with just one line with Redux Toolkit library:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*JnHSbYZbhBMv0CRlOM5bdQ.png" /></figure><p>There are several things to notice here:</p><ul><li>createAction returns the <strong>action creator</strong> you can export and then dispatch from within your application.</li><li>When you call that action creator with arguments this becomes automatically the <strong>action.payload </strong>object.</li><li>The string you pass to createAction (<em>counter/increment</em> in the example) becomes the <strong>action type</strong> you then can use in your reducer. See example below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*U1m1JENh2xdiOqxapDWFVA.png" /></figure><h3>createAsyncThunk</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*_sNeJpIVo5DKi75GAix73A.png" /></figure><p>Very similar to createAction but for the case of dispatching async actions. Also notice:</p><ul><li>createAsyncThunk returns the <strong>thunk action creator</strong> you can export and then dispatch from within your application.</li><li>First parameter is the Redux <strong>action type</strong>, but in that case the string is not generating any reducer functions automatically as it does not know the details of your implementation. You should implement that instead on the extraReducers functions. In the example you can see the case of <em>fetchUserbyId.fullfilled</em> but createAsyncThunk will also generate <em>fetchUserbyId.pending and fetchUserbyId.rejected </em><strong><em>action creators</em></strong><em> w</em>here you can add you loading logic or error handling.</li><li>Second parameter is the callback where you implement the <strong>async behavior</strong> (such as doing ajax calls) and should return a Promise.</li></ul><h3><strong>createEntityAdapter</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*q4RM9SrhsHPxB40-3FxdMw.png" /></figure><p>I really like that one, you can normalize (efficiently way of organizing data) your data entities, also with just one line.</p><p>On the example above you just need selectId if you collection of data does not have an “id” attribute or is named different, such as “bookId”. Also you can skip the sortComparer if the collection to normalize has already the order you need.</p><p>This is the most important functionality it provides:</p><ul><li>It creates an easy to access structure for each collection { ids: [], entities: {} }. Very similar to what <strong>normalizr</strong> library provides. And although you can still use normalizer with createEntityAdapter our team decided the library was no longer needed for the needs of our applications.</li><li>Provides with plenty of <strong>CRUD functions</strong> to update your collection within your reducers. Take a look at the above example how easy is to add a new book to the collection by just using <em>booksAdapter.addOne()</em> or replace a full collection with <em>booksAdpater.setAll(). </em>We use it all the time on the <em>fullfilled</em> reducers when doing ajax calls, to update the state with its set of generated reducer functions for adding, updating, and removing entity instances from an entity state object.</li><li>More magic still!!! It contains a <strong>getSelectors() </strong>function which provides a set of very useful selectors (selectIds, selectEntities, selectAll, selectTotal, selectById) you can export. Those are the most used ones and Redux Toolkit includes them so you just have import them in your views and use the regular useSelector hook to get and work with your entities.</li></ul><p>If you want to learn more the official site has plenty of nice examples and tutorials:</p><p><a href="https://redux-toolkit.js.org/tutorials/overview#redux-essentials-a-real-world-example">https://redux-toolkit.js.org/tutorials/overview#redux-essentials-a-real-world-example</a></p><h3>Conclusion</h3><p>This is a glimpse at the Redux Toolkit library. Each of the methods above provide with much more functionality and it includes many other utilities, but hopefully you got an idea of how it helps fast development on your Redux Store by reducing the common boilerplate and making all the required steps much easier.</p><p>Our team reduced so much the boilerplate that rather than having several files for our state management (actions, reducers, schemas, selectors) we can fit each of our reducers now into a single (not too long) <strong>slice</strong> file.</p><p>It is a light library and the learning curve is very low if you already know Redux. Even if people joining your team knows nothing about Redux they will learn faster to create a store with Redux Toolkit rather that without it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d56047455d63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/reduce-boilerplate-with-redux-toolkit-d56047455d63">Reduce boilerplate with Redux Toolkit</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to test “react-responsive” components with Jest and Enzyme]]></title>
            <link>https://medium.com/strands-tech-corner/how-to-test-react-responsive-components-with-jest-and-enzyme-e24088355994?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/e24088355994</guid>
            <category><![CDATA[enzyme]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-responsive]]></category>
            <dc:creator><![CDATA[Eileen Jürgens]]></dc:creator>
            <pubDate>Thu, 01 Apr 2021 07:59:00 GMT</pubDate>
            <atom:updated>2021-04-01T07:59:00.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kK55ibs8m0B02eHD61kmLw.jpeg" /></figure><p>Tested components not only help you to create secure and flawless working projects but also the testing expertise for a developer becomes a key ability to have in the skill set. Furthermore, technology development never stops and the variety of existing devices that can be used to open webpages become huge, thus responsive development is more important than ever.</p><p>Before we jump into the test creation let’s first develop a new responsive component together. Assume we have a business customer who would like to see a quick overview of his current business KPI’s. To help him see his four KPI’s let’s create a component called &lt;KPICard /&gt; which can represent with the assistance of the passed down props each of the different KPI’s. The design of this component is meant to meet the demands of a mobile and web solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6S40Nl03MFd7JEzf0foonw.png" /><figcaption>Web view of the KPI card</figcaption></figure><figure><img alt="Mobile view of &lt;KPICard /&gt;" src="https://cdn-images-1.medium.com/max/1024/1*wP1Icw8GuHGfgpwluuxEwg.png" /><figcaption>Mobile view of the KPI card</figcaption></figure><p>To develop our responsive component we will use a media query wrapper from the <a href="https://www.npmjs.com/package/react-responsive">‘react-responsive’ library</a>. Both web and mobile view have to get defined in separate media query sections. The corresponding SCSS file can be found <a href="https://gist.github.com/EileenJuergens/58ffb1984fe347c477c6e70b36e83e8e">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/64906d446b2ad4cb3e125af187634712/href">https://medium.com/media/64906d446b2ad4cb3e125af187634712/href</a></iframe><p>Since we have created a good-looking and responsive component, we can finally dive into the testing of it.</p><p>To simulate the KPI card component how it is going through the unmount/mount lifecycle the mount() method from Enzyme will help us. Since the mount() method fully renders the component in the DOM, we need to specify the use case, web or mobile, that we want to test. Please keep in mind when we want to use the full DOM rendering, that we need to have a full DOM API, an environment that “looks like” a browser environment, available at the global scope. Let’s have a closer look at the mount() method, it is defined as follow.</p><blockquote>mount(node[, options]) =&gt; ReactWrapper</blockquote><p>As a first argument, it takes the node, so the react component, that we want to simulate. Additional options can be passed afterwards in the arguments, all these options are optional.</p><ol><li>options.context (object): context to be passed into the component</li><li>options.attachTo (DOM element): DOM element to attach the component to</li><li>options.childContextTypes (object): merged contextTypes for all children of the wrapper</li><li>options.wrappingComponent (component type): a component that will render as a parent of the node. It can be used to provide context to the node, among other things.</li><li>options.wrappingComponentProps (object): initial props to pass to the wrapping component if it is specified</li></ol><p>In our case, the options wrapping component<strong> </strong>and<strong> </strong>wrapping component props<strong> </strong>are the needed options to specify in our test since we want to wrap out KPI card content with the media query and also pass in the media query the screen width prop.</p><p>Now let’s have a look at how the ‘react-responsive’ library suggests testing the media query nodes. They recommend importing the context as a responsive context and within the provider property, you will be able to simulate the media query node.</p><blockquote>&lt;ResponsiveContext.Provider value={{ width: 1000 }}&gt;</blockquote><p>Within this node, you can pass a value property that has the width property available to mimic different screen widths. Please be aware of the fact if the component you are testing have a device prop in use, that this one will take precedence over the one from the context.</p><p>Combining now these two pieces of information, we can set up our test file. We need to create options that get passed as a second argument into the mount() method for mobile and web. The wrapping component is the media query so we use ResponsiveContext.Provider as it is described above. The wrapping component props will be in each case the different widths.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb984a44810cfd885590ca720bb3414f/href">https://medium.com/media/eb984a44810cfd885590ca720bb3414f/href</a></iframe><p>After the setup, we can write now our test cases using the Jest matches.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7760639272b87aee8d8f50d931d50a6b/href">https://medium.com/media/7760639272b87aee8d8f50d931d50a6b/href</a></iframe><p>Thank you for taking the time to read this article, I hope you enjoyed it. For more tips on how to test responsive components please do not hesitate to write them in the comments. Let’s close this article with the words of Confucius — “Learn as though you would never be able to master it; hold it as though you would be in fear of losing it.”.</p><p>Happy learning &amp; happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e24088355994" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/how-to-test-react-responsive-components-with-jest-and-enzyme-e24088355994">How to test “react-responsive” components with Jest and Enzyme</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is gRPC?]]></title>
            <link>https://medium.com/strands-tech-corner/what-is-grpc-f8d36ed1d020?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/f8d36ed1d020</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[grpc]]></category>
            <dc:creator><![CDATA[Miguel Ratia]]></dc:creator>
            <pubDate>Mon, 15 Feb 2021 08:34:32 GMT</pubDate>
            <atom:updated>2021-02-15T10:09:39.686Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Is gRPC? [Quick Guide]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_bme4130SsZu0Z40LMaRg.jpeg" /><figcaption><a href="https://www.freepik.com/vectors/people">Created by vectorjuice</a></figcaption></figure><p>With this guide you will quickly know what gRPC is.</p><p>Below you will find the main aspects of this framework. With them you will get a clear idea about it. Let’s get started!</p><h3>What is gRPC?</h3><p>Google Remote Procedure Call (gRPC) is an open source framework for high performance remote procedure calls that works in a wide variety of languages.</p><h3>A bit of history</h3><p>gRPC was developed by Google, under the name <a href="https://cloud.google.com/blog/products/gcp/grpc-a-true-internet-scale-rpc-framework-is-now-1-and-ready-for-production-deployments">Stubby</a>, to connect thousands of microservices built with disparate technologies. Initially, it was not standardized to be used as a generic framework as it was closely tied to Google’s internal infrastructure.</p><p>In 2015 Google liberalized it as open source and standardized it for community use, under the name gRPC.</p><p>During the first year of its launch, it was adopted by large companies such as CoreOs, Netflix, Docker or Cisco among others.</p><p>Due to its popularity, in 2017 <a href="https://www.cncf.io/blog/2017/03/01/cloud-native-computing-foundation-host-grpc-google/">gRPC became part of the Cloud Native Computing Foundation</a>.</p><p>And now let’s get into details…</p><h3>What are Protocol Buffers?</h3><p>Protocol Buffers (Protobuf) is the mechanism that gRPC uses to serialize structured data. Instead of using a textual format like JSON or XML, it uses a binary protocol which makes it more efficient.</p><p>The mechanism consists of an interface definition language and a code generator.</p><p>Through its interface definition language, Protocol Buffers allows you to easily define services with remotely called methods, their parameters, return types, etc. That definition is stored in text files with the extension <em>.proto</em>.</p><p>Based on the definition of the services in the <em>.proto</em> files, the Protoc compiler generates server and client code in different languages. The generated code also fully implements the communication between client and server. You can check <a href="https://grpc.io/docs/languages/">the complete list of languages</a> on the gRPC official website.</p><h3>gRPC communication patterns</h3><p>Common communication between a client and the server is done using the traditional pattern of sending a request and receiving a response. gRPC uses HTTP/2, that allows it to have three more communication patterns, in addition to the traditional one.</p><h4>gRPC unary</h4><p>This is the equivalent of the traditional pattern in which the client calls a remote function using a single request and the server returns a single response.</p><h4>gRPC server streaming</h4><p>In this pattern the client calls a remote function using a single request and the server returns multiple responses.</p><h4>gRPC client streaming</h4><p>This pattern is the reverse of the previous one. The client calls a remote function using multiple requests and the server returns a single response.</p><h4>gRPC bidirectional streaming</h4><p>The bidirectional pattern is the most complex. Through this, the client calls a function using multiple requests and the server returns multiple responses.</p><h3>Workflow to create a gRPC application</h3><p>The typical flow of creating a gRPC application consists of the following steps:</p><ol><li>Define the service using Protocol Buffers in a <em>.proto</em> file, detailing the remote methods it offers.</li><li>Generate the gRPC code for the client and server from the <em>.proto</em> file using the Protocol Buffers Protoc compiler.</li><li>Implement the logic of the methods defined in the service on the server.</li><li>Implement the processing of calls and responses to server methods on the client.</li></ol><h3>gRPC vs REST</h3><p>REST is the most popular architecture in recent times to build server applications that provide synchronous request-response communication. However, it does not meet all the requirements that some modern microservices demand.</p><p>While REST is a perfect solution for simple APIs, gRPC has become the ideal choice for more complex interfaces and services, because it offers streaming communication, higher speed and better performance.</p><p>Today gRPC has limitations of use mainly in web applications since the HTTP/2 protocol is not fully extended among browsers. For its part, the REST implementation is fully adapted to any type of application.</p><p>gRPC is not the best option to expose an application for external consumption since consumers are currently more familiar with REST and it also allows more flexibility of use.</p><p>Although at first glance gRPC could seem the clear winner, since it is a relatively new technology that has some disadvantages compared to REST.</p><h3>Conclusion: Why use gRPC?</h3><p>Many famous companies are embracing this technology and it is even rumored to be the future of microservices and APIs that will be used by mobile applications.</p><p>The key to increasing use of gRPC is the benefits it provides:</p><ul><li>It can be used in a wide variety of programming languages.</li><li>It is API-oriented and that gives you more freedom in interface design.</li><li>The rules of its syntax facilitate the maintenance of the interfaces.</li><li>It offers very efficient communication between processes thanks to the use of the HTTP/2 protocol.</li><li>Allows you to make streaming calls.</li><li>It incorporates security mechanisms through SSL.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8d36ed1d020" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/what-is-grpc-f8d36ed1d020">What Is gRPC?</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Challenges of Realtime Pipelines II]]></title>
            <link>https://medium.com/strands-tech-corner/challenges-of-realtime-pipelines-ii-964ace56c197?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/964ace56c197</guid>
            <category><![CDATA[parallel-processing]]></category>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[hazelcast]]></category>
            <dc:creator><![CDATA[Marcos]]></dc:creator>
            <pubDate>Wed, 20 Jan 2021 11:00:38 GMT</pubDate>
            <atom:updated>2021-01-20T11:00:38.013Z</atom:updated>
            <content:encoded><![CDATA[<h3>Challenges of Realtime Pipelines: Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnRAQ2QIa0BMrXWKxIcEJg.jpeg" /></figure><p>In this article we will be looking at some other aspects of our Realtime Data Pipeline. We will start by evaluating different deployment configurations and then cover a brief summary of points to consider for the much needed performance testing. We will then analyze how we scale horizontally, giving some insight on messaging optimizations, and finally, review the influence of parallel processing.</p><p>Just FYI, in the former article we covered some points that had to do with the choice of an asynchronous architecture, database batching, the use (or not) of an ORM framework and, importantly, caching.</p><p><a href="https://medium.com/strands-tech-corner/challenges-of-realtime-pipelines-88799430d960">Challenges of Realtime Pipelines</a></p><h3>Deployment</h3><p>Equally as important as which components are used is their proximity to each other. We can guess that the closer the Realtime process are to the cache instances the better. But let us imagine End User Data needs to be located in specific servers. What would be the toll to pay?</p><p>We have deployed our Realtime app and its cache, as well as some other Strands components and tools in our Kubernetes Cluster, in Oracle Cloud. From the different options we covered in the <a href="https://medium.com/strands-tech-corner/challenges-of-realtime-pipelines-88799430d960">previous article</a>, we will use only Hazelcast as cache, with Database as failover. We have targeted two different deployments. In the first one, the rte nodes are the same as the cache nodes (node affinity).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/0*kUPOBb3JfVW21G0-" /></figure><p>The second configuration is the opposite: cache nodes are not the same as the rte processing nodes, even though they still speak to each other (node anti-affinity):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9ow7RQt4l-VVebvR" /></figure><p>We went ahead and sent 20k messages to Strands Realtime: think of messages that create a new operation or update a balance account, that you can easily review in <em>the-name-of-your-bank-here</em> app.</p><p>The first configuration took 220 seconds, while the second one 280 seconds: <strong>27% faster.</strong> Again, the numbers may be different in another scenario or with a different hardware or network, but what we know is that if we do not have any restrictions, a different deployment can bring us from 37k messages per minute to 50k messages per minute.</p><h3>Performance test</h3><p>It would be unfair to omit the effort spent on performance testing. However, it is quite opposite: it deserves an article on its own to go through the use of activemq, a custom benchmark tool, jmeter, docker, elastic search, kibana, logstash, more recently prometheus, grafana,..</p><p>As an example, the overview of one of our performance environments below shows the scale of its complexity. In this particular environment we use Jmeter to randomly call our Benchmark tool, which then hammers ActiveMQ with messages that are processed by Realtime and end up reflected in our Database. Filebeat uploads to our ElasticSearch so we can visualize in Kibana its behaviour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*syPxxH8re9Zl0NfHISDtTQ.png" /></figure><p>Preparing and running tests takes time and resources. And very important: do not forget the Test Data. It needs to be close to Production volumes and replicate similar scenarios. In summary, plan ahead and make room for them.</p><h3>Horizontal Scaling</h3><p>Let’s see now how increasing the number of pods of Realtime improves the throughput. In a different environment we have worked with batches of 50 messages. When using only 1 instance (a pod), the throughput was nearly 16k messages/minute, taking 250 seconds to process 40k messages.</p><p>If we increase to 3 replicas in order to have a layout like the one below, it takes an average of 67 seconds to process the same 40k messages, with speeds ranging from 11k messages/minute to 12k/minute:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qh0TnNEFynuRhqFq" /></figure><p>Ideally we would have linear scalability, but we know in reality there is competition for resources from the different pods, both to reach the cache and the database. However, the overall throughput is 44k messages/minute, still 115% faster.</p><h3>Optimizations in Messaging</h3><p>It is important not to lose sight of the performance of messaging itself, which includes the level of caching — at the very least caching the connection — but as well the serialization cost.</p><p>Even the message format can be a factor to consider. When choosing Json, XML, Thrift, Avro, etc., performance is one of the key aspects, but so are others like cross-language support for example. At Strands, Hugo Jacquelin led an implementation where a -proprietary- “fixed length” format helped lowering the size of messages. Though it implied complexity for development and testing, if I/O from and to messaging infrastructure proves to be a bottleneck, then message size efficiency is a must.</p><h3>Parallel processing</h3><p>Strands Realtime makes use of parallel processing at different stages, like reading from the messaging system, actual processing or writing to the database. Even for the same stage, there is parallelization at different levels. While we are not going to discuss this process in detail, we do want to show the impact in the throughput. The first graph shows a performance test where actual processing does not do any parallel execution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLtfV3wWqLkE0kszVe2j6g.png" /></figure><p>We hit max speed somewhere halfway the duration of the test, and from this point the speed does not improve, no matter whether more load is put into the system. If we now process in parallel with a factor of 10, and we increase the load so the duration of the test is meaningful:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sH-K-EFziaOl6oZmP4SY3w.png" /></figure><p>We reach the peak much quicker, and this time we hit a peak of 33k messages/minute.</p><p>If on top of that we now use two nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rMbktKOTprlSDRU_j48uVw.png" /></figure><p>The throughput does increase again, this time up to 44k messages per minute.</p><h3>Summary</h3><p>We have covered the main difficulties we came across in order to reach our milestones.</p><p>Since the conception of Realtime, new scenarios have come up and the product as such has evolved to support them, becoming one component more of our Data Pipeline.</p><p>Composite messages, that include historical data, have made us reconsider how and where we calculate aggregates, and have substantially improved both the I/O at the message queues as well as at the Database.</p><p>We left out other points like the different alternatives for message acknowledge or message persistence.</p><p>In future articles we will cover the details of deploying in a Kubernetes cluster, as well as how to monitor by using Prometheus and Grafana. We will look at Streamsets and Kafka Connect, as well as other aspects of building our data pipelines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=964ace56c197" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/challenges-of-realtime-pipelines-ii-964ace56c197">Challenges of Realtime Pipelines II</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storybook configuration in React project]]></title>
            <link>https://medium.com/strands-tech-corner/storybook-configuration-in-react-project-ec59869f3e7d?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/ec59869f3e7d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[storybook]]></category>
            <dc:creator><![CDATA[Zheng Li]]></dc:creator>
            <pubDate>Fri, 04 Dec 2020 08:58:10 GMT</pubDate>
            <atom:updated>2020-12-04T08:58:10.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfsudFzdONEBWZP1u1t2nQ.png" /></figure><h3>Configuring Storybook: 6 Tips You Can’t Miss</h3><h4>How to configure your Storybook to be integrated with a current project</h4><p>Storybook is an open-source tool for UI development with a variety of addons to display your UI components in an interactive and detailed way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKVqaebQ24aYQzz1Idhcyg.png" /><figcaption>Here is how storybook looks</figcaption></figure><p>I am excited to share my experiences on how to configure your Storybook to integrate it into your current project. This article will be focused on the problems I’ve encountered and how I solved them.</p><p>To begin with, I recommend that you read the information on the <a href="https://storybook.js.org/docs/react/configure/overview">Storybook configuration</a> from the official website to have a basic understanding.</p><h3>Configuration files</h3><p>The configuration files are located in your project root fold .storybook, and the most important ones are main.js preview.js manager.js The main config file is main.js<em>,</em> there is a chance that you don’t need to config other files. This article will put more value on main.js and preview.js</p><h3>main.js</h3><p>As it is clearly stated in Storybook documentation:</p><blockquote>The main.js configuration file is a <a href="https://storybook.js.org/docs/react/api/presets">preset</a> and as such has a powerful interface, but the key fields within it are:</blockquote><blockquote>1. stories- an array of globs that indicates the <a href="https://storybook.js.org/docs/react/configure/overview#configure-story-loading">location of your story files</a>, relative to main.js.<br>2. addons - a list of the <a href="https://storybook.js.org/addons">addons</a> you are using.<br>3. webpackFinal - custom <a href="https://storybook.js.org/docs/react/configure/webpack#extending-storybooks-webpack-config">webpack configuration</a>.<br>4. babel - custom <a href="https://storybook.js.org/docs/react/configure/babel">babel configuration</a>.</blockquote><pre>module.exports = {</pre><pre>// The location of your stories<br>  stories: [&#39;../src/**/*.stories.@(js|mdx)&#39;],</pre><pre>// addons added to your storybook<br>  addons: [&#39;@storybook/addon-essentials&#39;],<br>// custom babel config  <br>  babel: async (options) =&gt; ({<br>      ...options,<br>      // any extra options you want to set<br>  }),<br>//  custom webpack config<br>webpackFinal: async (config, { configType }) =&gt; {<br>    // `configType` has a value of &#39;DEVELOPMENT&#39; or &#39;PRODUCTION&#39;<br>    // You can change the configuration based on that.<br>    // &#39;PRODUCTION&#39; is used when building the static version of storybook.<br><br>    // Make whatever fine-grained changes you need<br>    config.module.rules.push({<br>      test: /\.scss$/,<br>      use: [&#39;style-loader&#39;, &#39;css-loader&#39;, &#39;sass-loader&#39;],<br>      include: path.resolve(__dirname, &#39;../&#39;),<br>    });<br><br>    // Return the altered config<br>    return config;<br>  }<br>}</pre><p><strong>Tip 1</strong>: The Storybook has its default webpack configuration, when trying to import your current webpack config or add your own rules, DO use push to add your rules to the rules array, or mutable the config object.</p><pre>config.module.rules.push({<br>      test: /\.scss$/,<br>      use: [&#39;style-loader&#39;, &#39;css-loader&#39;, &#39;sass-loader&#39;],<br>      include: path.resolve(__dirname, &#39;../&#39;),<br>    });</pre><p>Config the necessary alias that already applies to your current project.</p><pre>config.resolve.alias = {<br>    ...config.resolve.alias,<br>    &quot;ui-components&quot;: path.resolve(<em>__dirname</em>, &quot;../src&quot;)<br>};</pre><p><strong>Tip 2</strong>: To check the final webpack config, you can run yarn storybook --debug-webpack to print the config in your terminal or you can add console.log(config.module.rules) inside webpackFinal function, and run yarn storybook to print only part of the final webpack config.</p><p><strong>Tip 3</strong>: Since version 6.0, Storybook add essential addons by default, including Docs, Controls, Actions, Viewport, Backgrounds, Toolbars. You can check the release note <a href="https://storybook.js.org/releases/6.0"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbH4tzBdv9F9IrDVAhivxQ.png" /></figure><p>All you need is to add essential addons in config.</p><pre>addons: [&#39;@storybook/addon-essentials&#39;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iO3BXWJCrQ-HNFri2FD78A.png" /><figcaption>With docs and control addons, Arg Table/Props Table can be added</figcaption></figure><h3>preview.js</h3><blockquote>To control the way stories are rendered and add global <a href="https://storybook.js.org/docs/react/writing-stories/decorators#global-decorators">decorators</a> and <a href="https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters">parameters</a>, create a .storybook/preview.js file. This is loaded in the Canvas tab, the “preview” iframe that renders your components in isolation. Use preview.js for global code (such as <a href="https://storybook.js.org/docs/react/get-started/setup#render-component-styles">CSS imports</a> or JavaScript mocks) that applies to all stories.</blockquote><blockquote>The preview.js file can be an ES module and export the following keys:</blockquote><blockquote>decorators - an array of global <a href="https://storybook.js.org/docs/react/writing-stories/decorators#global-decorators">decorators</a></blockquote><blockquote>parameters - an object of global <a href="https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters">parameters</a></blockquote><blockquote>globalTypes - definition of <a href="https://storybook.js.org/docs/react/essentials/toolbars-and-globals#global-types-and-the-toolbar-annotation">globalTypes</a></blockquote><blockquote>If you’re looking to change how your stories are ordered, read about <a href="https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy#sorting-stories">sorting stories</a>.</blockquote><p><strong>Tip 4</strong>: preview.js is the file where you can also import the global css/sass, so it will apply the styles to your components.</p><pre><em>import</em> “../src/styles/theme.css”;</pre><p><strong>Tip 5</strong>: If you have a top wrapper with a specific class name which has styles, you should add the same wrapper through decorator.</p><pre><em>import</em> { addDecorator } <em>from</em> &quot;@storybook/react&quot;;</pre><pre>// For each story, the parent element will be div with class name &quot;platform&quot;</pre><pre>addDecorator(story <em>=&gt;</em> &lt;div className=&quot;platform&quot;&gt;{story()}&lt;/div&gt;);</pre><p><strong>Tip 6</strong>: Any other global config or javascript mocks (formatters etc.) should be added in preview.js</p><pre>import { addDecorator } from &quot;@storybook/react&quot;;<br>import { withI18n } from &quot;storybook-addon-i18n&quot;;</pre><pre>addDecorator(withI18n);</pre><h3>manager.js</h3><p>The manager.js is to control the behaviour of Storybook’s UI. You can set <a href="https://storybook.js.org/docs/react/configure/features-and-behavior">UI options</a> and configure Storybook’s <a href="https://storybook.js.org/docs/react/configure/theming">theme</a>. It is optional and no need to add if your project doesn’t have the requirement for customised Storybook UI/theme.</p><h3>To conclude</h3><p>Since Storybook 6.0, the Storybook team makes it easier to configure, even though some of the config is missing or not written in a very detailed way in the documentation. But you can always ask for help by starting an issue in <a href="https://github.com/storybookjs/storybook/issues">Github</a>. Also, you are very welcome to become an open source contributor — learn how you can contribute <a href="https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING.md">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec59869f3e7d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/storybook-configuration-in-react-project-ec59869f3e7d">Storybook configuration in React project</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Five Tips to Boost Your Productivity as a Software Developer]]></title>
            <link>https://medium.com/strands-tech-corner/five-tips-to-boost-your-productivity-as-a-software-developer-3509d88fe007?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/3509d88fe007</guid>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Eileen Jürgens]]></dc:creator>
            <pubDate>Tue, 07 Jul 2020 15:09:55 GMT</pubDate>
            <atom:updated>2020-07-07T15:09:55.659Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jU9zLbWy8ovYBSnyGp3I1Q.jpeg" /></figure><p>Nobody is perfect. Nevertheless, building a few little habits can help us to improve as a person and as a professional. While there really isn’t any secret sauce to self-improvement, remembering these tips won’t hurt and will definitely help you to implement an efficient day-to-day structure.</p><h3><strong>1. Make your future self happy by writing clear commit messages</strong></h3><p>Have you caught yourself writing vague commit messages like “minor bugfix” “here some more code” or “my hands type text”? In the moment of the commit, you could not come up with a better message, and that is understandable. But what happens if you want to rollback to a specific time or commit? Or what if you want to restate an amazing function you implemented at some point in the past? These vacuous messages will make it almost impossible to find the related commit.</p><p>To write a good and clear commit message you can check out the <a href="https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines">Angular Commit Conventions</a>. Maybe using the whole header, body, and footer structure is a bit too much for some projects, but just following the header structure with a type, scope, and subject can be incredibly helpful.</p><p>Your future commit message could look then like this: “feat (tax-type-form): implement the new flat scheme”. You will start your message by specifying the commit type, which could be “feat” for a new feature, “fix” for a bug, “refactor” for a code change that neither fixes a bug nor adds a new feature or “test” for a new test or correction. The type will be followed by the scope written in brackets. Try to avoid writing file names, rather describe the general location. Subsequently, use a colon to separate the scope and the subject. In the subject, you should describe what the change in the commit is about. For the description, you should use the imperative present tense like “implement” and not “implemented” or “implements”.</p><h3><strong>2. Improve your English day by day</strong></h3><p>Is English not your native language? Or maybe it is and you just want to avoid typos? Then these two great little helpers are for you.</p><p>The first one is <a href="https://www.grammarly.com/">Grammarly</a>. This writing tool checks your text for grammatical and spelling errors, but also for punctuation and word choice. Using machine learning and deep learning algorithms, it highlights the bits of your text that could be improved and suggests a correction. You can use it as an online text editor, browser extension and as a mobile app. Different Google services allow you to check your grammar and spelling and even provide you with writing suggestions or autocorrection features, but Grammarly goes one step further and works even more precisely to help you write more flawless texts.</p><p>In the world of little online helpers, there is also one that will check your spelling while you write code. If you use Visual Studio Code as your editor, you can download an extension called <a href="https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker">Code Spell Checker</a>. This tool will highlight any spelling errors and offer alternatives that you can use to correct the misspelling. Therefore, Code Spell Checker can help you to avoid mistakes in variable or function names, but also in comments.</p><h3><strong>3. Keep on learning by reading technical articles</strong></h3><p>In the field of software engineering, where technology changes so quickly, it is really important to be up-to-date with the latest developments. There is a lot of sources where you can get your information from, such as <a href="https://medium.com/">Medium</a>, <a href="https://techcrunch.com/">TechCrunch</a>, <a href="https://developer-tech.com/">Developer Tech</a>, or <a href="https://dev.to/">Dev</a>.</p><p>For example, Medium allows you to subscribe to a newsletter and get a daily email with recommendations of articles that fit your interests. This can be a good starting point to look for good articles and, if you see anything that grabs your attention, just save it to read later.</p><p>Building a daily habit can help you achieve a goal and to create a continuous learning structure. To do so, book a fixed time slot in your daily routine to read software engineering related articles. It could be in the morning, right after you start your computer, after lunch or before finishing work. The “when” is not that important. What matters is doing it at the same time, every day.</p><h3><strong>4. Organize your files and resources with pins</strong></h3><p>Maybe you love order and organization, maybe not. In any case, everyone has different online resources that they use on a daily basis. Having them properly organized and easily available can save you a lot of time.</p><p>It is pretty likely that you always open the same tabs in your browser. Sure, you can save these often-used pages by bookmarking them, but still, you will have to open them manually every day. A helpful functionality in Google Chrome and Mozilla Firefox is pinning these websites to your browser. You can pin websites by right-clicking on the tab and selecting “Pin.” Your pinned pages will show up with their relevant favicon over the URL.</p><p>Just recently, Visual Studio Code launched a functionality to help organize and pin your files. With this tool, you can pin your most-used files with a right-click and select “Pin”. After pinning a file, instead of the file’s symbol and name, you will just see its icon. Especially when you use a webpack file to control and switch between different environments and/or users, you will find yourself opening this file often. It is quite helpful to have this file always quickly available without taking a lot of space in the tab bar.</p><h3><strong>5. Feel the relief of an empty email inbox</strong></h3><p>Who hasn’t seen one of those inboxes crammed with 500 emails? Surely, there are good reasons to store some of them, but are all those emails so important that you need to keep them in your inbox? In most cases, that is pretty unlikely. A solid goal to aim for is a zero-email-inbox. Knowing that there are only a few topics to have an eye on or that require action can be a huge relief.</p><blockquote>A good rule of thumb is: A happy inbox is one where you can see your last email without scrolling and using a single line display setting.</blockquote><p>The following actions can help you achieve an empty inbox. If a topic is finished but it could be revisited in the future, move it to a custom folder. If a topic is finished but won’t be of interest –like a Bitbucket notification about a pull request approval–, just delete it. When there are a lot of emails regarding the same topic, just keep the latest one.</p><p>Hopefully, some of these habits will help you to organize your day more effectively and to improve your productivity and wellbeing. Please do not hesitate to write in the comments if you would like to share more tips. Thank you for taking the time to read this article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3509d88fe007" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/five-tips-to-boost-your-productivity-as-a-software-developer-3509d88fe007">Five Tips to Boost Your Productivity as a Software Developer</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Give Effective Feedback to a Remote Team of Developers]]></title>
            <link>https://medium.com/strands-tech-corner/how-to-give-effective-feedback-to-a-remote-team-of-developers-371d96b2c82d?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/371d96b2c82d</guid>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Arnau Guadall Godino]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 12:42:50 GMT</pubDate>
            <atom:updated>2020-06-03T12:42:50.624Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong><em>A quick 4 step guide to handle Code Review while working from home</em></strong></h3><p>Remote work is rapidly on the increase all over the world. Due to the current circumstances surrounding the coronavirus outbreak, this trend is showing no signs of slowing down and has opened a lot of interesting opportunities. Amid stay-at-home orders all over the world, many companies are starting to see the benefits of allowing employees to work from home.</p><p>However, working remotely is not an easy task, and getting used to it can be tricky. Some people need their “going to the office” routine to stay productive, and others find too many distractions at home.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zIUzAo9gyZJu1XdBUZhyQ.jpeg" /></figure><h3><strong>Four tips for building a positive Code Review culture</strong></h3><p>When working in a <a href="https://www.wework.com/ideas/worklife/distributed-teams">distributed team</a>, developers have to make an extra effort in Code Review. Now more than ever, <strong>communication is key </strong>when you’re giving feedback to a colleague. This kind of exchange is easier in the office. After all, you can leave your desk, find that coworker and discuss any issue face-to-face, instead of leaving a vague comment in the pull request.</p><p>Negative (or ambiguous) feedback can have a huge impact on a colleague’s self-esteem and wellbeing. So what can we do to <strong>reinforce a positive culture and handle feedback in a constructive way</strong>?</p><h3><strong>1. Be specific</strong></h3><p>If you encounter any issue with a teammate’s work, don’t say <strong><em>¡This is wrong!</em></strong>, close the pull request right and continue on what you were doing. Or even worst, <strong>don’t approve a request without even taking a proper look at it</strong>!</p><p>Instead, you should <strong>describe the problem politely and in as much detail as possible</strong>, which will provide the necessary context for the developer to take action.</p><h3><strong>2. Provide alternatives</strong></h3><p>Additionally, it would be extra-nice if you could provide your colleague with an example of an alternative approach. This way, the person receiving the feedback won’t feel like their code is only being critiqued. Take this opportunity to <strong>show your support</strong> for their contribution.</p><blockquote>I would suggest another approach here. What if you avoid mutating the variable? Or you could even return the value directly.</blockquote><blockquote>Could you try the following approach, please?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qONC-OGgkq6WkR7eoQ_rtQ.jpeg" /></figure><h3><strong>3. Don’t take it personally</strong></h3><p>On the other hand, when we’re the one receiving the Code Review, we must remain humble and <strong>don’t take any comment as a personal attack on our skills</strong>. Also, it’s highly recommended to answer every comment you receive and let your teammate know that you took care of the issue.</p><p>And if you disagree with a colleague’s suggestion, don’t be headstrong and try to explain your reasons for holding your position. You might end up having a nice <strong>conversation</strong>, and other team members might take part in it as well.</p><h3><strong>4. Remember: Face-to-face is still there!</strong></h3><p>When managing “negative” feedback, a smile or some friendly chitchat near the coffee machine can go a long way. However, when these are not an option, video conferencing can be a handy substitute.</p><p>If an issue is hard to explain, or we’re facing a problem that is too complex, setting up a <strong>video conference</strong> is the best approach. With hundreds of tools at our disposal, it’s never been easier to work remotely, whether our teams are in the same city or in different time zones.</p><p><strong>Visual Code</strong> is a personal favorite. This tool provides a real-time collaborative development, such as <a href="https://visualstudio.microsoft.com/services/live-share/">Visual Studio Live Share</a>, for pairing with a coworker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*-zcrZ75kFhsqnBjW.gif" /><figcaption><a href="https://visualstudio.microsoft.com/services/live-share/">https://visualstudio.microsoft.com/services/live-share/</a></figcaption></figure><p>Do you have any additional tips or ideas on giving feedback remotely? Let me know in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=371d96b2c82d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/how-to-give-effective-feedback-to-a-remote-team-of-developers-371d96b2c82d">How to Give Effective Feedback to a Remote Team of Developers</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Afraid of iframes ?]]></title>
            <link>https://medium.com/strands-tech-corner/afraid-of-iframes-e011abf5ea5e?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/e011abf5ea5e</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[responsive-design]]></category>
            <dc:creator><![CDATA[Jose Javier Romero Rivas]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 10:43:45 GMT</pubDate>
            <atom:updated>2020-03-27T10:43:45.086Z</atom:updated>
            <content:encoded><![CDATA[<h3>Are you afraid of iFrames?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*BygPBaTdyE6Y2KHgdLMphQ.png" /></figure><p>You’re calmly working in your next frontend application, using all kinds of new frameworks that ease your daily tasks and make the development process so natural and understandable. Everything is fun, until you hear words like “Internet Explorer”, “hard coding”, “DOM manipulation” … or even worse: “iFrames.” No, please!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*B1Uew5fVM4wyXkQMyXsyjw.png" /></figure><p>“iFrames.” That’s a word we don’t like to hear, ever. We all know what iFrames imply:</p><ul><li>They look horrible (like those stickers some people put on their laptops. I’m sorry, I can’t deal with it :P )</li><li>They have several attributes that aren’t supported in html5 anymore.</li><li>Sometimes you have to use scrollbars to see the hidden content.</li><li>If you want to display content from another website, you can‘t control what happens there and you could have serious security issues.</li></ul><p>Few experienced developers feel comfortable when their managers or customers require them to use iFrames. But anyway, let’s forget about them for a while.</p><p>Now, imagine some customer wants to embed your application inside their own website. Ok, no problem, we tell this to the customer:</p><p>“Here you have the minified files. Import the js files, also the CSS ones. Select a &lt;div&gt; node in your DOM to insert my app and then use the javascript functions described in the documentation I sent you (or use the React custom components if the app is built with that framework). Please, also provide the dimensions of the space left for my app so it can be responsive.”</p><p>So far, so good. The integration is quite easy and the customer’s website displays our application nicely and, let’s say it, beautifully. Easy, right? Well, that’s the scenario we all want when integrating our app, but being honest, normally, the process isn&#39;t that quick and easy to accomplish. In a standard situation, we’ll have to face several headwinds:</p><ul><li>The customer website uses some of the same js libraries we use in our app, so we have collisions with some of the functionalities and unexpected things happen. Even worse, the client app uses quite an old version of the library. Why would someone do that? Come on. Please don’t do that.</li><li>The parent application uses generic CSS rules for &lt;span&gt; elements, or &lt;p&gt;, or maybe some class names coincide with ours. As a result, our app ends up looking completely different.</li><li>Our app was responsive. We tested it with different widths and it looked great. But now it doesn’t. We defined some breakpoints for different devices but when embedding the app, the reference width isn’t similar to the width of the app anymore, but similar to the width of the parent application. So our breakpoints references have to change if we want our “mini-app” to be responsive.</li></ul><p>Too many problems, too little time to have the app in production. Anxiety starts to hit.</p><p>How we can we avoid these issues in future integrations?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*MIn_U6GooizAaFMaU3hRjg.gif" /></figure><blockquote><em>Hi! I’m an iFrame and I want to be your friend!</em></blockquote><blockquote>Developer: “Wait … why would I want to use that piece of ****?”<br>iFrame: “Let me summarise some of my features!”</blockquote><p>And then, the iFrame said:<br>- You won’t have libraries collisions anymore because I behave like another tab/window.<br>- You won’t have CSS collisions anymore because I behave like another tab/window.<br>- Your app will remain responsive because its breakpoints’ reference is the iFrame’s width, not the main window’s one.</p><p>Wow. How come I didn’t think about that before? This seems ideal for the integration of frontend apps. But wait, what about the cons of using iFrames?</p><p>Well, you can minimize the risks and problems of using iFrames this way:</p><ul><li>If you think iFrames don’t look good, you have several attributes like “frameborder” or “scrolling” to make them look nicer. They are not supported in html5, but, unless the customer wants a 100% html5 app (which would be unusual), this wouldn’t be a problem.</li><li>You have the “sandbox” attribute to control some risks, such as allowing forms, scripts or other potential issues inside the iFrame.</li></ul><p>To sum up, iFrames aren’t ideal, and if you can avoid them, please do. But in some cases, especially when integrating a frontend app inside another one, they can provide more advantages than drawbacks.</p><p>Don’t fear the iFrame, be his friend. But just for a while.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e011abf5ea5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/afraid-of-iframes-e011abf5ea5e">Afraid of iframes ?</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Frontend Application Security: How We Protect Sensitive User Data]]></title>
            <link>https://medium.com/strands-tech-corner/frontend-application-security-b1ea9999cd02?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/b1ea9999cd02</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Carlos Ruana]]></dc:creator>
            <pubDate>Thu, 09 Jan 2020 09:25:18 GMT</pubDate>
            <atom:updated>2020-01-09T09:47:54.229Z</atom:updated>
            <content:encoded><![CDATA[<p>This article outlines <a href="https://medium.com/u/7224dddc5f8e">Strands</a>’ web application security practices from a frontend point of view. Given that most risks are controlled by our solid restful API, the aim here is not to give an in-depth description of the <a href="https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project">top 10 OWASP security risks</a>, but to explain how we deal with some of them from our frontend.</p><figure><img alt="Image shows a wasp, which actually is the logo of the OWASP organization." src="https://cdn-images-1.medium.com/max/438/1*vOURjp2Y1Ec-D7nORA_YGg.png" /></figure><h3>Avoiding <strong>Injection</strong> Attacks</h3><p>Injection attacks, particularly SQL Injection and XSS (Cross-site-scripting) are currently considered the most dangerous vulnerabilities when developing web applications. Working with frameworks such as <a href="https://angularjs.org/">Angular</a>, <a href="https://reactjs.org/">React</a>, <a href="https://vuejs.org/">Vue.js</a> or <a href="https://rubyonrails.org/">Ruby on Rails</a> helps frontend developers dealwith most of the injection risks, as all of them implement default escaping mechanisms to avoid attacks. However, you should understand the particularities of each of them to be fully covered.</p><p><a href="https://reactjs.org/docs/introducing-jsx.html#jsx-prevents-injection-attacks">React JSX</a> escapes variables before adding them to the DOM, meaning all values are converted to String before being rendered, avoiding malicious users injecting code.</p><p>Despite this, you should have some special cases in mind:</p><ul><li>React ONLY escapes children elements as texts but not props. As a result, code could end up placed in some HTML properties, where malicious code could be executed. Most of these cases occur when handling users&#39; data <strong>from input fields or from the URL</strong>, when receiving <strong>users’ input data already stored in the DB</strong>, or even when rendering components <strong>from a JSON or XML markup</strong> that has not been sanitized before parsing it to JS. The solution when receiving untrusted data from those channels is manual sanitization (that is, escaping control characters) before being placed on those props/attributes, also in script tags, URL locations, event handlers or CSS style tags.</li></ul><p>You definitely want to avoid these examples without proper sanitation:</p><pre>// Do not use not trusted data on href</pre><pre>const urlParam = window.location.search.substring(1);</pre><pre>function HelloWorldComponent() {<br>  return &lt;a href={urlParams}&gt;Click me!&lt;/div&gt;;<br>}</pre><p>User could change your URL from:</p><p>http://myurl/listdogs?page=1</p><p>to some random script which will be executed:</p><p>http://myurl/listdogs?javascript:alert(1);</p><pre>// Do not use not trusted data on style tags you can also end up with some random script</pre><pre>function HelloWorldComponent() {<br>  return &lt;a style=&quot;-o-link:&#39;javascript:alert(1)&#39;;&quot;&gt;Hi!&lt;/a&gt;;<br>}</pre><ul><li>The use of <a href="https://www.w3schools.com/jsref/jsref_eval.asp">eval</a> or <a href="https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml">dangerouslySetInnerHTML</a> could also be potentially risky when applied with users’ input data or a compromised DB/API. Employing these methods is strongly discouraged and that’s why we have rules set in our <a href="https://www.sonarqube.org/">Sonar</a> configuration to prevent developers from using them, except on very rare cases where its application is justified. Instead of eval you should use JSON.toJSON() and JSON.parse() and, if you really need to use dangerouslySetInnerHTML, you should escape control characters manually.</li></ul><p>If you are using some of the previous examples, there are several libraries out there that will sanitize your texts for you. Using your own regular expressions for sanitizing can be quite dangerous if you are not really experienced with XSS attacks.</p><p><a href="https://github.com/cure53/DOMPurify">GitHub - cure53/DOMPurify: DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:</a></p><p>Also, if you are not using React DOM to escape values into your JSX or any other similar library, you may want to follow the steps on those cheat sheets to avoid vulnerabilities:</p><ul><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.html">DOM based XSS Prevention - OWASP Cheat Sheet Series</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html">Cross Site Scripting Prevention - OWASP Cheat Sheet Series</a></li></ul><h3>Third-party libraries risks</h3><p>Even when you think you have covered all the risks in your application, you can be surprised to discover a vulnerability in some code your team has not even written. Although making sure that the external libraries you are using are 100% free of risk is close to impossible, there are several tricks you can do to mitigate that chance.</p><p>Using open versions of libraries that your developers will be pulling every time they do npm/yarn install is not a good idea, not only because it is unclear which bugs you are also importing each time, but for the risk it implies. Vulnerabilities on libraries with lots of downloads are often quickly fixed, but those libraries are also the most targeted by hackers. It is always better to choose a closed version of those libraries and check regularly for vulnerabilities and fixes.</p><p>Even a library initially free of vulnerabilities can be hacked (updated o replaced) with a version with intentionally malicious changed code. The best way to mitigate this is by having your own npm repository (acting as a cache) and enabling a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP">Content Security Policy (CSP)</a> to avoid importing compromised files from outside your company. In fact, good management of your CSP can avoid multiple XSS attacks.</p><p><a href="https://www.html5rocks.com/en/tutorials/security/content-security-policy/">Content Security Policy | Web Fundamentals | Google Developers</a></p><p>Also, if you are using Jenkins Pipelines or any other CI tool, you may set up some automatic scans on those libraries using <a href="https://docs.npmjs.com/cli/audit">npm/yarn audit</a> and report those vulnerabilities.</p><p><a href="https://www.npmjs.com/package/yarn-audit-html">yarn-audit-html</a></p><h3>Preventing sensitive data exposure</h3><p>In our money-management applications, we often handle very sensitive user data. Our backend team deals with mechanisms such as password encryption and session management,<em> </em>but most requests revolve around how personal data is managed in the frontend. The best way of avoiding exposing this data is to never store it in the frontend. That is why we totally discourage using localStorage and sessionStorage in our application (other than for storing “silly” data, if needed.)</p><p>HTML5 Web Storage has no data protection and is considered unsafe as hackers could use XSS attacks to read from it.</p><p>Additionally, logging out users after their session has expired might be a good idea to clear all data stored in the DOM, always depending on the level of importance your application gives to your users’ data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITdIrRHAclF41DkDZcI2TA.jpeg" /></figure><h3>Broken access control</h3><p>Authentication, authorization and business logic controls should never be implemented on the client-side functionality, that is why ––for better user experience–– we only implement routing in React.</p><p>This relates to the previous topic of sensitive-data exposure. By limiting backend access, we avoid users without authorization reaching sensitive data.</p><p>Given the fact that is possible that different users might access our applications through the same computer, we should avoid caching any data in the browser by adding HTTP Cache-control headers and meta tags.</p><h3>Security misconfiguration</h3><p>In the frontend, a bad configuration when creating a production version of an application usually does not create a vulnerability. However, this can lead to code not being completely abstract or with a wrong source map, which could help hackers to find your vulnerabilities faster.</p><p>A good idea is having different webpack configurations for development and production, and let automatic processes (as Jenkins CI) create the production build for you.</p><h3>Conclusion</h3><p>Security in Web apps is not a one-time effort, there is a routine that you have to follow while your application in on production.</p><ul><li>Check for new vulnerabilities and follow security organizations such as OWASP and their recommendations.</li><li>Review your third-party inventory regularly and update it if needed.</li><li>Use specialized tools or manually scan your logs for signs of malicious activity.</li><li>Take Pull Request very seriously, check for best practices violation and remind your team of the most dangerous current vulnerabilities.</li><li>Use automatic mechanisms to set Static Code Analysis Rules using a security tool such as <a href="https://www.sonarqube.org/">SonarQube</a>. Even if you have manually checked that your code is 100% bulletproof maybe someone else (not you, of course) will introduce a new vulnerability, probably when you are on holiday and you cannot decline the Pull Request!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1ea9999cd02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/frontend-application-security-b1ea9999cd02">Frontend Application Security: How We Protect Sensitive User Data</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Challenges of Realtime Pipelines]]></title>
            <link>https://medium.com/strands-tech-corner/challenges-of-realtime-pipelines-88799430d960?source=rss----53ec1aeebc21---4</link>
            <guid isPermaLink="false">https://medium.com/p/88799430d960</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[messaging]]></category>
            <category><![CDATA[realtime]]></category>
            <dc:creator><![CDATA[Marcos]]></dc:creator>
            <pubDate>Thu, 12 Dec 2019 10:23:28 GMT</pubDate>
            <atom:updated>2019-12-12T10:23:28.002Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*_wAoTI8T6pKYK5jq" /></figure><p>In the recent years at Strands we have seen an increasing demand to ingest data and gather analytics near real time.</p><p>While there have been earlier projects with such a goal, this article will focus particularly on some of the challenges we faced in Strands when building a reliable standard product, that we could later customize for our client’s different needs.</p><p>In this article we aim to cover the choice of an asynchronous architecture, the impact of accessing the database in bulk, the use (or not) of an ORM framework, and the evaluation of different caching solutions.</p><h3>Synchronous vs asynchronous</h3><p>Synchronous architectures offer a number of benefits that at first were very appealing. For example the simplicity of knowing at the time of execution whether a call succeeded or failed, and in case of failure, being able to retry in the original context.</p><p>However, we opted for an<strong> Asynchronous architecture. </strong>It allowed us <strong>writing to the database in bulk</strong>, which boosted our overall throughput. Decoupling the fact of acknowledging the message from its actual processing made the solution more complex, but at the same time more scalable and reliable. Note messages are persisted in an internal store before being acknowledged to the Messaging System.</p><p>A 3000 feet overview of its asynchronous architecture can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wE6Mu2pGWxRDqbE1" /></figure><p>Realtime accepts messages from a Messaging System, and will process them in batch, either after reaching a minimum number of messages, or at least after some interval. This means it will apply the business logic, mainly updating some of the database tables, and then its output can be sent back to the Messaging System and/or forwarded to other components of the Strands Suite. After all these years we have worked with a number of different Messaging Systems: from the JMS spectrum (Active MQ, Ibm MQ,..), to RabbitMQ, and more recently Kafka and Google PubSub.</p><p>Internally, processing the messages involves distributing them to their respective flow according to its action and type. Each flow represents the business logic and may have steps to validate the input, insert rows, update rows, update the cache, dispatch new messages, etc</p><h3>Understanding the domain</h3><p>This phase is a must no matter the application, and so it is nothing new to a seasoned developer, but it is worth mentioning it as in the very beginning we were facing scenarios we were not familiar with. Though we already had some integrations using Web Services, Data ingestion was traditionally a responsibility that fell onto the Database team. As a Backend Developer, our role focused on fetching efficiently the information, applying some neat business logic and then handling the output to the Front End team in a well-defined format. At least that’s how I would explain my day to a neighbor in the lift.</p><p>Strands Suite encompasses many concepts that help grasp the domain. Some are used for presentation, some for business logic, some others spread both, etc. But fewer are really necessary when it comes to ingesting data.</p><p>Few concepts make it manageable to understand new scenarios and workflows, facilitating the development of our solution, while keeping performance in the radar.</p><p>So for example, if we think of a customer account, the most common flow would be updating its balance. This turns out to be a much smaller subset of what the whole FM suite supports, and helps optimizing this flow to reach the speed expected.</p><h3>Batching in the Database</h3><p>YMMV, but if there is a Commandment you are to keep in mind if you want your app to be performant: <strong>work in batches</strong>! Prepare your statements, open a transaction, do many things quickly, out of it.</p><p>Not fully convinced? Let’s get some metrics from our environments to understand the impact.</p><p>If I fetch one row of a table filtering by one index, I see an speed of 62 ms/row. If I do the same for 100 rows, I get 5 ms/row. Before trying with a higher set, do I need all the columns? I will limit the fields I fetch: 4,4 ms/row. That’s a 10% improvement. Now let’s give it a try with 1000 rows: 1,4 ms/row, or <strong>44% faster</strong> than the original.</p><p>The same applies when it comes to Inserting or Updating, as our colleague <a href="https://medium.com/u/885135b269c1">Ferran Soler</a> explained recently in a separate article.</p><p><a href="https://medium.com/strands-tech-corner/optimisation-of-sql-inserts-into-rdbms-13d5ef90556d">Optimisation of SQL inserts into RDBMS</a></p><p>And I will not delve into details, but if there’s a second Commandment, this is “<strong>Send several statements at once</strong>”.</p><h3>Dropping backend dependencies: Database focus</h3><p>Once we chose a bulk strategy, we had no option but to drop the use of existing Java code for fetching data, and build up a new batch-oriented one only for ingestion. We reached a point where we dropped all dependencies to the former code, and as a result the software cycle decoupled. Naturally, at this point, the Database model became our focus, and the Realtime product was then very sensitive to any development done by the Data team.</p><h3>Hibernate vs JDBC</h3><p>One of the first consequences of the last point is that our graph of dependencies between objects flattened. Not only there are less interactions, but there is less data to link one to another.</p><p>So for example a product may only need to know the Id of its customer, or a transaction may need to track its product and the customer. The life cycle Hibernate has plenty of flexibility when it comes to life cycle of the data, but we evaluated the possibilities and concluded that in our scenarios it was not even needed.</p><p>So we then decided to keep track and cache any necessary values ourselves, which is the topic of the next point.</p><h3>Cache</h3><p>After several attempts we decided to allow for different layouts of Caching. By using interfaces we allowed to abstract from an specific vendor while at the same time we followed a fail-over strategy for some of our more common scenarios. We did so to overcome the challenges of performance we faced. The final result is that a call to cache may behind the scenes imply a call to a first-level cache and, if necessary, to a second-level cache, and so on.</p><p>In practice we opted for layouts with two to three levels of caching. The last level was always the DB itself, in order to limit any Database call.</p><p>We considered a number of NoSQL alternatives for caching, a couple per category:</p><ul><li>MongoDB: Distributed</li><li>Cassandra: Distributed</li><li>Hazelcast: Distributed , In-Memory</li><li>Redis: Distributed, In-Memory</li><li>RocksDB: Local store</li><li>LevelDB: Local store</li></ul><p>If we want our pipeline to be easily scalable, a distributed cache seems an straight good fit. Hazelcast can be deployed very easily, and is an in-memory solution which should translate in a great speed (At a memory cost, no doubt).</p><p>On the other hand, most data that needs to be cached may not change very often, making a local store more attractive given it consumes less memory. We chose RocksDB because reads seemed to perform better, which was our main concern.</p><p>Thanks to the use of interfaces we can always implement the support for a new store, and the Database was used as a fail-over in case a record was not found. Let’s see the performance for the two of the above we chose:</p><ul><li>Hazelcast, and the Database as failover:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cx8IjL5nKDxNw9cP0uDVqg.png" /></figure><ul><li>RocksDB, and the Database as failover:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOibbpJPIOqLLo6IOry08w.png" /></figure><p>Our performance testing showed their overall throughput were at the same level.</p><p>We could even make use of the best of both worlds through a “fail-over” pipeline: a fast distributed in-memory to share new objects, and an on-disk cache for static objects to save memory. So we used first RocksDB with Hazelcast as failover, and then the other way around. In both configurations we still kept a third level, the Database:</p><ul><li>RocksDB -&gt; Hazelcast -&gt; Database</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrz5H3rQG_x7XvK4rVM1jw.png" /></figure><ul><li>Hazelcast-&gt; RocksDB -&gt; Database</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOyspg9t4NCNbv2gii6Ymg.png" /></figure><p><strong>The graphs show that the throughput of the 4 cache configurations were very similar</strong>, in the order of 1500 to 1700 messages per minute. The real throughput is obviously well above this number when run in a decent infrastructure: our main purpose here was to compare the different layouts.</p><h3>Coming soon</h3><p>In the next article we will look at performance testing, specifically different alternatives of deployment and their metrics,and a first assessment of scaling horizontally. Then we will see some points of improvement by making our messaging more efficient as well as the impact of parallel processing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88799430d960" width="1" height="1" alt=""><hr><p><a href="https://medium.com/strands-tech-corner/challenges-of-realtime-pipelines-88799430d960">Challenges of Realtime Pipelines</a> was originally published in <a href="https://medium.com/strands-tech-corner">Strands Tech Corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>