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 ]

Handling slow queries in MongoDB: Investigation

Categories

Tags nosql miscellaneous performance devops software-architecture

Article by Justin Liu about one of the most essential factors of performance in any application – latency. Faster application response times have been proven to increase user interaction and engagement as systems appear more natural and fluid with lower latencies.

In this blog, we’ll explore a few key ways to understand and address slow queries in MongoDB. We’ll also take a look at some strategies on how to mitigate issues like these from arising in the future.

The MongoDB Database Profiler is a built-in profiler which collects detailed information (including all CRUD operations and configuration changes) about what operations the database took while executing each your queries and why it chose them. It then stores all of this information inside a capped system collection in the admin database which you can query at anytime.

The article then describes in some detail:

  • Identifying Slow Queries using the Database Profiler
  • Configuring the Database Profiler
  • Analyzing Performance Using the Database Profiler
  • Breaking Down & Understanding Slow Queries
  • Understanding and Evaluating Query Execution Plans

Often times, the only way to tackle bottlenecks is by helping “hint” the database into selecting a better query execution strategy or covering index by rewriting your queries (e.g. using derived tables instead of subqueries or replacing costly window functions). Great read!

[Read More]

Working with an internet connection on iOS with Swift: Best practices

Categories

Tags swiftlang web-development app-development how-to

Networking is an integral part of most iOS applications. A common network-related task is Internet connectivity detection. Written by Vadim Bulavin.

The most popular answers on how to detect network connectivity status on iOS suggest using SCNetworkReachability. In this article, let’s discuss why this solution is less than optimal, and lay out best practices of working with the Internet connection recommended by Apple. Apple says that we should not check Internet connection before firing an HTTP request.

The article’s content is split into this parts:

  • Checking connectivity before firing an HTTP request
  • Disabling or enabling app features based on network connectivity status
  • Attaching constraints to network operations, e.g., disabling large file download via cellular

We liked: Do not enable or disable app features based on an Internet connection. Instead, indicate connectivity status on UI, and diagnose network errors. Great read!

[Read More]

Generating TypeScript types and React Hooks based on GraphQL endpoint

Categories

Tags react web-development javascript app-development

Autogenerate Typescript types and custom React hooks in React applications with GraphQL Code Generator. Danilo Woznica.

Developing ReactJS with TypeScript, it still requires a considerable effort to write types and keep them maintainable. Moreover, when the data provider is a GraphQL server, it makes you feel like you’re doing a useless job, given the server already has its own schemas for types. Seems redundant, right?

GraphQL Code Generator gives us the ability to generate TypesScript typing out of GraphQL schemas. Beyond that, it gives us a couple of plugins to create custom React hooks that don’t require any kind of maintenance or workaround to fit into your application.

Among many others, some of the benefits of using this tool:

  • Codeless: forget about creating the interfaces/types for every GraphQL endpoints; save time and spend effort on what matters
  • Development experience: as a result of having the types always available, your editor will provide meaningful autocomplete and error checking
  • Types always up-to-date: if your GraphQL endpoint schemas change, your application will be updated and typescript will help you make sure you make the necessary changes

For learning more follow the link to the full article. You will also get code explanation and link to the code repository. Nice one!

[Read More]

What GoogleBot is doing to shopping carts... and why

Categories

Tags search web-development miscellaneous servers google

GoogleBot can add products to shopping carts. But it’s only happening to these specific merchants. By Roger Montti.

Contrary to common impressions about this topic, Google isn’t crawling and adding products to random shopping carts. What’s really going on is that merchants who participate in Google Shopping (or Google’s back-end for sellers the Merchant Center and Shopping ads) agree to have their sites crawled, including their shopping cart.

Examples of issues Google is checking for are:

  • Failure to clearly and conspicuously disclose the payment model and full expense that a user will bear before and after purchase
  • Failure to clearly and conspicuously disclose all related conditions before and after purchase
  • Promising products or promotional offers that aren’t available for users
  • Making false statements about your identity, qualifications, or the promoted product (such as falsely claiming to be a certified reseller or using a brand name to promote another product)
  • Using false claims or claims that entice the user with an improbable result (even if this result is possible) as the likely outcome that a user can expect
  • Falsely implying affiliation with, or endorsement by, another individual, organization, product, or service

Very insightful for anybody working in e-commerce. Recommended read!

[Read More]

Symfony messenger with SQS and SNS aws-services

Categories

Tags queues php distributed miscellaneous performance streaming

Let’ checkout how to connect Symfony with Amazon SQS and SNS Services by using a Symfony component. By Stefan Pöltl.

We are going to use a Command-Bus pattern that separates the description, what needs to be done, from where it’s going to happen. It’s like getting an order in a restaurant that gets prepared in the kitchen. In our case we will create a TestMessage object, that gets send and consumed by a handler.

What is the Symfony Messenger? It’s a Message-Bus that can be used for the following design patterns:

  • Command-Bus
  • Query-Bus
  • Event-Bus

The article then describes in great detail and provides code plus screen shots for:

  • Setup the Symfony project
  • Create a SQS queue in your AWS account
  • How to create the queue
  • Configure the Symfony project
  • Build a command to send data to the SQS queue
  • Debug Messages in SQS
  • Consume Queue Messages and send notifications with SNS

… and much more. The article also explains many concpets, i.e.what is SnsClient, what is SQS, message limitations etc. Good read!

[Read More]

Here's how to use Istio with other Nginx ingress proxies

Categories

Tags kubernetes containers devops performance nginx

It’s been a common problem that we’ve been asked to address, and something that pops up frequently. Can I use Istio with other ingress proxies? In a word? Yes. Written by Tetrate.

A persistent issue for many engineers wanting to adopt Istio has been that they want to make use of the numerous benefits that it can provide, including its ability to solve telemetry issues, security and transport problems, as well as policy concerns all in one place, but redesigning their entire service to fit with their hopes for the mesh, they need aspects of the mesh to fit in with them.

Ingress outside of application namespace

Source: https://www.tetrate.io/blog/using-istio-with-other-ingress-proxies/

The common method has been to run the ingress proxy with an Istio sidecar, which can handle certificates/identity from Citadel and perform mTLS into the mesh.

The article then contains information about how to configure this in three simple ways. You will get all the code required with detailed explanation how to do it. Nice one!

[Read More]

Beyond the Sandbox: Signing and distributing macOS apps outside of the Mac App Store

Categories

Tags swiftlang app-development web-development learning how-to

Since the advent of OS X Mojave and especially Catalina and the requirement for app notarization, some of us old-time macOS developers are concerned that Apple will pull the plug on the apps that we distribute ourselves. Many of you have downloaded and installed macOS software directly from websites, i.e., not from the Mac App Store. Have you ever really considered it? By Andrew Jaffee.

This is the first part in a three-part series of tutorials on sandboxing, signing, notarizing, and and distributing macOS apps outside of the Mac App Store. In this tutorial, we’ll build a non-sandboxed app, talk about certificates, sign the app, notarize it, briefly talk about building an installer, sign and notarize the installer, and finally cover distribution. In the second tutorial in this series, we’ll turn the sandboxing capability and entitlement on in my sample app and explore ways that users can still gain access to files and folders outside of the app’s container.

The article is split into:

  • A series of tutorials
  • Advantages of staying out of the Mac App Store
  • What is Gatekeeper and notarization?
  • My sample code
  • App signing and notarization
  • Creating an installer to distribute the app

… and more. This one rich source of informationo for anybody interested in mobile application development. Great resource!

[Read More]

Top 4 must-monitor API Gateway metrics

Categories

Tags monitoring kubernetes aws devops tdd

Marc Andreessen famously said, “Software is eating the world.” Dr. Steve Willmott subsequently retorted, “APIs are eating software.” This is because API based architectures are enabling companies to get away from monolithic architectures and move to microservices. Innovative, disruptive companies like Netflix, Airbnb, Uber, Square, and Slack all build their infrastructure and technology using APIs. By bluematador.com.

If you’re building a serverless infrastructure and standardizing on Amazon API Gateway, here are the four key metrics you should monitor to ensure optimal API Gateway performance:

  • 4xx responses in API Gateway
  • 5xx responses in API Gateway
  • API Gateway request count
  • Request latency in API Gateway

Monitoring these four key metrics for Amazon API Gateway will put you in the driver’s seat for application performance. Good read!

[Read More]

Want to reduce service cost and resource waste? Start squeeze testing

Categories

Tags containers kubernetes monitoring devops tdd

James Burns wrote this article about squeeze testing. The practice of “squeeze testing” exists to keep information about the performance requirements of a service up to date for a given traffic load.

For growing businesses, it’s normal to size deployments of services based on the intuitions of the development team involved. Almost all the time sizing includes some safety margin so that sudden spikes in demand don’t take down the service or wake up whoever is on call. Unfortunately, often these intuitions, even if correct at the beginning, don ’t stay up to date with changes in the service or its dependencies leading to both outages and unhelpful paging.

The article captures:

  • Squeeze testing prerequisites
  • Service observability prerequisites
  • Load balancing prerequisites

Squeeze testing, the process of understanding the behavior of a service with different traffic volumes or resource allocations, can reduce resource waste, ensure effective service scaling based on demand, and cut service costs. Good read!

[Read More]

Build a GraphQL powered API with Laravel

Categories

Tags php web-development programming apis restful nosql

Often referred to as a platform or programming language agnostic query language, GraphQL is a comprehensive approach to guide software engineers in building data-driven applications. In this tutorial, you will learn some of the fundamental concepts required to build a Laravel API powered by GraphQL. BY Oluyemi Olususi.

This is a shift from the conventional architecture of building REST APIs, as we will take a different approach in this tutorial. To help us explore GraphQL, we will build a bookstore API with an ability to carry out CRUD (Create, Read, Update, Delete) operations on data, in your database.

The article covers:

  • Prerequisites
  • Creating a new Laravel project
  • Install GraphQL Laravel library
  • Creating book model
  • Creating a seeder file for the books table
  • Building GraphQL server
  • Creating a GraphQl type for the application
  • Creating GraphQL queries

… and much more. All the code is explained and provided together with links to more resources. Good read!

[Read More]