<?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[Microservices Architecture - Medium]]></title>
        <description><![CDATA[Microservices is software architectural pattern to break big monolithic app into smaller components based on business capabilities. This gives flexibility for team to manage the component independently without worrying about breaking other components. - Medium]]></description>
        <link>https://medium.com/microservices-architecture?source=rss----f77598286e9---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Microservices Architecture - Medium</title>
            <link>https://medium.com/microservices-architecture?source=rss----f77598286e9---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 17:13:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/microservices-architecture" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating Distributed Task Scheduler using Hazelcast]]></title>
            <link>https://medium.com/microservices-architecture/creating-distributed-task-scheduler-using-hazelcast-ebe1aa0b5aef?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/ebe1aa0b5aef</guid>
            <category><![CDATA[scheduler]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[hazelcast]]></category>
            <category><![CDATA[orchestrator]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 11:34:35 GMT</pubDate>
            <atom:updated>2023-04-10T11:34:35.155Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*o2ZZ0P9UabX6yngY2UY7Lw.png" /></figure><p>A distributed task scheduler is a system that coordinates the scheduling and execution of tasks across multiple nodes in a distributed system.</p><p>Distributed task schedulers are commonly used in large-scale distributed systems, such as data centers and cloud computing environments, where tasks may need to be executed on a large number of machines simultaneously. They are typically designed to be fault-tolerant, so that if a node fails, tasks can be automatically rerouted to other nodes in the system.</p><p>Examples of distributed task schedulers include Apache Mesos, Kubernetes, and Apache Hadoop YARN. These systems provide a centralized framework for managing resources and scheduling tasks, and allow developers to focus on writing code instead of worrying about the underlying infrastructure.</p><p>For Example, running 10,000 compliance checks/policies on 500,000 machine in data center for scanning.</p><blockquote>How to run 5–10 Billion task daily?</blockquote><p>In this article we are creating distributed scheduler using spring boot and hazelcast clustering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*lwLQnWSL9I1YCaK8UNNeJw.png" /></figure><p>To create a distributed task scheduler using Spring Boot and Hazelcast, we can follow these general steps:</p><ol><li>Set up a Spring Boot project and add the necessary dependencies. You will need to add the Hazelcast dependency to your project, as well as any other dependencies you might need for your specific use case.</li><li>Configure Hazelcast in your Spring Boot application. You will need to create a Hazelcast configuration bean and configure it to enable the distributed task scheduling feature.</li></ol><pre> &lt;dependency&gt;<br>     &lt;groupId&gt;com.hazelcast&lt;/groupId&gt;<br>     &lt;artifactId&gt;hazelcast-spring&lt;/artifactId&gt;<br>     &lt;version&gt;5.0.1&lt;/version&gt;<br>  &lt;/dependency&gt;</pre><pre>@Bean<br>public Config hazelcastConfig() {<br>    Config config = new Config();<br>    config.getNetworkConfig().getJoin()<br>          .getMulticastConfig().setEnabled(false);<br>    config.getNetworkConfig().getJoin()<br>           .getTcpIpConfig().setEnabled(true)<br>           .setMembers(Arrays.asList(&quot;127.0.0.1&quot;));<br>    config.addExecutorConfig(new ExecutorConfig(&quot;distributed-scheduler&quot;)<br>            .setPoolSize(10)<br>            .setQueueCapacity(1000));<br>    return config;<br>}</pre><p>3. Create Scheduler Service, here we schedule a job which will execute task on leader node and distribute the task to all members.</p><pre>@Service<br>public class DistributedScheduler {<br>    @Autowired<br>    private HazelcastInstance instance;<br><br>    @Scheduled(fixedDelay = 10000, initialDelay = 60000)<br>    void startJob() {<br>        String leaderAddress = getOldestMember().getSocketAddress().toString();<br>        String currentAddress = instance.getCluster().getLocalMember().getSocketAddress().toString();<br><br>//Run the task only on leader node<br><br>        if (currentAddress.equals(leaderAddress)) {<br>            System.out.println(&quot;I am leader, use me to poll database, distribute task etc&quot;);<br>            IScheduledExecutorService scheduler = instance.getScheduledExecutorService(&quot;distributed-scheduler&quot;);<br>            scheduler.schedule(new MyScheduledTask(), 10, TimeUnit.SECONDS);<br>        }<br>    }<br><br>    private Member getOldestMember() {<br>        Cluster cluster = instance.getCluster();<br>        Member oldestMember = null;<br>        for (Member member : cluster.getMembers()) {<br>            if (oldestMember == null || member.getUuid().compareTo(oldestMember.getUuid()) &lt; 0) {<br>                oldestMember = member;<br>            }<br>        }<br>        return oldestMember;<br>    }<br><br>    static class MySchedulerJob implements Serializable, Runnable {<br>        private static final long serialVersionUID = 1L;<br><br>        @Override<br>        public void run() {<br>            System.out.println(&quot;My Task&quot;);<br>        }<br>    }<br>}</pre><p>The node that will execute the Task depends on the configuration of the Hazelcast cluster and the availability of resources at the time the task is scheduled.</p><p>In a Hazelcast cluster, all nodes are equal and any node can execute a task. When a task is scheduled using the IScheduledExecutorService, it is added to a queue and will be executed by the next available node in the cluster that has the resources to run the task.</p><p>Hazelcast automatically manages the distribution of tasks across the cluster, so you do not need to worry about manually assigning tasks to specific nodes.</p><p>Hazelcast is designed to be fault-tolerant and provide high availability for data and services in a distributed environment. Hazelcast uses a number of techniques to ensure fault tolerance, including:</p><ol><li>Data Replication: Hazelcast replicates data across multiple nodes in the cluster, so if a node fails, the data is still available on other nodes. Replication ensures that the data remains available even if some nodes go down.</li><li>Node Clustering: Hazelcast allows multiple nodes to join together to form a cluster. If a node fails, other nodes in the cluster can take over its responsibilities and ensure that the cluster remains operational.</li><li>Automatic Failover: Hazelcast automatically detects node failures and redirects requests to other available nodes in the cluster.</li><li>Quorum Rule: Hazelcast allows you to define a quorum rule to ensure that a certain number of nodes are available before operations can be executed. This helps to prevent data loss or inconsistencies in case of network partitioning or other issues.</li></ol><p>In summary, Hazelcast is designed to be fault-tolerant and provide high availability for data and services in a distributed environment. Hazelcast uses a combination of data replication, data partitioning, node clustering, automatic failover, and quorum rules to ensure that the cluster remains operational even in case of node failures or other issues.</p><h4>References</h4><ul><li><a href="https://medium.com/microservices-architecture/leader-election-using-hazelcast-b7fddd70bc0e">Leader Election using hazelcast</a></li><li><a href="https://docs.hazelcast.com/imdg/4.2/computing/scheduled-executor-service">Scheduled Executor Service</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebe1aa0b5aef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/creating-distributed-task-scheduler-using-hazelcast-ebe1aa0b5aef">Creating Distributed Task Scheduler using Hazelcast</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hazelcast with Spring Boot]]></title>
            <link>https://medium.com/microservices-architecture/hazelcast-with-spring-boot-cfeda7fab8a3?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/cfeda7fab8a3</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[hazelcast]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Sun, 09 Apr 2023 10:17:21 GMT</pubDate>
            <atom:updated>2023-04-09T10:17:21.892Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*-PRRPQglGaYwgXrMKSkkag.png" /></figure><p>Hazelcast is a distributed computation and storage platform for consistently low-latency querying, aggregation and stateful computation against event streams and traditional data sources. It allows you to quickly build resource-efficient, real-time applications. You can deploy it at any scale from small edge devices to a large cluster of cloud instances.</p><p>Add the following dependencies to your <strong>Spring Boot Server </strong>project’s pom.xml file:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;com.hazelcast&lt;/groupId&gt;<br>    &lt;artifactId&gt;hazelcast-spring&lt;/artifactId&gt;<br>    &lt;version&gt;5.0.1&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-cache&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><pre>@Configuration<br>public class HazelcastConfig {<br>    @Bean<br>    @Profile(&quot;local&quot;)<br>    public Config eurekaConfig() {<br>        var mapConfig=new MapConfig()<br>                .setName(&quot;default&quot;)<br>                .setTimeToLiveSeconds(30);<br><br>        var config = new Config();<br>        config.getNetworkConfig().setPort(5701);<br>        config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true);<br>        config.setClusterName(&quot;localhost&quot;);<br>        config.setInstanceName(&quot;localInstance&quot;);<br>        config.addMapConfig(mapConfig);<br>        return config;<br>    }<br>}</pre><p>Inside your <strong>Spring Boot Client</strong> Application add following maven dependencies and annotate the methods or classes that you want to cache with the Spring Cache annotations, for example:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;com.hazelcast&lt;/groupId&gt;<br>    &lt;artifactId&gt;hazelcast-client&lt;/artifactId&gt;<br>    &lt;version&gt;{hazelcast-version}&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;com.hazelcast&lt;/groupId&gt;<br>    &lt;artifactId&gt;hazelcast-spring&lt;/artifactId&gt;<br>    &lt;version&gt;{hazelcast-version}&lt;/version&gt;<br>&lt;/dependency&gt;<br><br>-- Other dependencies e.g. spring boot cache</pre><pre>@Bean<br>public HazelcastInstance hazelcastInstance() {<br>    ClientConfig config = new ClientConfig();<br>    config.getNetworkConfig().addAddress(&quot;remote-address&quot;);<br>    return HazelcastClient.newHazelcastClient(config);<br>}<br><br>@Configuration<br>@EnableCaching<br>public class CacheConfig extends CachingConfigurerSupport {<br><br>    @Autowired<br>    private HazelcastInstance hazelcastInstance;<br><br>    @Override<br>    public CacheManager cacheManager() {<br>        return new HazelcastCacheManager(hazelcastInstance);<br>    }<br>}<br><br>@Service<br>public class MyService {<br><br>    @Cacheable(&quot;myCache&quot;)<br>    public Object getCachedObject(String key) {<br>        // retrieve object from database or other source<br>        return object;<br>    }<br><br>    @CachePut(&quot;myCache&quot;)<br>    public void updateCachedObject(String key, Object object) {<br>        // update object in database or other source<br>    }<br><br>    @CacheEvict(&quot;myCache&quot;)<br>    public void evictCachedObject(String key) {<br>        // remove object from database or other source<br>    }<br>}</pre><p>That’s it folks!</p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfeda7fab8a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/hazelcast-with-spring-boot-cfeda7fab8a3">Hazelcast with Spring Boot</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hazelcast Cluster Setup in Kubernetes]]></title>
            <link>https://medium.com/microservices-architecture/hazelcast-cluster-setup-in-kubernetes-411ac174ea54?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/411ac174ea54</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[hazelcast]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Sun, 09 Apr 2023 08:23:55 GMT</pubDate>
            <atom:updated>2023-04-09T08:23:55.885Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*AVpT8MH13cNKIsSAxwPDRQ.png" /></figure><h4>Here we describe the general steps to set up a Hazelcast cluster in Kubernetes:</h4><ol><li>Create a Docker image with Hazelcast and your application code. You can use a Dockerfile to build the image and copy the Hazelcast configuration file and any other required files.</li><li>Create a Kubernetes deployment for the Hazelcast cluster with the Docker image you created in step 1 or you can use existing Hazelcast inside docker registry. In the deployment configuration, specify the number of replicas you want for the cluster. For example:</li></ol><h4>Hazelcast Deployment</h4><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: hazelcast-deployment<br>spec:<br>  replicas: 6<br>  selector:<br>    matchLabels:<br>      app: hazelcast<br>  template:<br>    metadata:<br>      labels:<br>        app: hazelcast<br>    spec:<br>      containers:<br>      - name: hazelcast<br>        image: your-docker-image or from publish docker registry<br>        ports:<br>        - containerPort: 5701<br>        volumeMounts:<br>        - name: hazelcast-config-volume<br>          mountPath: /opt/hazelcast/config/<br>      volumes:<br>      - name: hazelcast-config-volume<br>        configMap:<br>          name: hazelcast-config</pre><h4>Hazelcast Service</h4><p>Create a Kubernetes service to expose the Hazelcast deployment to other pods in the cluster. For example:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: hazelcast-service<br>spec:<br>  selector:<br>    app: hazelcast<br>  ports:<br>  - name: hazelcast<br>    port: 5701</pre><h4>Hazelcast Cluster Configuration</h4><p>Create a Kubernetes ConfigMap to store the Hazelcast configuration file (e.g. hazelcast.xml) .</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: hazelcast-config<br>data:<br>  hazelcast.xml: |<br>    &lt;hazelcast&gt;<br>      &lt;network&gt;<br>        &lt;join&gt;<br>          &lt;multicast enabled=&quot;false&quot; /&gt;<br>          &lt;tcp-ip enabled=&quot;true&quot;&gt;<br>            &lt;interface&gt;eth0&lt;/interface&gt;<br>            &lt;member-list&gt;<br>              &lt;member&gt;hazelcast-service.default.svc.cluster.local&lt;/member&gt;<br>            &lt;/member-list&gt;<br>          &lt;/tcp-ip&gt;<br>        &lt;/join&gt;<br>      &lt;/network&gt;<br>    &lt;/hazelcast&gt;</pre><p>In Kubernetes, eth0 is a network interface inside a container. When a container is launched, it has its own network namespace, and by default, the first network interface is named eth0. The eth0 interface is used to communicate with other containers in the same pod or with the Kubernetes cluster network.</p><p>In the context of Hazelcast, eth0 interface can be configured in the hazelcast.xml file to enable Hazelcast to communicate with other members in the cluster using the Kubernetes service IP addresses.</p><h4>Creating Cluster using Statefulset</h4><pre>apiVersion: apps/v1<br>kind: StatefulSet<br>metadata:<br>  name: hazelcast-cluster<br>spec:<br>  serviceName: hazelcast<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: hazelcast<br>  template:<br>    metadata:<br>      labels:<br>        app: hazelcast<br>    spec:<br>      containers:<br>      - name: hazelcast<br>        image: you image registry<br>        volumeMounts:<br>        - name: config<br>          mountPath: /opt/hazelcast/<br>        ports:<br>        - containerPort: 5701<br>      volumes:<br>      - name: config<br>        configMap:<br>          name: hazelcast-config<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: hazelcast<br>spec:<br>  selector:<br>    app: hazelcast<br>  clusterIP: None<br>  ports:<br>  - name: hazelcast<br>    port: 5701<br>    targetPort: 5701</pre><pre>&lt;hazelcast xmlns=&quot;http://www.hazelcast.com/schema/config&quot;<br>           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br>           xsi:schemaLocation=&quot;http://www.hazelcast.com/schema/config<br>                               http://www.hazelcast.com/schema/config/hazelcast-config-4.0.xsd&quot;&gt;<br>  &lt;network&gt;<br>    &lt;join&gt;<br>      &lt;kubernetes enabled=&quot;true&quot;<br>                   property=&quot;kubernetes-service&quot;<br>                   service-dns=&quot;hazelcast-cluster-headless&quot;<br>                   service-port=&quot;5701&quot;&gt;<br>        &lt;namespace&gt;default&lt;/namespace&gt;<br>      &lt;/kubernetes&gt;<br>    &lt;/join&gt;<br>  &lt;/network&gt;<br>&lt;/hazelcast&gt;</pre><p>If we provide a Kubernetes service as a seed node in the Hazelcast cluster, then all the pods associated with that service would be used as the initial list of members to join the cluster. This approach has some benefits such as automatic discovery of new members as pods are created or deleted, load balancing and service discovery are handled by Kubernetes.</p><p>However, there are some considerations to keep in mind. First, the service should be a headless service to ensure that each pod in the StatefulSet gets its own DNS entry, which will be used to identify each member in the cluster. Second, when using a Kubernetes service as a seed node, it is recommended to set the prefer-ip-address attribute to true in the Hazelcast configuration to ensure that the pods use the IP address instead of the hostname to communicate with each other. Finally, it&#39;s recommended to have at least three seed nodes for better fault tolerance and stability in the cluster.</p><h4>Accessing the Hazelcast Cluster from your code</h4><pre>Config config = new Config();<br>config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(&quot;hazelcast-service.default.svc.cluster.local&quot;);<br>HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);</pre><p>That’s it folks!</p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=411ac174ea54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/hazelcast-cluster-setup-in-kubernetes-411ac174ea54">Hazelcast Cluster Setup in Kubernetes</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leader Election using hazelcast]]></title>
            <link>https://medium.com/microservices-architecture/leader-election-using-hazelcast-b7fddd70bc0e?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/b7fddd70bc0e</guid>
            <category><![CDATA[leader-election]]></category>
            <category><![CDATA[consensus-algorithm]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[hazelcast]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Sat, 08 Apr 2023 15:21:48 GMT</pubDate>
            <atom:updated>2023-04-08T15:21:48.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ihh9p3DVZK4k5BT36COIg.png" /></figure><p>Hazelcast uses the Raft consensus algorithm to implement leader election in its distributed systems. In the Raft protocol, each node in the cluster can be in one of three states: leader, follower, or candidate.</p><p>The leader is responsible for managing the distributed system and making decisions, while the followers and candidates participate in the election process. When a leader fails, the remaining nodes in the cluster initiate a new leader election process.</p><p>In Hazelcast, the Raft protocol is used to elect a new leader for a partition when the current leader fails. Each partition in the cluster has a Raft group that is responsible for managing the partition’s state and electing a leader for the partition.</p><p>When a leader fails, the Raft group initiates a new leader election process. The process starts with a follower becoming a candidate and requesting votes from the other nodes in the cluster. The candidate must receive votes from a majority of the nodes in the cluster to become the new leader.</p><p>Once the candidate becomes the leader, it updates the state of the partition and begins serving requests from clients. The new leader also sends a notification to all the nodes in the cluster, informing them of the change in leadership.</p><p>Overall, the Raft consensus algorithm provides a fault-tolerant and reliable way to elect a new leader in Hazelcast’s distributed systems. By using Raft, Hazelcast ensures that the distributed system can continue to operate even when some nodes fail, without sacrificing data consistency or system availability.</p><h4>Leader Election using Lock Service</h4><pre>public class LeaderElectionExample {<br>    private static final String LOCK_NAME = &quot;leader-lock&quot;;<br><br>    public static void main(String[] args) {<br>        Config config = new Config();<br>        HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);<br><br>        FencedLockConfig lockConfig = new FencedLockConfig();<br>        lockConfig.setName(LOCK_NAME);<br>        FencedLockService lockService = hazelcastInstance.getCPSubsystem().getLockService();<br>        FencedLock lock = lockService.createFencedLock(lockConfig);<br><br>        try {<br>            lock.lock();<br><br>            // This node is now the leader, do leader-specific tasks here<br>            // Get data from database etc<br><br>        } finally {<br>            lock.unlock();<br>        }<br>    }<br>}</pre><h4>Leader election using oldest member</h4><pre><br>public class LeaderElectionExample implements MembershipListener {<br>    private HazelcastInstance hazelcastInstance;<br>    private String leaderAddress;<br><br>    public static void main(String[] args) {<br>        LeaderElectionExample example = new LeaderElectionExample();<br>        example.start();<br>    }<br><br>    public void start() {<br>        hazelcastInstance = Hazelcast.newHazelcastInstance();<br>        hazelcastInstance.getCluster().addMembershipListener(this);<br>        leaderAddress = hazelcastInstance.getCluster().getMembers().iterator().next().getSocketAddress().toString();<br><br>        if (hazelcastInstance.getCluster().getLocalMember().getSocketAddress().toString().equals(leaderAddress)) {<br>            // This node is the leader, do leader-specific tasks here<br>        } <br>    }<br><br>    @Override<br>    public void memberAdded(MembershipEvent membershipEvent) {<br>        if (membershipEvent.getMember().getSocketAddress().toString().compareTo(leaderAddress) &lt; 0) {<br>            // A new member has joined that has an older address, it becomes the new leader<br>            leaderAddress = membershipEvent.getMember().getSocketAddress().toString();<br>            if (hazelcastInstance.getCluster().getLocalMember().getSocketAddress().toString().equals(leaderAddress)) {<br>                // This node is the new leader, do leader-specific tasks here<br>            }<br>        }<br>    }<br><br>    @Override<br>    public void memberRemoved(MembershipEvent membershipEvent) {<br>        if (membershipEvent.getMember().getSocketAddress().toString().equals(leaderAddress)) {<br>            // The leader has left the cluster, a new leader will be elected<br>            leaderAddress = hazelcastInstance.getCluster().getMembers().iterator().next().getSocketAddress().toString();<br>            if (hazelcastInstance.getCluster().getLocalMember().getSocketAddress().toString().equals(leaderAddress)) {<br>                // This node is the new leader, do leader-specific tasks here<br>            }                  <br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7fddd70bc0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/leader-election-using-hazelcast-b7fddd70bc0e">Leader Election using hazelcast</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hazelcast Messaging]]></title>
            <link>https://medium.com/microservices-architecture/hazelcast-messaging-273451ec110a?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/273451ec110a</guid>
            <category><![CDATA[messaging]]></category>
            <category><![CDATA[hazelcast]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Sat, 08 Apr 2023 09:45:48 GMT</pubDate>
            <atom:updated>2023-04-08T09:45:48.314Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*kF53gzS0mFKyIQO_VDm0jg.png" /></figure><h4>What is Hazelcast Messaging</h4><p>Hazelcast messaging provides several features that make it useful for building distributed systems, including high performance, scalability, fault tolerance, and security. Hazelcast messaging can be integrated with other systems and platforms, including Spring, JMS, and Apache Camel, which makes it easy to use in a variety of contexts. Additionally, Hazelcast provides tools for monitoring and managing the messaging system, which can help to ensure that the system is running smoothly and performing as expected.</p><blockquote>Features that make it useful for building distributed systems, including high performance, scalability, fault tolerance, and security.</blockquote><p><strong>Building microservices architecture</strong>: Hazelcast messaging provides a lightweight and scalable messaging system that can be used to enable communication between microservices. By using a publish-subscribe model, Hazelcast messaging can be used to broadcast messages to multiple microservices or to specific microservices that are interested in a particular event. This can help to decouple microservices and enable them to communicate in a more flexible and reliable way.</p><p><strong>Building distributed architecture</strong>: Hazelcast messaging provides a distributed messaging system that can be used to enable communication between nodes in a cluster. By using a distributed in-memory data grid, Hazelcast messaging can provide high-speed, low-latency messaging that is fault-tolerant and scalable. This can be useful for building distributed architectures where nodes need to communicate with each other in a fast and reliable way.</p><p><strong>Building event-driven architecture</strong>: Hazelcast messaging provides a publish-subscribe model that is well-suited for building event-driven architectures. By using topics and subscriptions, Hazelcast messaging can be used to handle events in a decoupled and asynchronous way. Hazelcast messaging also provides the ability to create custom messaging patterns, which can be useful for handling complex event-driven scenarios. Additionally, Hazelcast’s in-memory data grid can provide fast access to event data, making it a good choice for real-time event processing.</p><h4>Here is an example of Hazelcast Messaging</h4><pre>public class Trader {<br>    private HazelcastInstance hazelcast;<br>    private ITopic&lt;TradeMessage&gt; tradeTopic;<br>    <br>    public Trader() {<br>        hazelcast = Hazelcast.newHazelcastInstance();<br>        tradeTopic = hazelcast.getTopic(&quot;trades&quot;);<br>    }<br>    <br>    public void trade(String symbol, int quantity, double price) {<br>        TradeMessage trade = new TradeMessage(symbol, quantity, price);<br>        tradeTopic.publish(trade);<br>    }<br>}<br><br><br>public class TradeListener implements MessageListener&lt;TradeMessage&gt; {<br>    private HazelcastInstance hazelcast;<br>    private ITopic&lt;TradeMessage&gt; tradeTopic;<br>    <br>    public TradeListener() {<br>        hazelcast = Hazelcast.newHazelcastInstance();<br>        tradeTopic = hazelcast.getTopic(&quot;trades&quot;);<br>        tradeTopic.addMessageListener(this);<br>    }<br>    <br>    public void onMessage(Message&lt;TradeMessage&gt; message) {<br>        TradeMessage trade = message.getMessageObject();<br>        System.out.println(&quot;New trade: &quot; + trade.getSymbol() + &quot; &quot; + trade.getQuantity() + &quot; @ &quot; + trade.getPrice());<br>    }<br>}</pre><h4>Kafka vs Hazelcast</h4><p>Hazelcast and Apache Kafka are popular messaging systems used for building event-driven architectures and streaming applications. However, they have some differences in terms of their architecture, features, and use cases.</p><p><strong>Architecture</strong>: Hazelcast’s messaging system is based on a distributed in-memory data grid, where messages are stored in memory across a cluster of nodes. Hazelcast provides a publish-subscribe mechanism for its messaging system, where publishers can publish messages to a specific topic, and subscribers can receive messages from that topic. On the other hand, Kafka is based on a distributed log architecture, where messages are stored in a distributed log across a cluster of brokers. Kafka provides a publish-subscribe mechanism and a point-to-point messaging mechanism, where messages can be delivered to a specific consumer.</p><p><strong>Features</strong>: Hazelcast’s messaging system provides features such as message replication, backup nodes, and automatic failover to ensure high availability and fault tolerance. It also provides security features such as SSL/TLS encryption and authentication. Kafka provides features such as high-throughput, low-latency messaging, fault tolerance, and scalability. It also provides features such as stream processing, real-time analytics, and support for various protocols and APIs.</p><p><strong>Use Cases</strong>: Hazelcast’s messaging system is well-suited for use cases where low-latency messaging and in-memory data processing are important. It can be used for building event-driven architectures, real-time analytics, and distributed caching. Kafka is well-suited for use cases where high-throughput, fault tolerance, and scalability are important. It can be used for building streaming applications, real-time data processing, and distributed messaging systems.</p><p>Overall, both Hazelcast and Kafka are powerful messaging systems that offer different features and capabilities. Hazelcast’s messaging system is focused on low-latency messaging and in-memory data processing, while Kafka is focused on high-throughput messaging and stream processing. The choice between the two depends on the specific requirements of the application and the use case.</p><h4>Hazelcast vs RabbitMQ</h4><p>Hazelcast messaging and RabbitMQ are both messaging systems, but they differ in several ways. Here’s a comparison between Hazelcast messaging and RabbitMQ:</p><ol><li>Messaging Model: Hazelcast messaging uses a publish-subscribe model, where messages are sent to a topic and any nodes that have subscribed to that topic receive the message. RabbitMQ uses a message queue model, where messages are placed in a queue and consumers read messages from the queue.</li><li>Architecture: Hazelcast messaging is built on top of an in-memory data grid and provides a distributed messaging system. RabbitMQ is built on top of an Erlang runtime and provides a standalone message broker that can be deployed on a server.</li><li>Performance: Hazelcast messaging is designed for high performance and low-latency communication between nodes in a distributed system. RabbitMQ is designed for reliable message delivery and supports various messaging protocols.</li><li>Scalability: Hazelcast messaging is designed to scale horizontally by adding more nodes to the cluster. RabbitMQ is also designed to scale horizontally, but this requires setting up a cluster of RabbitMQ brokers.</li><li>Fault Tolerance: Hazelcast messaging provides fault tolerance features such as message replication, backup nodes, and automatic failover. RabbitMQ provides features such as message acknowledgements and persistent storage to ensure reliable message delivery.</li><li>Integration: Hazelcast messaging can be integrated with other systems and platforms, including Spring, JMS, and Apache Camel. RabbitMQ also supports integration with various platforms and languages.</li></ol><p>Overall, Hazelcast messaging is best suited for real-time, high-performance, and fault-tolerant messaging systems that require low-latency communication between nodes. RabbitMQ, on the other hand, is best suited for reliable message delivery and supports various messaging protocols.</p><h4>Benefits of Using Hazelcast Messaging</h4><p>Hazelcast’s topic system provides a publish-subscribe mechanism, where publishers can publish messages to a specific topic, and subscribers can receive messages from that topic. Hazelcast’s queue system provides a point-to-point messaging mechanism, where messages are delivered to a specific consumer.</p><p>Here are some benefits of using Hazelcast for messaging:</p><ol><li>Scalability: Hazelcast’s messaging system can scale horizontally by adding more nodes to the cluster. This allows the system to handle a large number of messages and ensures that the messaging system is highly available and fault-tolerant.</li><li>Performance: Hazelcast’s in-memory data grid provides fast access to messages, which can be important in high-volume messaging scenarios.</li><li>Ease of use: Hazelcast’s messaging system is easy to use and requires minimal configuration. Developers can use Hazelcast’s Java API to send and receive messages, which makes it easy to integrate with existing Java applications.</li><li>Security: Hazelcast provides security features such as SSL/TLS encryption, authentication, and authorization, which can ensure that messages are sent and received securely.</li><li>Compatibility: Hazelcast’s messaging system is compatible with various messaging protocols, such as JMS, STOMP, and MQTT. This allows developers to use Hazelcast with a wide range of messaging clients and servers.</li><li>Integration: Hazelcast messaging can be easily integrated with other systems and platforms, including Spring, JMS, and Apache Camel.</li></ol><p>Overall, Hazelcast’s messaging system provides a powerful and flexible mechanism for building event-driven applications and messaging systems. Its scalability, performance, ease of use, security, and compatibility make it a popular choice for building distributed messaging systems.</p><h4>Traffoffs of Hazelcast Messaging</h4><p>While Hazelcast’s messaging system offers many benefits, there are also some drawbacks that should be considered. Here are some potential drawbacks of Hazelcast messaging:</p><ol><li>Fault tolerance: While Hazelcast provides fault tolerance features for its messaging system, such as message replication and backup nodes, there is still a risk of data loss if multiple nodes fail at the same time. It’s important to design a fault-tolerant architecture that can handle node failures and data loss scenarios.</li><li>Durability: Hazelcast’s messaging system is an in-memory system, which means that messages are stored in memory and may be lost if a node fails. To ensure message durability, Hazelcast provides options for persisting messages to disk, but this can add additional complexity and performance overhead.</li><li>Failure handling: When a node fails, the messaging system needs to handle the failure gracefully to ensure that messages are not lost or duplicated. Hazelcast provides features such as backup nodes and automatic failover, but it’s important to design the system to handle failure scenarios.</li><li>Complexity: Hazelcast’s messaging system can add complexity to the architecture, especially when integrating with existing messaging systems or clients. Developers need to understand the messaging system’s API, configuration options, and performance characteristics to ensure that it works effectively.</li><li>Latency: Hazelcast’s messaging system is an in-memory system, which means that it may introduce additional latency compared to disk-based messaging systems. This may not be a significant issue for low-latency messaging scenarios, but it’s important to consider the impact on overall system performance.</li></ol><p>Overall, while Hazelcast’s messaging system offers many benefits, it’s important to consider the potential drawbacks and design the system appropriately to ensure that it meets the requirements for fault tolerance, durability, and failure handling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=273451ec110a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/hazelcast-messaging-273451ec110a">Hazelcast Messaging</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices framework-Spring Cloud vs Oracle Helidon]]></title>
            <link>https://medium.com/microservices-architecture/microservices-framework-spring-cloud-vs-oracle-helidon-fc79df172a75?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc79df172a75</guid>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[helidon]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Wed, 29 Jan 2020 12:33:59 GMT</pubDate>
            <atom:updated>2020-01-30T06:50:54.070Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>Spring Cloud is simply set of modules build on top of Spring frameowk to build full stack Microservices. It has many-many modules and it keep increasing due to Spring dependency injection. Many modules are just like an adapter to integrate with tools like Consul, Prometheus, Jaeger, Kafka. whereas Helidon has two variant Helidon SE, a lightweight Microservices framework and Helidon MP build on top of Eclipse MicroProfile. Helidon also has many modules but more focused on building API.</li><li><strong>Data Management</strong> :- When it comes to maintaining data consistency in multi services environment both framework does not have inbuilt modules. Though we can use 2PC, 3PC protocols with the help of other open source projects. Both framework lack the CQRS and Event-Sourcing patterns implementation. For example Axon framework has native CQRS and Event-Driven pattern support. we can use Axon with Spring boot easily.</li><li><strong>Strategies for Handling Failure </strong>:- Both framework support circuit-breaker, easy to integrate with Resilience4J for additional features like Retry, Timeout, Rate Limiting, fallback handler, Bulkheads. Though it’s easy to build resilient services with Spring Cloud.</li><li><strong>Observability </strong>:- Both framework support health check API, tracing and metrics.</li><li><strong>Communication Style</strong> :- Both framework support synchronous and reactive style API and good support for gRPC.</li><li><strong>Integration with Tools </strong>:- Spring Cloud has far better integration and abstraction when it comes to integrating with tools like Consul, Prometheus, Jaeger, Grafana, Kafka. Spring cloud have modules for various tools and cloud services.</li><li><strong>Security </strong>:- Spring security is mature and it has plenty of options to choose from, when it comes to securing your app.</li><li><strong>Distributed config management</strong> :- Both has good support for distributed config management.</li><li><strong>Service Discovery</strong> :- Spring cloud has good support for integrating with various third party tools for both client side and server side discovery. Helidon does not have inbuilt support.</li><li><strong>Learning Curve </strong>:- Spring have so many resources on all over the internet and big community for support. But Helidon is quite new in the game and if you stuck, won’t able to find resource quickly.</li><li><strong>Testing </strong>:- Spring testing is by far better and mature and almost mock everything quickly. Helidon lack this.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc79df172a75" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/microservices-framework-spring-cloud-vs-oracle-helidon-fc79df172a75">Microservices framework-Spring Cloud vs Oracle Helidon</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 10 Microservices framework for 2020]]></title>
            <link>https://medium.com/microservices-architecture/top-10-microservices-framework-for-2020-eefb5e66d1a2?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/eefb5e66d1a2</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Thu, 23 Jan 2020 13:37:21 GMT</pubDate>
            <atom:updated>2023-04-19T09:17:37.931Z</atom:updated>
            <content:encoded><![CDATA[<h3>Top 10 Microservices frameworks for 2023</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BecK6wH23-BGDpEeeaKq8w.png" /></figure><h3>1. Spring Boot with Spring Cloud</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*aRUnth2T7XPMwCpMHrjfyQ.png" /></figure><p>Spring Boot is popular Java framework for writing Microservices. It provides various extension projects under Spring Cloud to build full stack Microservices. Spring Boot allow large scale systems to be built up by starting simple architecture from a number of collaborating components. It can be used to build small as well as large scale system. Spring boot is very easy to integrate with other popular framework also due to Inversion of Control.</p><p><strong>Data Management</strong> — Spring have various modules to easily integrate with popular databases. Spring JDBC, Spring JPA, Spring MongoDB , Spring Apache Cassandra are few extensions.</p><p><strong>Strategies for Handling Failure — </strong>Spring boot can be easily integrated with Resilience4J. It provides various functionalities to handle failure in distributed system. Circuit breakers, Retry, Timeout,Rate Limiters,fallback handler,Bulkheads etc.</p><p><strong>Observability</strong> — Spring Boot Actuator are powerful, it provides health check, view logs, Metrix.</p><p><strong>Communication Style </strong>— Spring have capabilities to build reactive app. It is super easy to build rest API with the help of Spring MVC. Spring is easy to integrate with MQ to build asynchronous style services. Spring also have module to build SOAP based application.</p><p><strong>Middle-tier Integration</strong> — With the help of various module Spring provide abstraction to integrate with Apache Kafka, any AMQP, RabbitMQ, ActiveMQ</p><p><strong>Integration with Tools </strong>— Consul, Prometheus, Jaeger, Grafana</p><p><strong>Cloud Native Support</strong> — Easy to deploy on Docker, Kubernetes, OpenTracing, Etcd, DevOps</p><p><strong>Security </strong>— Spring Security, good support for OAuth2, Session management, possible to build stateful and stateless services. key vault, Gateway patterns</p><p><strong>Distributed config management —</strong> Spring Cloud Config</p><p><strong>Service Discovery — </strong>Client Side, Server Side</p><p><strong>Performance </strong>— Catching support, Load Balancing, Clustering with Spring Cloud Cluster</p><p><strong>Communication Data Format </strong>— JSON, XML</p><p><strong>Testing </strong>— Spring Testing module, Mocking, Profiling</p><p><strong>Learning Curve</strong> — Easy to learn due to modularity</p><h3>2. Eclipse Vert.X Microservices framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RovqxSyUULpHDMxwYGXQPA.png" /></figure><p>An another popular Microservices services framework from Eclipse foundation. This frameworks supports multiple languages. So if any organization has Java and Kotlin, JavaScript developers this microservices framework should be their ideal choice. Vertx is a tool-kit for building reactive microservices runs on the JVM.</p><p>Eclipse Vert.x is event driven and non blocking. This means your app can handle a lot of concurrency using a small number of kernel threads. Vert.x lets your app scale with minimal hardware.</p><p><strong>Some of the cool features Vert.x provides</strong></p><ul><li>Vert.x is <em>lightweight</em> — Vert.x core is around 650kB in size.</li><li>Vert.x is <em>fast</em>. Here are some independent <a href="https://www.techempower.com/benchmarks/#section=data-r17&amp;hw=ph&amp;test=db">numbers</a>.</li><li>Vert.x is <em>not an application server</em>. There’s no monolithic Vert.x instance into which you deploy applications. You just run your apps wherever you want to.</li><li>Vert.x is <em>modular</em> — when you need more bits just add the bits you need and nothing more.</li><li>Vert.x is <em>simple but not simplistic</em>. Vert.x allows you to create powerful apps, simply.</li><li>Vert.x is an ideal choice for creating light-weight, high-performance, <em>microservices</em>.</li></ul><p>Vert.x offers various components/Libraries to build Microservice applications. Some of them are listed here.</p><p><strong>Vert.x Service Discovery<br></strong>This component lets you publish, lookup and bind to any type of services.</p><p><strong>Vert.x Circuit Breaker<br></strong>This component provides an implementation of the circuit breaker pattern for Vert.x</p><p><strong>Vert.x Config<br></strong>This component provides an extensible way to configure Vert.x applications.</p><p><strong>Clustering ans Scalability<br></strong>Vert.x supports clustering and HA out of the box. Cluster group management is implemented in cluster managers which are pluggable. The default cluster manager uses Hazelcast. But you have options like Apache Zookeeper,Ignite also.</p><p><strong>Observability<br></strong><em>Vert.x Health Checks</em> component provides a simple way to expose health checks. Health checks are used to express the current state of the application in very simple terms: UP or DOWN. The health checks can be used individually, or in combination to Vert.x Web or the event bus.</p><p><strong>Testing</strong><br>Vertx Unit is designed for writing asynchronous unit tests with a polyglot API and running these tests in the JVM. Vertx Unit Api borrows from existing test frameworks like JUnit or QUnit and follows the Vert.x practices.</p><p><strong>gRPC Support<br></strong>Vert.x gRPC is a module that will align the programming style of Google gRPC with Vert.x style.</p><p><strong>Service Proxies<br></strong>When you compose a Vert.x application, you may want to isolate a functionality somewhere and make it available to the rest of your application. That’s the main purpose of service proxies. It lets you expose a service on the event bus, so, any other Vert.x component can consume it.</p><p><strong>Devops<br></strong>Vert.x offers various component to keep your Vert.x application on track when running in production e.g. Micrometer, Dropwizard.</p><p>There is a big advantage of Vert.x over Spring boot is , Vert.x is Polyglot.</p><h3>3. Oracle Helidon Microservices framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*rHvGLU9m2PwQ-Mqbl27hsA.png" /></figure><p>Helidon microservices framework developed by Oracle. Helidon is a collection of Java libraries for writing microservices. There are two variant, Helidon MP and Helidon SE. If we compare Helidon with Spring Boot, Spring boot out perform many features. Helidon is quite new and not lots of documentation available at the moment and sometime hard to find solution on stackoverflow.</p><p>Helidon MP is an implementation of the MicroProfile specification. This makes it a good choice for Java EE developers.</p><p>Helidon SE is a compact toolkit that embraces the latest Java SE features: reactive streams, asynchronous and functional programming, and fluent style APIs. Helidon SE supports <a href="https://www.graalvm.org/">GraalVM</a> <a href="https://www.graalvm.org/docs/reference-manual/native-image/">native images</a> for small footprint and lightening fast startup.The REST framework for Helidon SE is the Helidon WebServer. It’s built on top of Netty and uses a straight forward request routing API.</p><p>These are few Helidon MP features to build Microservices application</p><p><strong>Cloud Native<br></strong>Helidon libraries interoperate with popular tools from the cloud-native space:</p><ul><li><a href="https://www.docker.com/">Docker</a> and Kubernetes</li><li><a href="https://prometheus.io/">Prometheus</a>, <a href="https://opentracing.io/">OpenTracing</a> and <a href="https://coreos.com/etcd/">Etcd</a></li></ul><p><strong>gRPC Support<br></strong>Helidon gRPC Server provides a framework for creating gRPC applications.</p><p><strong>Distributed Config Management<br></strong>The config component provides a Java API to load and process configuration properties in key/value form into a Config object which the application can use to retrieve config data.</p><p><strong>Health checks and Tracing<br></strong>Health checks to expose health status that is collected at regular intervals by external tooling, such as orchestrators like Kubernetes. Helidon includes support for tracing through the OpenTracing APIs. Tracing is integrated with WebServer, gRPC Server, and Security.</p><p><strong>Security<br></strong>Support Authentication , Authorization and Audit.</p><h3>4. GoMirco (Golang Microservices framework)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*QGbrMTau18iILkCK8gjkBQ.png" /><figcaption><a href="https://en.wikipedia.org/wiki/Go_(programming_language)">https://en.wikipedia.org/wiki/Go_(programming_language)</a></figcaption></figure><p>Go Micro is a pluggable RPC based library which provides the fundamental building blocks for writing microservices in Go. it implements service discovery using consul, communication via http and encoding using proto-rpc or json-rpc, Pub/Sub.</p><p>Go Micro addresses the key requirements for building scalable systems. It takes the microservice architecture pattern and transforms it into a set of tools which act as the building blocks of a platform. Micro deals with the complexity of distributed systems and provides simple abstractions already understood by developers.</p><p>Technology is constantly evolving. The infrastructure stack is always changing. Micro is a pluggable toolkit which addresses these issues. Plug in any stack or underlying technology. Build future-proof systems using micro.</p><h3>Features</h3><p>The runtime is composed of the following features:</p><ul><li><strong>API Gateway:</strong> The micro api provides powerful routing via discovery and pluggable handlers to serve http, grpc, websockets, publish events and more.</li><li><strong>Interactive CLI:</strong> The CLI gives you all the commands you expect to understand what’s happening with your micro services.</li><li><strong>Service Proxy:</strong> A transparent proxy built on <a href="https://github.com/micro/go-micro">Go Micro</a> and the <a href="https://github.com/micro/protocol">MUCP</a> protocol. Offload service discovery, load balancing, message encoding, middleware, transport and broker plugins to a single a location. Run it standalone or alongside your service.</li><li><strong>Service Templates:</strong> Generate new service templates to get started quickly. Micro provides predefined templates for writing micro services. Always start in the same way, build identical services to be more productive.</li><li><strong>SlackOps Bot:</strong> A bot which runs on your platform and lets you manage your applications from Slack itself. The micro bot enables ChatOps and gives you the ability to do everything with your team via messaging.</li><li><strong>Web Dashboard:</strong> The web dashboard allows you to explore your services, describe their endpoints, the request and response formats and even query them directly.</li></ul><h3>5. Molecular (NodeJS Microservices framework)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*jtYQQWdjyi40ZQ2-Y95wAQ.png" /></figure><p>Molecular is an interesting microservices framework. As NodeJS is becoming popular this framework is best if you are a JavaScript developer. Moleculer is a fast, modern and powerful microservices framework for NodeJS. It helps you to build efficient, reliable &amp; scalable services.</p><h4>Few Main Features</h4><ul><li>Support event-driven architecture with balancing</li><li>Built-in service registry &amp; dynamic service discovery</li><li>Load-balanced requests &amp; events (round-robin, random, cpu-usage, latency, sharding)</li><li>Many fault tolerance features (Circuit Breaker, Bulkhead, Retry, Timeout, Fallback)</li><li>Built-in caching solution (Memory, MemoryLRU, Redis)</li><li>Pluggable loggers (Console, File, Pino, Bunyan, Winston, Debug, Datadog, Log4js)</li><li>Built-in metrics feature with reporters</li><li>Built-in tracing feature with exporters (Console, Datadog, Event, Jaeger, Zipkin)</li></ul><h3>6. Quarkus Microservices framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqBAMPBSZidzUSghTjIzUQ.png" /><figcaption><a href="https://quarkus.io/blog/quarkus-has-a-new-logo/">https://quarkus.io/blog/quarkus-has-a-new-logo/</a></figcaption></figure><p>This framework is pretty new and well suited for Kubernetes lovers. Quarkus is a cloud-native, container-first framework by Red Hat for writing Java applications. Quarkus is a Kubernetes Native Java framework tailored for GraalVM and HotSpot, crafted from best-of-breed Java libraries and standards. The goal of Quarkus is to make Java a leading platform in Kubernetes and serverless environments while offering developers a unified reactive and imperative programming model to optimally address a wider range of distributed application architectures.</p><p>Read more on <a href="https://www.thoughtworks.com/radar/languages-and-frameworks/quarkus">https://www.thoughtworks.com/radar/languages-and-frameworks/quarkus</a></p><h3>7. Micronaut</h3><p>Micronaut is a modern, JVM-based, full stack microservices framework designed for building modular, easily testable microservice applications.</p><p>Micronaut is developed by the creators of the Grails framework and takes inspiration from lessons learnt over the years building real-world applications from monoliths to microservices using Spring, Spring Boot and Grails.</p><p>Micronaut aims to provide all the tools necessary to build full-featured microservice applications, including:</p><ul><li>Dependency Injection and Inversion of Control (IoC)</li><li>Sensible Defaults and Auto-Configuration</li><li>Configuration and Configuration Sharing</li><li>Service Discovery</li><li>HTTP Routing</li><li>HTTP Client with client-side load-balancing</li></ul><p>At the same time Micronaut aims to avoid the downsides of frameworks like Spring, Spring Boot and Grails by providing:</p><ul><li>Fast startup time</li><li>Reduced memory footprint</li><li>Minimal use of reflection</li><li>Minimal use of proxies</li><li>Easy unit testing</li></ul><h3>8. Lightbend Lagom Microservices framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*czgO6Ka3u5-K2OOL8rzZSw.png" /><figcaption><a href="https://academy.lightbend.com/courses/course-v1:lightbend+LLJ-HelloWorld+v1/about">https://academy.lightbend.com/courses/course-v1:lightbend+LLJ-HelloWorld+v1/about</a></figcaption></figure><p>Lagom is an open source framework for building systems of Reactive microservices in Java or Scala. Lagom builds on <a href="https://akka.io/"><strong>Akka</strong></a> and <a href="https://www.playframework.com/"><strong>Play</strong></a>, proven technologies that are in production in some of the most demanding applications today.</p><p>Lagom’s integrated development environment allows you to focus on solving business problems instead of wiring services together. A single command builds the project, starts supporting components and your microservices, as well as the Lagom infrastructure. The build hot-reloads when it detects changes to source code.</p><p>Right-sized services created with Lagom enable:</p><ul><li>better defined development responsibilities — to increase agility</li><li>more frequent releases with less risk — to improve time to market</li><li>systems with reactive qualities: responsiveness, resilience, scalability, and elasticticity — to make best use of modern computing environments and meet demanding user expectations</li></ul><h3>9. AxonIQ Microservices framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*Efn3QVyi2_T9BFolYPxxkQ.png" /><figcaption><a href="https://axoniq.io/">https://axoniq.io/</a></figcaption></figure><p>Axon provides a unified, productive way of developing Java applications that can evolve without significant refactoring from a monolith to Event-Driven microservices.</p><p>Axon includes both a programming model as well as specialized infrastructure to provide enterprise ready operational support for the programming model — especially for scaling and distributing mission critical business applications. The programming model is provided by the popular Axon Framework while Axon Server is the infrastructure part of Axon, all open sourced.</p><p>Axon Framework is a Java microservices framework that helps you build microservices architecture in-line with Domain Driven Design (DDD) principles.</p><p>Apart from DDD, Axon Framework also allows you to implement microservices patterns such as Command-Query-Responsibility-Segregation (CQRS) and Event-Driven Architecture.</p><p>Axon is ready to meet even the most demanding enterprise requirements like the most efficient scaling of event storage, security, clustering, load-balancing, service discovery, globally distributed data centers, third-party integration, metrics and monitoring.</p><h3>10. Ballerina Microservices Language</h3><p>Ballerina is not a framework, it is a distributed programming language to write distributed application. It is build from ground to write decoupled services. It is super easy to write network applications. Ballerina is an open source programming language and platform for cloud-era application programmers to easily write software that just works.</p><p>There are a lot more features like threading, streaming, security, and native support for Microservices that I haven’t addressed here.</p><p>Overall, Ballerina provides:</p><ul><li>Language constructs specifically for consuming and providing network services.</li><li>Abstractions and syntax for concurrency and network interaction that closely correspond with sequence diagrams, which enable bidirectional mapping of Ballerina source code between text and graphical representation.</li><li>A structural type system that is more flexible and allows for looser coupling than traditional statically typed languages.</li><li>Design to fit into a modern development lifecycle, including with continuous integration and continuous delivery (CI/CD) tools, such as Jenkins, Travis and Codefresh; observability tools, such as Prometheus, Zipkin and Honeycomb; and cloud orchestration systems like Kubernetes.</li></ul><pre><strong>import</strong> ballerina/http;<br><strong>import</strong> ballerina/log;</pre><pre>service hello on <strong>new</strong> http:Listener(9090) {<br>resource <strong>function</strong> sayHello(http:Caller caller, http:Request req) {<br><br>        <strong>var</strong> result = caller-&gt;respond(&quot;Say Hi to Microservices!&quot;);<br><br>    }<br>}</pre><h4>References</h4><p><a href="https://practiceoverflow.com/tag/all">https://practiceoverflow.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eefb5e66d1a2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/top-10-microservices-framework-for-2020-eefb5e66d1a2">Top 10 Microservices framework for 2020</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are the challenges in Microservices Architecture?]]></title>
            <link>https://medium.com/microservices-architecture/what-are-the-challenges-in-microservices-architecture-2ee9149cfc4e?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/2ee9149cfc4e</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Sat, 04 Jan 2020 15:40:32 GMT</pubDate>
            <atom:updated>2020-01-04T15:40:32.651Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkHiocXhkClGCDzkNBTeQQ.png" /></figure><p>Microservices architecture is great architectural patterns but it comes with some of the common challenges, as the number of services grows so does the complexity of managing services and maintaining data consistency. Testing also becomes a bottleneck due to dependency on other services.</p><h3>Data Consistency</h3><p>Even though tons of frameworks are available to develop microservices consistency is the biggest issue.</p><p>For monolith, databases are easy and natural to use ACID transactions to guarantee consistency. The ACID acronym means:</p><ul><li>Atomicity: no matter if a transaction has one, two or a hundred steps; all of them must complete successfully. Otherwise, the transaction will be rolled back;</li><li>Consistency: all data in the database must be consistent at the end of the transaction. Consistent with the integrity references, to business logic references, etc;</li><li>Isolation: one transaction can’t touch the data that is being touched by another transaction at the same time;</li><li>Durability: relates to persistence. At the end of the transaction, the data must be persistent in the database.</li></ul><p>Some challenges arise from this distributed approach to managing data. First, there may be redundancy across the data stores, with the same item of data appearing in multiple places. For example, data might be stored as part of a transaction, then stored elsewhere for analytics, reporting, or archiving. Duplicated or partitioned data can lead to issues of data integrity and consistency. When data relationships span multiple services, you can’t use traditional data management techniques to enforce the relationships.</p><h3>Distributed Tracing</h3><p>Distributed tracing refers to methods of observing requests as they propagate through distributed systems. A single trace typically shows the activity for an individual transaction or request within the application being monitored, all the way from the browser or mobile device down through to the database and back.</p><p>Finding the failure point and debugging is hard with microservices. the act of tracking down and fixing sources of errors inside microservice architectures can be tremendously more expensive and time-consuming than its counter-parts. To add to this, in most cases failure data isn’t propagated in an immediately useful or clear manner inside microservices; instead of an immediately understandable stack trace, we have to work backward from status codes and vague error messages propagated across the network.</p><p>Logging is an essential part of monitoring because you will almost never be able to replicate a bug, according to Fowler-Rigetti. The only way to know what happened is to ensure that you recorded the state of the system at that time. And the only way to do that is through proper logging.</p><h3>Network failure</h3><p>To ensure availability, the ultimate goal, the developers need to ensure that none of the ways the microservice can fail will take down the system. So developers need to know all the failure modes and have backups in case of failure occurs.</p><p>Robust resiliency testing is key to successful catastrophe preparedness, she said, including code testing, load testing, and chaos testing among other pro-active tests. Every single failure mode should be pushed into production to see how it survives.</p><h3>Operation Overhead</h3><p>Unlike a monolithic application whose deployment and management is seemingly easier due to centralized control and monitoring, a microservices-based application has numerous independent services. Managing various services is a tedious task for the operation team. This implies that significant effort is required to ensure the resilience of the developed application and avoid any failovers. Such an aspect increases its operations overhead, especially when compared to a monolithic application that can otherwise carry out similar functionality while retaining a high throughput.</p><h3>Testing</h3><p>Testing is much more complex in a microservices environment due to the different services, complex integration, and interdependencies. The testing team has to write lots of mock services even to test small units. The testing team also needs to be knowledgeable on the various services and channels of communications between services to have full coverage in their test cases. The asynchronous aspect of microservices also makes it harder to test in lower environments.</p><h3>Complex Team Communications</h3><p>As the number of services increases, effective communication required for any changes so dependent services can upgrade. This required proper documentation of API.</p><p>A microservice API is a contract between the service and its clients. You’ll be able to evolve a microservice independently only if you do not break its API contract, which is why the contract is so important. If you change the contract, it will impact your client applications or your API Gateway.</p><h3>Technical Debt</h3><p>When architects and developers build a microservices structure using different languages, individual infrastructures and launching custom scripts, the organization ends up with a huge system where there are a thousand ways to do every single thing.</p><p>It may end up with hundreds or thousands of services some of which are running, most of which are maintained, some of which are forgotten about. This is overburden for the new developer and operation team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ee9149cfc4e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/what-are-the-challenges-in-microservices-architecture-2ee9149cfc4e">What are the challenges in Microservices Architecture?</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices Architecture]]></title>
            <link>https://medium.com/microservices-architecture/microservices-architecture-7caf60fc4d37?source=rss----f77598286e9---4</link>
            <guid isPermaLink="false">https://medium.com/p/7caf60fc4d37</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[patterns]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Anil Kurmi]]></dc:creator>
            <pubDate>Fri, 20 Dec 2019 15:51:18 GMT</pubDate>
            <atom:updated>2019-12-20T15:51:18.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zGotvoM8mdzvzXDvmj1mQ.png" /></figure><p>Microservices are an architectural approach to building applications. As an architectural framework, microservices are distributed and loosely coupled, so one team’s changes won’t break the entire app. The benefit to using microservices is that development teams are able to rapidly build new components of apps to meet changing business needs.</p><p>In businesses across industries — from telecommunications and retail to financial services and manufacturing — IT teams are choosing microservices to develop new applications and break down monoliths. A collection of small services where each service implements business capabilities, a microservice runs in its own process and communicates via an HTTP API. Every microservice can be deployed, upgraded, scaled, and restarted independent of other services in the application. When managed by an automated system, teams can frequently update live applications without negatively impacting users.</p><p>Microservices (or microservices architecture) are a cloud native architectural approach in which a single application is composed of many loosely coupled and independently deployable smaller components, or services. These services typically</p><ul><li>have their own stack, inclusive of the database and data model;</li><li>communicate with one another over a combination of REST APIs, event streaming, and message brokers; and</li><li>are organized by business capability, with the line separating services often referred to as a bounded context.</li></ul><p>While much of the discussion about microservices has revolved around architectural definitions and characteristics, their value can be more commonly understood through fairly simple business and organizational benefits:</p><ul><li>Code can be updated more easily.</li><li>Teams can use different stacks for different components.</li><li>Components can be scaled independently of one another, reducing the waste and cost associated with having to scale entire applications because a single feature might be facing too much load.</li></ul><p>Microservices might also be understood by what they are <em>not</em>. The two comparisons drawn most frequently with microservices architecture are monolithic architecture and service-oriented architecture (SOA).</p><h3>Benefits of a microservices architecture?</h3><h3>Highly scalable</h3><p>As demand for certain services grows, you can deploy across multiple servers, and infrastructures, to meet your needs.</p><h3>Resilient</h3><p>These independent services, when constructed properly, do not impact one another. This means that if one piece fails, the whole app doesn’t go down, unlike the monolithic app model.</p><h3>Easy to deploy</h3><p>Because your microservice-based apps are more modular and smaller than traditional, monolithic apps, the worries that came with those deployments are negated. This requires more coordination, which a <a href="https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh">service mesh layer</a> can help with, but the payoffs can be huge.</p><h3>Accessible</h3><p>Because the larger app is broken down into smaller pieces, developers can more easily understand, update, and enhance those pieces, resulting in faster development cycles, especially when combined with agile development methodologies.</p><h3>Polyglot</h3><p>Due to the use of polyglot APIs, developers have the freedom to choose the best language and technology for the necessary function.</p><p>References</p><ol><li><a href="https://en.wikipedia.org/wiki/Microservices">https://en.wikipedia.org/wiki/Microservices</a></li><li><a href="https://www.redhat.com/en/topics/microservices/what-are-microservices">https://www.redhat.com/en/topics/microservices/what-are-microservices</a></li><li><a href="https://martinfowler.com/articles/microservices.html">https://martinfowler.com/articles/microservices.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7caf60fc4d37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-architecture/microservices-architecture-7caf60fc4d37">Microservices Architecture</a> was originally published in <a href="https://medium.com/microservices-architecture">Microservices Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>