Welcome to curated list of handpicked free online resources related to IT, cloud, Big Data, programming languages, Devops. Fresh news and community maintained list of links updated daily. Like what you see? [ Join our newsletter ]

What I wish I knew when learning F#

Categories

Tags leadership-and-career software-engineering frontend-and-mobile product-and-design

I’ve used F# a lot in the last 3 years and for quite some time I wanted to collect a few good starting points to venture into F# in one place. I also wanted to collect some of those random things that I felt weren’t easily available anywhere because they fall through the cracks of the official language reference and library documentation. By Justine Kavanaugh-Brown.

The article then describes:

  • Why would I want to use F#?
  • Why would I not want to use F#?
  • How am I supposed to be writing this?
  • Debugging and the REPL
  • The standard library
  • Code formatting
  • Packaging
  • Testing

Worth a special mention is the SAFE stack. This is a preconfigured template that sets up F# on the backend (using ASP.NET core via either the straight forward Giraffe library or the more opinionated Saturn library), and on the frontend (using Fable 2 as of late 2020). The SAFE template can either be used in a barebones configuration or in a more opinionated, fully fledged version that comes with frontend and backend testing libraries, Bulma preselected as a style framework, a choice of type safe automated communication between frontend and backend and so forth. Good read for anybody who wants to learn Fsharp!

[Read More]

Gavin Bierman explains pattern matching for switch, a Java 17 preview

Categories

Tags backend-development frontend-and-mobile product-and-design

Pattern matching for switch follows logically from pattern matching for instanceof, which was delivered as part of JDK 16. By Justine Kavanaugh-Brown.

A pattern is something you can test a value against. A value will either match a pattern or not match a pattern. If a value matches the specified pattern, the pattern variable is initialized with the value it matched.

The pattern itself can contain holes because you don’t want to specify all the details of every part of the value. So, sometimes a developer puts placeholders in certain places within the pattern. We use variables to represent those holes. We call them pattern variables, but they’re really just local variables.

Prior to JEP 406, switch had a very important design feature: It threw a null pointer exception if the value of the selector expression was null—without looking at any of the body of the switch block. Null simply wasn’t permitted as an option. Now that we’re enhancing switch to do pattern matching and more-complicated things coming in the future, forbidding null seems like an unsustainable design decision.

static String formatterPatternSwitch(Object o) {
    return switch (o) {
        case Integer i -> String.format("int %d", i);
        case Long l    -> String.format("long %d", l);
        case Double d  -> String.format("double %f", d);
        case String s  -> String.format("String %s", s);
        default        -> o.toString();
    };
}

This is the next step in pattern matching for Java, where patterns are not just solely asking about types but rather do more work by deconstructing the value for you. Good read!

[Read More]

Apache Kafka in the public sector – Smart city

Categories

Tags business-and-emerging-tech data-and-analytics devops-and-ci-cd how-to

The public sector includes many different areas. Some groups leverage cutting-edge technology, like military leverage. Others like the public administration are years or even decades behind. This blog series explores both edges to show how data in motion powered by Apache Kafka adds value for innovative new applications and modernizing legacy IT infrastructures. By Kai Waehner.

The article also contains information on:

  • Real-time is mandatory for a smart city everywhere
  • Low latency and 5G networks for (some) data streaming use cases
  • Collaboration between government, city, and 3rd party via Open API
  • Data in motion with Kafka for a connected and innovative smart city

Smart City is a vast topic. Many stakeholders are involved. Collaboration and Open APIs are critical for success. In most cases, governments work together with telco providers, infrastructure providers such as the cloud hyperscalers, and software vendors (including an event streaming platform like Kafka). Most valuable and innovative smart city use cases require data processing in real-time. The use cases require data integration, storage, and backpressure handling, and data correlation. Event Streaming is the ideal technology for these use cases. Good read!

[Read More]

Rate limiting with HAProxy Kubernetes Ingress controller

Categories

Tags devops-and-ci-cd cloud-and-infrastructure leadership-and-career software-engineering

DDoS (distributed denial of service) events occur when an attacker or group of attackers flood your application or API with disruptive traffic, hoping to exhaust its resources and prevent it from functioning properly. Bots and scrapers, too, can misbehave, making far more requests than is reasonable. By Jim O’Connell.

In this blog, we cover several ways that you can use overall rate limiting to mitigate the effects of these kinds of events, but the HAProxy Kubernetes Ingress Controller offers even more fine-grained control to fend off DDoS attacks using several annotations that can help you build a powerful first line of defense on an IP-by-IP basis.

The article then describes following together with code examples:

  • Rate limit requests
  • Rate limit period
  • Custom status codes
  • Rate limit size

The most important annotation to understand is rate-limit-requests. This setting is an integer that defines the maximum number of requests that will be accepted from a source IP address during the rate-limit-period, which defaults to one second.


apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: web-ingress
namespace: default
annotations:
  haproxy.org/rate-limit-requests: 10

By adding this annotation to your config, any single IP address is limited to 10 requests per second, after which their requests would be denied with a 403 status code. And more examples in the article. Very good read!

[Read More]

Everything I learned in my 1st year as a SWE: GraphQL

Categories

Tags devops-and-ci-cd cloud-and-infrastructure data-and-analytics

A beginner’s crash course in GraphQL & REST APIs. In this series, I’ll be sharing all the tools and technologies that I’ve picked up in my first year in the hopes of helping other entry-level engineers on their journey. By Camila Ramos.

You tell GraphQL how to come up with the answers to your query. In the schema, you’ve defined what type of each field’s response will be, but the resolvers are where you tell GraphQL how to come up with your data.

In this post author is hoping to answer the following questions:

  • What is an API and how are they used?
  • What is a REST API?
  • The five major problems with REST APIs
    • Rigid endpoints
    • Overfetching
    • Underfetching
    • Multiple requests
    • No idea what the response will be
  • What is GraphQL & why is it used as an alternative to REST?

GraphQL is a query language for your API that allows you to fetch data declaratively - AKA you can tell it exactly what data you want, and it’ll return just that. No more, no less. Instead of working with rigid endpoints that are predefined for you, you can write custom queries to receive the data you need. The GraphQL equivalent to GET is a query, and a mutation is the equivalent to POST, PUT, DELETE, or PATCH. Good read!

[Read More]

Investigate Node.js high CPU issue in Linux app service

Categories

Tags cloud-and-infrastructure backend-development software-engineering product-and-design

When running your Node.js application in Azure Linux App Service, you may encounter High CPU consumption issue. By Hanli_Ren.

v8-profiler-node8 is one of the tools that can help us profile the CPU usage of a Node.js application. Normally, we need to explicitly insert code to control where to start and stop profiling in the application code. But for complex applications running in production mode, it’s hard to decide at which position of the code to start/stop profiling. Also, it will generate too many profiler result files if we continuously profiling a running App Service.

The article provides practical information on:

  • How to install and inject v8 CPU profiler in your Node.js application code
  • How to capture CPU profiler dump in Linux App Service
  • How to use Google Chrome Developer tools to analyze the profiler file

Together with bunch of screenshots and code examples so you can debug successfully. Good read!

[Read More]

Kubeflow fundamentals: Distributions and installations

Categories

Tags devops-and-ci-cd cloud-and-infrastructure ai-and-machine-learning

The aim of the series is to walk you through a detailed introduction of Kubeflow, a deep-dive into the various components and how they all come together to deliver a complete MLOps platform. By Jimmy Guerrero.

In this post we’ll take a look at the different Kubeflow distributions that are available and walk you through some installations using MiniKF:

  • Installing Kubeflow
  • Packaged Kubeflow Distributions
  • Other Platforms with Kubeflow Packaged Distributions

For the purposes of this blog we are going to focus on getting up and running with MiniKF. Why?

  • MiniKF is the easiest distribution to get started with, even for folks with limited Kubernetes experience
  • MiniKF is cross platform. It runs on AWS, GCP and even locally via Vagrant
  • MiniKF comes with prebundled add-ons like Kale and Rok that make it much easier to build pipelines and manage data then the basic Kubeflow distribution offers

You will find video tutorials which will walk you through installation steps on various platforms. Nice one!

[Read More]

Postgres full-text search: Search engine in a database

Categories

Tags data-and-analytics business-and-emerging-tech architecture-and-apis cloud-and-infrastructure backend-development

So when we say PostgreSQL is the “batteries included database,” this is just one reason why. With Postgres, you don’t need to immediately look farther than your own database management system for a full-text search solution. If you haven’t yet given Postgres’ built-in full-text search a try, read on for a simple intro. By Kat Batuigas.

The article describes:

  • Postgres full-text search basics for the uninitiated
  • Example: Searching storm event details
  • Functions for weighting and ranking search results

You can get even deeper and make your Postgres full-text search even more robust, by implementing features such as highlighting results, or writing your own custom dictionaries or functions. You could also look into enabling extensions such as unaccent (remove diacritic signs from lexemes) or pg_trgm (for fuzzy search). Speaking of extensions, those were just two of the extensions supported in Crunchy Bridge. We’ve built our managed cloud Postgres service such that you can dive right in and take advantage of all these Postgres features. Good read with SQL query and code exmaples!

[Read More]

Distributed transaction patterns for microservices compared

Categories

Tags leadership-and-career devops-and-ci-cd architecture-and-apis

One thing most customers want to know is how to coordinate writes to more than one system of record. Answering this question typically involves a long explanation of dual writes, distributed transactions, modern alternatives, and the possible failure scenarios and drawbacks of each approach. By Bilgin Ibryam.

The single indicator that you may have a dual write problem is the need to write to more than one system of record predictably. This requirement might not be obvious and it can express itself in different ways in the distributed systems design process.

The article then walks you through:

  • The dual write problem
  • The modular monolith
  • Orchestration architecture
  • Choreography pattern
  • Parallel pipelines pattern
  • How to choose a distributed transactions strategy

Levels of code and data isolation for applications

Source @https://developers.redhat.com: https://developers.redhat.com/articles/2021/09/21/distributed-transaction-patterns-microservices-compared#the_modular_monolith

Each pattern is explained from architecture, benefits and drawback points of view. In a sizable distributed system with tens of services, there won’t be a single approach that works for all, but a few of these combined and applied for different contexts. You might have a few services deployed on a shared runtime for exceptional requirements around data consistency. You might choose a two-phase commit for integration with a legacy system that supports JTA. You might orchestrate a complex business process, and also use choreography and parallel processing for the rest of the services. In the end, it doesn’t matter what strategy you pick; what matters is choosing a strategy deliberately for the right reasons, and executing it. Excellent read!

[Read More]

Anthos service mesh

Categories

Tags product-and-design devops-and-ci-cd architecture-and-apis

Over the course of this series, we are going to cover various topics associated with Google Cloud’s Anthos. The series will involve conceptual understanding supplemented by practical tutorials for you to get up to speed on what some consider a revolutionary piece of technology. By Alfred Tommy.

When you have a microservices based architecture, it proves challenging to manage these individual services. For example, you may want to authenticate/authorise requests between services, you would probably like to get some observability on the network traffic between services, you may even want to split traffic between services. All this and more can be achieved with a service mesh.

Anthos actually comprises of a suite of services, the key ones being:

  • Infrastructure management
  • Container management and orchestration
  • Service management
  • Policy enforcement

The article then explains in detail installing Anthos Service Mesh with a Google Managed Control Plane. Plenty of screenshots and command line exmaples will get you going. Nice one!

[Read More]