<?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 Marc Albert on Medium]]></title>
        <description><![CDATA[Stories by Marc Albert on Medium]]></description>
        <link>https://medium.com/@marcalbert90?source=rss-5faf6efad850------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*13NBeCQa04mq8bvaz3zCAw.jpeg</url>
            <title>Stories by Marc Albert on Medium</title>
            <link>https://medium.com/@marcalbert90?source=rss-5faf6efad850------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:38:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcalbert90/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[JSON Web Signature -Detached approach]]></title>
            <link>https://medium.com/@marcalbert90/json-web-signature-detached-approach-484f6afe7a68?source=rss-5faf6efad850------2</link>
            <guid isPermaLink="false">https://medium.com/p/484f6afe7a68</guid>
            <dc:creator><![CDATA[Marc Albert]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 09:57:50 GMT</pubDate>
            <atom:updated>2023-02-08T10:23:23.707Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*HsTKfpv9fOq8EgGWUiJhNg.jpeg" /></figure><p>When it comes to payment transactions integrations, a good application encryption layer is a must.</p><p>The JSON Web Signature (<a href="https://tools.ietf.org/html/rfc7515">RFC7515</a>) standard describes the process of creation and validation of a data structure representing a signed payload.</p><p>Every request being sent from client to server should be signed and added in “x-jws-signature” header for example as well as for server responses returned to client.</p><p>If someone tries to intercept the request and change the amount being sent in the payload, this will result into encryption validation failure at the server side. On the other hand, if just replication for the request will take place then this should result in idempotent behavior as the request identifier has not changed and will give the same result as the original transaction without real execution/charging.</p><h3><strong>Decomposition </strong>of standard JWS</h3><p>- JWS string is a string composed of three components separated by “.”</p><p>- base64UrlEncode(Header) + ‘.’ + base64UrlEncode(Payload) + ‘.’ + base64UrlEncode(JSONWebSignature)</p><p>- The header contains information such as the algorithm used and the payload is the value that requires integrity protection.</p><p>- The JSON web signature is simply the first two parts hashed with a secret/private key, thus allowing any other party to validate the payload.</p><p>- JSONWebSignature = hashed( base64UrlEncode(header) + “.” +base64UrlEncode(payload), secret)</p><h3>Implementing the detached approach</h3><p>- The fundamentals of encoding and decoding JWS still remains in this approach with the exception where the payload is removed from the JWS token.</p><p>- By manipulating the input/output (request/response payload), we will be able to extract the detached JWS.</p><p>- base64UrlEncode(Header) + ‘.’ + base64UrlEncode(JSONWebSignature)</p><ul><li>JSONWebSignature = hashed( base64UrlEncode(header) + “.” +base64UrlEncode(payload), secret)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=484f6afe7a68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improve API Performance]]></title>
            <link>https://medium.com/@marcalbert90/improve-api-performance-e14c56da6822?source=rss-5faf6efad850------2</link>
            <guid isPermaLink="false">https://medium.com/p/e14c56da6822</guid>
            <dc:creator><![CDATA[Marc Albert]]></dc:creator>
            <pubDate>Fri, 03 Feb 2023 20:53:17 GMT</pubDate>
            <atom:updated>2023-02-05T07:06:37.780Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NpinlMFw1ILEELCIMHAkCg.png" /></figure><p>Generally APIs that are considered high-performing have an average response time between 0.1 and one second<strong>, </strong>experiencing spikes or high response time in general in your APIs specially high traffic applications/integrations with SLA would be very annoying.</p><p>The below 6 points are to be considered whenever API’s performance issues are being investigated;</p><h3>Network Latency</h3><p>Distance between the device/client sending the request and the server is a prime cause of network latency. Cross-regions round trips network latency are relatively high so if you are having multiple components that are integrating with each other, make sure they are hosted in the same region to minimize latency as much as possible.</p><h3>Redis Setup</h3><p>Since Redis is a popular choice for caching so it is worth mentioning to host redis on a high network bandwidth and register its connection as singleton in you application, it is thread safe.</p><h3>Database Connection</h3><p>Establishing a database connection takes multiple network round trips to and from the server. Introducing connection pooling and increasing minimum pool size will guarantee keeping ready connections to serve incoming requests as creating new ones is performance-expensive compared to all other tasks.</p><h3>DbContext Pooling</h3><p>If you are using entity framework core in your application then you should be aware that each db context instance does set up various internal services and objects necessary for performing its duties, and the overhead of continuously doing so may be significant in high-performance scenarios. For these cases use AddDbContextPool so EFCore can pool your context instances.</p><h3>Autoscaling</h3><p>Introduce Autoscaling along with specifying minimum and maximum number of nodes for your APIs’ server so that it can be scaled down or up for the current workload. Always keep an eye on your infrastructure CPU and Memory metrics.</p><h3>Dependency Injection</h3><p>If your controller has multiple APIs and many services, injecting services as method injection would be more convenient in this case to not load useless dependencies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e14c56da6822" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud infrastructure cost reduction]]></title>
            <link>https://medium.com/@marcalbert90/cloud-infrastructure-cost-reduction-c2a0d06c459f?source=rss-5faf6efad850------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2a0d06c459f</guid>
            <dc:creator><![CDATA[Marc Albert]]></dc:creator>
            <pubDate>Wed, 01 Feb 2023 09:56:58 GMT</pubDate>
            <atom:updated>2023-02-01T10:17:52.661Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you keeping an eye on your cloud infrastructure cost?</p><p>Azure cost analysis can help you view aggregated expenses, determine where expenditures are incurred, and spot trends in Azure spending.</p><p>Last quarter, we have decided to focus on reducing our cloud bill.<br>I will write below main highlights we followed/applied in order to reach 45% reduction monthly for both development and production hosting;</p><p>- Revisiting storage accounts access tiers and retention policy. High volume of files on cloud storage might be remaining for a long period of time on hot tier. Make sure to move those to either Cool or Archive tiers and update your retention policy.</p><p>- Choosing the right pricing plan for Defender for cloud. You could be charged 2$ for every 1 million transactions cloud defender is analyzing to protect your files vs 0.149$ for every 1 million based on the plan you choose which best fit your needs (Note: there’s some hidden cost still)</p><p>If no sensitive data are stored you could disable cloud defender and capitalize on IP whitelisting. Anyway IP whitelisting is recommended.</p><p>- Application insights charges around 2.99$ for every ingested GB. Cost optimization can be done by applying daily cap, reduce data retention period or reduce sampling rate (adaptive or fixed). Or else, go for another cheaper monitoring tool (ex: 0.1$ for every 1 GB)</p><p>- Manage development environments by moving some to shared infrastructure that could be free of charge or at low cost. Dev environments that are no longer in use (no development for new features) could be deleted and recreated in a couple of seconds whenever needed back again.</p><p>- Azure functions, logic apps and API management are really great. But its very important to make sure their features are really needed and aware of their cost.</p><p>- Make use of free resources on kubernetes cluster (if any) and move apps instead of paying for multiple app services.</p><p>- Make sure cloud resources are well/fully utilized.</p><p>Demo image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*aGaMSyp3LBJ03qMQ" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2a0d06c459f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>