<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ruslan Gilemzyanov on Medium]]></title>
        <description><![CDATA[Stories by Ruslan Gilemzyanov on Medium]]></description>
        <link>https://medium.com/@ruslangm?source=rss-194fc9d49e34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PxGKk-WJTg0xgjPswJO8Vg@2x.jpeg</url>
            <title>Stories by Ruslan Gilemzyanov on Medium</title>
            <link>https://medium.com/@ruslangm?source=rss-194fc9d49e34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 20:05:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ruslangm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Zero-Knowledge proofs for Blockchain scalling (pt. 1)]]></title>
            <link>https://medium.com/@ruslangm/zero-knowledge-proofs-for-blockchain-scalling-pt-1-d4f9948e2270?source=rss-194fc9d49e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4f9948e2270</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[zkrollup]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Ruslan Gilemzyanov]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 13:36:04 GMT</pubDate>
            <atom:updated>2023-06-28T15:09:54.929Z</atom:updated>
            <content:encoded><![CDATA[<p>Here is the process of executing transactions in a blockchain network (Bitcoin/Ethereum):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7F34AoYw_-ntYI7WU9d2Kg.png" /></figure><p>As seen in the last (4th) image, in the blockchain network, network nodes (or simply nodes) validate not particular transactions but blocks, which in turn include transactions. The average number of transactions per block differs for different blockchains. For example, a Bitcoin block typically contains around 3000 transactions, while an Ethereum block contains around 1500 transactions on average.</p><p>Considering that each block is validated approximately every 10 minutes, validation occurs sequentially, and each block contains 3000 transactions, simple calculations yield 5 TPS (transactions per second) for the Bitcoin network. For Ethereum, the calculation is a bit more complex due to gas costs, but empirically it has been established that the average TPS for Ethereum is around 30 TPS.</p><p>Given that blocks need to be validated sequentially (due to design features, specifically the fact that each new state is stored as the root of a Merkle Tree), it is obvious that if we want to increase the average TPS for a blockchain, we must either increase the block validation speed and/or increase the number of transactions in a single block.</p><p>However, we cannot increase the block validation speed without sacrificing decentralization or security. This issue is also known as the “<a href="https://vitalik.ca/general/2021/04/07/sharding.html">Blockchain Trilemma</a>” which states that in any given blockchain network, it is impossible to simultaneously achieve three characteristics: scalability, decentralization, and security.</p><blockquote>Therefore, the most effective way to increase the transaction throughput (TPS) in a blockchain network is to increase the number of transactions in a single block.</blockquote><p>Let’s examine the components of a typical block using the example of the Ethereum network:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9fxw2KnKo_ENV6Cx.png" /></figure><p>Let’s focus on the bottom center block labeled “Transactions trie” while disregarding all other details. As we can see, the block includes all transactions and their data, which makes sense as it is something many of us have encountered when building web services. However, experts in the field of cryptography wondered if it is possible to reduce the amount of transaction data transmitted without altering the blockchain network itself. It is evident that if we reduce the number of bytes occupied by each transaction in a block, we can theoretically include a greater number of transactions and increase the network’s throughput.</p><p>For this purpose, the well-known cryptographic technology Zero-Knowledge (ZK) came in handy. Its idea is that one party (Alice) can prove to another party (Bob) that a certain statement is true without revealing specific details that confirm the statement. Let’s consider this technology with an example.</p><p>Suppose Alice has discovered a secret word that opens magical doors in a cave. The cave is ring-shaped with an entrance on one side and a magical door blocking the opposite side. Bob wants to know if Alice knows the secret word. However, Alice does not want to disclose her knowledge (the secret word) to Victor or anyone else.</p><p>Let’s say the left path from the entrance is A, and the right path from the entrance is B. Bob waits at the entrance of the cave while Alice enters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/0*WBwswD5s_0wLITJP.png" /></figure><p>Alice chooses path A or B, and Bob cannot see which path she takes. Then Bob enters the cave and shouts a randomly chosen path for Alice to return, either A or B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/0*kL-GmUsa5-XbOY0i.png" /></figure><p>If Alice indeed knows the secret word, returning is not a problem for her. She will open the door with the magical word and return via the specified path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/0*EHlOwlZc_r6cRrZ1.png" /></figure><p>Let’s assume that Alice doesn’t know the secret word. In that case, she can only return through the same path that Bob names if she constantly randomly guesses the path he names later. If they repeat this trick, let’s say, 20 times in a row, Alice’s chance of successfully guessing the path will be approximately 1 in 2²⁰, or 9.56 × 10^-7, which is extremely small.</p><p>Therefore, if Alice appears at the exit Bob names every time, he can conclude that with a high probability Alice actually knows the secret word.</p><p>This example represents an interactive variant of interaction in Zero-Knowledge technology. However, in reality, cryptography experts have also invented a non-interactive variant of Alice and Bob’s interaction, which is of primary interest for solving our problem. This algorithm is quite nontrivial and is based on the properties of elliptic cryptography. Its main feature, regarding our problem, is that instead of including the transaction directly in the block, we will use a mathematical object called <strong>a proof</strong>, which will serve as confirmation of the transaction’s validity. Moreover, this <strong>proof</strong> will occupy fewer bytes than the original transaction, allowing us to include a greater number of transactions in a block.</p><p>This approach, utilizing Zero-Knowledge technology to include a larger number of transactions in a block, is called ZK-rollups, where “rollup” denotes the aggregation of a certain number of transactions into an object that then serves as proof of their validity.</p><p>ZK-rollups are not the only technology designed to increase the throughput of a blockchain network, but they are likely<a href="https://twitter.com/VitalikButerin/status/1433228277263462401?s=20"> the most promising and exciting at the moment</a>. Additionally, ZK-based solutions like zkSync are already being used by users on the mainnet and are capable of achieving up to 2000 TPS in the Ethereum network, which is significantly higher than the average value of 30 TPS in the Ethereum network itself.</p><p>So, in general terms, we have discussed ZK technology applied to blockchain network acceleration and discovered that its implementation promises a significant increase in throughput. However, many details are still unclear to us, such as what this solution might look like, what code needs to be written, and what needs to be done specifically to fit more transactions into one block.</p><p>To address this, in the next article, we will try to create a simple service that allows us to transfer money between wallets on the Ethereum network using Zero-Knowledge technology. Moreover, it will require minimal usage of the Solidity language and we will build our solution by using the Go programming language, utilizing a PostgreSQL database, and everything else familiar to any web developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*8t7UhCYOsM6MT3RZ1Y4D5Q.jpeg" /></figure><h3>Please leave claps if you enjoyed it! Thanks.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4f9948e2270" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Microservices with Spring Cloud Alibaba]]></title>
            <link>https://medium.com/swlh/build-microservices-with-spring-cloud-alibaba-ce191c3e2252?source=rss-194fc9d49e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce191c3e2252</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Ruslan Gilemzyanov]]></dc:creator>
            <pubDate>Mon, 27 Jan 2020 11:41:30 GMT</pubDate>
            <atom:updated>2020-01-27T21:18:42.051Z</atom:updated>
            <content:encoded><![CDATA[<p>One-stop solution for all your cloud needs.</p><p>Currently, Spring Framework and its modules is one of the most popular frameworks for development in the Java world. According to a recent developer survey conducted by JetBrains, <strong>Spring Boot</strong> has become the most popular web framework, adding 14% since last year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mj4bBE0chxbEO7cKopmvGQ.png" /></figure><p>In the Java world, there is also another trend — microservices. According to the <a href="https://www.prnewswire.com/news-releases/nearly-forty-percent-of-public-company-technology-leaders-believe-organizations-will-fail-within-three-years-if-they-dont-keep-pace-with-digital-innovation-300973246.html">survey</a> conducted by Vanson Bourne, under increasing pressure to innovate faster, a majority (84%) of organizations have embraced microservices.</p><blockquote>The vast majority of companies (84 percent) are already using microservices. Thirty percent of public companies have transitioned entirely to distributed architectures, including microservices and serverless, which is slightly more than privately held companies (28 percent). Notably, 43 percent of organizations with between 3,000 to 4,999 employees are using entirely distributed architectures.</blockquote><p>Due to the popularization of microservice architecture, tools are needed to manage microservices and solve emerging problems in distributed systems by implementing popular distributed system patterns: service discovery, distributed configuration management, circuit breaking, etc. <br>One such solution is Spring Cloud, which solves all the problems mentioned above using all of the benefits provided by Spring ecosystem. I will not cover in detail Spring Cloud (it’s a big topic itself), leaving the reader to familiarize himself with the framework in more detail <a href="https://spring.io/projects/spring-cloud">here</a>.<br>Since many of the big companies are developing their solutions for managing the microservice architecture, you can find Spring Cloud distributives from such big IT-companies as Netflix, Microsoft, Amazon. As well as Alibaba, whose solution we will dwell on in more detail in this article.</p><p><strong>Spring Cloud Alibaba</strong> currently is one of the most popular Spring Cloud implementations (if not the most popular already), which can be seen in the graph below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGgzVmnU-LErYBhKSlRvVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcxPH0KoutGhnSAITeW4LA.png" /><figcaption>Spring Cloud Alibaba section in Spring official site</figcaption></figure><h4>Requirement</h4><p>In this article, we will write two microservices that will interact with each other in the Spring Cloud Alibaba ecosystem.<br>Imagine an Enterprise Post office (yes, Enterprise with a capital letter):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RamcySOgg1eYpoU7nNehpQ.png" /><figcaption>Microservices diagram</figcaption></figure><p>PostOffice microservice will interact with PostalWorkers microservice using the <strong>Apache Dubbo</strong> RPC-based framework for communication, <strong>Nacos</strong> for service discovery and <strong>Sentinel</strong> for throttling configuration and circuit breaking pattern implementation.</p><h4>PostalWorker service</h4><p>We’ll define a simple PostalWorker interface, which only has one method deliverParcel by trackNumber .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3ce05263005e0eeb089f46a65fec6f7/href">https://medium.com/media/e3ce05263005e0eeb089f46a65fec6f7/href</a></iframe><p>And the client will call the PostOffice interface, which also only has one method pickupParcel by the same trackNumber. For ease of implementation, in this example, the “real client” will call PostOffice via HTTP and in the rest of this article, we will refer to PostalWorker as the server and PostOffice as the client, because technically, they will be composed of each other with a client-server relationship.</p><p>Let’s implement the PostalWorker interface and annotate it with Dubbo annotation @Service which means the same as Service annotation in Spring Boot.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbbbfbe217e8bb798de1cca854dd583c/href">https://medium.com/media/bbbbfbe217e8bb798de1cca854dd583c/href</a></iframe><p>PostalWorker YAML configuration (application.service.version property describes version of our service which is also one of the great features in Dubbo):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/159e3a5f10132b2b4657d7beb39f63db/href">https://medium.com/media/159e3a5f10132b2b4657d7beb39f63db/href</a></iframe><p>Code for server-side service start:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1694d2b2b925ebd9aeb86b1858a9435/href">https://medium.com/media/c1694d2b2b925ebd9aeb86b1858a9435/href</a></iframe><p>Now let’s write the client side.</p><h4>PostOffice service</h4><p>Use @Reference to annotate PostalWorker as the remote service:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54c43caae0a90fc8b90c00ac744139e6/href">https://medium.com/media/54c43caae0a90fc8b90c00ac744139e6/href</a></iframe><p>PostOffice configuration:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3b26393f904b124882f6aaccc3cabf0/href">https://medium.com/media/d3b26393f904b124882f6aaccc3cabf0/href</a></iframe><p>Code for client-side start logic:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8a567d84c103b011d744fe089a2c614/href">https://medium.com/media/a8a567d84c103b011d744fe089a2c614/href</a></iframe><p>So we created and configured our client and server. But they cannot be initialized yet, because they need to be registered in the configuration center and be able to be found through service discovery.</p><h4>Nacos</h4><p>As already mentioned, for this purpose we will use Nacos, dynamic service discovery, configuration and service management platform for building cloud-native applications in Spring Cloud Alibaba ecosystem. <br>We will use it in out example mainly for its support for services to register themselves and to discover other services via a DNS or HTTP interface and also for its ability of real-time healthchecks of services.</p><p>So let’s change our diagram to include Nacos service discovery abilities that it brings with itself:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BhZ0kxO3jlVT0OL8FHh4tw.png" /><figcaption>Interaction of consuming-providing model with naming server included</figcaption></figure><p>Let’s start Nacos server by using simple command:</p><pre>sh ./bin/startup.sh -m standalone</pre><p>where standalone means non-cluster mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WugvSnIcKDTOGh1VpE2Lag.png" /><figcaption>Nacos start log</figcaption></figure><p>Now let’s start our microservices:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jIAW0RQRP57X4uHqWxVBWw.png" /><figcaption>Registration and subscription confirmation log</figcaption></figure><p>By visiting localhost:8848/nacos we can see our successfully registered microservices in Nacos console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BNK7Iw4i82_DO2aBYT_1og.png" /><figcaption>Registered services in Nacos console</figcaption></figure><p>Actually, there are a lot of more things that you can do with Nacos console but I will not focus on this in the article. You can find all the information on <a href="https://nacos.io/en-us/">Nacos official web-site</a>.</p><p>Because we made an agreement in the beginning of the article that for testing purposes our PostOffice service will be called via HTTP, let’s test our current functionality in the browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*17WlO10VO25yENGUPS19cA.png" /><figcaption>Testing of our microservices</figcaption></figure><h4>Sentinel</h4><p>So, our microservices work successfully and we also monitor them successfully. An inexperienced reader may ask: what could go wrong? Almost anything. There are a lot of things that can go wrong in the microservices world. For example, one of your microservices may quit unexpectedly or lose the network or could not be able to handle high loads. To deal with such situations in Alibaba was developed <strong>Sentinel</strong> which ensure flow control, circuit breaking and system adaptive protection, to guarantee the reliability of microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z8zlf8UF166qD65d.png" /><figcaption>Sentinel place in a cloud-native world</figcaption></figure><p>Let’s start Sentinel and check our microservices in the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s4tpSE9B73w73fQB98beqA.png" /><figcaption>Sentinel web console</figcaption></figure><p>You can see that there are numerous options to configure your application rules. Let’s use one of them — <strong>Flow control rule</strong>. We will create a new resource with name postal_worker and configure its threshold by the number of QPS (queries per second). For testing purposes, we will put value 1 which means that only 1 QPS is allowed (our postal workers are too lazy).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LORQJsi8PBtt1-qYaN8j5A.png" /><figcaption>Add new flow control rule for postal_worker microservice</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YucePU9zZpUl0H1dJffYrQ.png" /><figcaption>Configured flow control rules panel</figcaption></figure><p>But that’s not all. We need to rewrite our service to successfully support the Sentinel ability to control requests flow.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/672ac2bb19079670ad2dc5639d15596b/href">https://medium.com/media/672ac2bb19079670ad2dc5639d15596b/href</a></iframe><p>Therefore we are providing a fallback method for our microservice that is responding to a user to take a look at some suggestions if our single postal worker is busy.</p><p>Let’s test our functionality by sending two requests simultaneously in the same second:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*siwdK_KsecvHl9wzcSuPLg.png" /></figure><p>For more complicated scenarios Sentinel also provides a simple dashboard, on which you can monitor the clients in real-time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDXbUXqDGeaQxZjH5SjLQw.png" /><figcaption>Sentinel dashboard for real-time monitoring</figcaption></figure><h4>Summary</h4><p><strong>Spring Cloud Alibaba</strong> is gaining popularity among Java developers and the Spring community. It’s a good time to get acquainted with cloud frameworks from such a big company as Alibaba whose technical solutions are serving millions of users daily.</p><h3>Thank you for reading! I hope you enjoyed it.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce191c3e2252" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/build-microservices-with-spring-cloud-alibaba-ce191c3e2252">Build Microservices with Spring Cloud Alibaba</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>