Posts

Showing posts from June, 2023

Implement Rate Limiting In ASP.NET Core Web API

Image
Introduction In this article, you'll learn about rate limiting and how to apply it to your ASP.NET Core Web API. What is Rate Limiting? If you're building an API, it might be accessed by multiple clients. Sometimes, certain clients use the API excessively without any restrictions. However, if you need to control how often a specific client can use the API within a set timeframe, you can achieve this through Rate Limiting. Rate Limiting is like setting a speed limit on how many times someone can ask for something from a website or app in a certain amount of time. It means each person or device using the service can only ask for a certain number of things within a particular timeframe. Why do we need Rate Limiting? Rate Limiting is a useful tool for safeguarding against harmful bot attacks. Imagine a hacker sending bots to repeatedly request access to an API endpoint. This flood of requests can ove...

.NET 7 features of Microsoft’s cloud-first

Image
Microsoft's significant open-source platform, .NET 7, was unveiled during this year's .NET Conf. In addition to improved tooling, there are new language releases for C# and F#, along with the introduction of the cross-platform MAUI user interface framework. Moreover, a new version of ASP.NET Core and Blazor has been released for developing web applications on both the server and client sides. Additionally, there's a significant update to the Orleans distributed application development framework, which now aligns with .NET's naming scheme. Microsoft and the .NET Foundation have effectively transitioned the platform to an annual update schedule, prioritizing features through open development and incorporating community-contributed code. The shift from the Windows-exclusive .NET Framework to .NET Core, and now to a unified .NET release, has provided developers with a single cross-platform development platform. This expansion includes the addition of Linux and macOS support...

How to Optimizing Query Performance in Laravel

Image
In this article, we will explore the process of checking the execution time of queries in Laravel. By the end, you will clearly understand how to obtain the query execution time in Laravel. Additionally, we will provide practical examples, ensuring you grasp the concept effectively. This tutorial is applicable to various versions of Laravel, including 6, 7, 8, 9, and 10. If you're specifically interested in obtaining the SQL query execution time in Laravel, we will present two examples for your convenience. We will use the 'microtime()' function and the 'enableQueryLog()' feature to accurately calculate the query execution time in Laravel.  so, let's see the simple example code: Demonstration: 1 TestController.php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\User; class TestController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response ...

ASP.NET 7 new features

Image
ASP.NET Core 7 is an important part of Microsoft's "cloud-first" version called  NET 7, which was presented in November. Which was introduced in November. It offers web developers a range of powerful new tools to create modern web applications. ASP.NET Core 7 is built on the .NET Core runtime and provides all the necessary resources to build state-of-the-art web user interfaces and reliable back-end services. The best part is that it supports Windows, Linux, and macOS operating systems, allowing developers to work across different platforms. You will find examples of code to help you get started with ASP.NET Core 7 in this article. To try out the code examples mentioned in this article, you will need to have Visual Studio 2022 installed on your computer. If you don't already have it, you can download Visual Studio 2022 from this link. Now, let's explore some of the exciting new features in ASP.NET C...

Laravel 8 Queue Step by Step Tutorial Example

Image
This is a concise guide demonstrating a Laravel 8 queue example. This article presents a straightforward, step-by-step illustration of Laravel 8 queue implementation. Furthermore, I will showcase a Laravel 8 mail queue example, providing you with valuable insights into the process. Let's delve into the following steps. Occasionally, certain processes such as sending emails or processing payment gateways can be time-consuming. When you send verification emails or invoices, there can be a delay due to the nature of these services. To eliminate the waiting time for users and expedite server-side processes, the implementation of a queue becomes highly beneficial. Not only does it enhance speed, but it also improves the overall user experience. In this regard, I will share a straightforward example of creating a queue using the database driver for testing email sending. This example will provide a clear understanding of how queues function and highlight their ease of use. Even if yo...