Friday 28 May 2021

Basic vs. Bearer authentication

 


The Basic and Digest authentication schemes are dedicated to the authentication using a username and a secret .


The Bearer authentication scheme is dedicated to the authentication using a token and is described by the RFC6750. Even if this scheme comes from an OAuth2 specification, you can still use it in any other context where tokens are exchange between a client and a server.


Concerning the JWT authentication and as it is a token, the best choice is the Bearer authentication scheme. Nevertheless, nothing prevent you from using a custom scheme that could fit on your requirements.


JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded.

Cascade DELETE in SQL Server

 


What is a foreign key with Cascade DELETE in SQL Server?

A foreign key with cascade delete means that if a record in the parent table is deleted, then the corresponding records in the child table will automatically be deleted. This is called a cascade delete in SQL Server

Tuesday 25 May 2021

startup in azure


In .NET's dependency injection there are three major lifetimes:


1) Singleton which creates a single instance throughout the application. It creates the instance for the first time and reuses the same object in the all calls.


2) Scoped lifetime services are created once per request within the scope. It is equivalent to a singleton in the current scope. For example, in MVC it creates one instance for each HTTP request, but it uses the same instance in the other calls within the same web request.


3) Transient lifetime services are created each time they are requested. This lifetime works best for lightweight, stateless services.


 1)Transient objects are always different; a new instance is provided to every controller and every service.


2)Scoped objects are the same within a request, but different across different requests.


3)Singleton objects are the same for every object and every request.

Sunday 16 May 2021

App Service Azure

App Service Plans => Multiple Web Apps Asp.net application can be deployed to one web app

Kubernetes Vs. Docker

1)Kubernetes is developed by Google whereas Docker Swarm is developed by Docker Inc. 2)Kubernetes provides Auto-scaling whereas Docker Swarm doesn’t support autoscaling. 3)Kubernetes supports up to 5000 nodes whereas Docker Swarm supports more than 2000 nodes. 4)Kubernetes is less extensive and customizable whereas Docker Swarm is more comprehensive and highly customizable. 5)Kubernetes provides low fault tolerance while Docker provides high fault tolerance. features of Kubernetes: 1)Offers automated scheduling 2)Self-Healing capabilities 3)Automated rollouts & rollback 4)Horizontal Scaling & Load Balancing 5)Provides a higher density of resource utilization 6)Offers enterprise-ready features 7)Application-centric management 8)Auto-scalable infrastructure 9)You can create predictable infrastructure 10)Provides declarative configuration 11)Deploy and update software at scale 12)Offers environment consistency for development, testing, and production. features of Docker: Isolated environments for managing your applications 1.Easy Modeling 2.Version control 3.Placement/Affinity 4.Application Agility 5.Developer Productivity 6.Operational Efficiencies

Wednesday 12 May 2021

Azure CLI

What is the Azure CLI? The Azure CLI is Microsoft's cross-platform command-line tool for managing Azure resources. It's available for macOS, Linux, and Windows, or in the browser using Azure Cloud Shell. The Azure CLI can help you manage Azure resources such as virtual machines and disks from the command line or in scripts. Let's get started and see what it can do with Azure Virtual Machines.

Azure Cache for Redis

Azure Cache for Redis: Develop, operate, and scale Redis Enterprise across Microsoft Azure. Now available for public preview. Learn what others are saying and see the benefits. Primary Database. Geo Distributed. Faster Time to Value. Best Database Experience. Large Datasets. Ease of Use.

Function Vs Logic apps in Azure

Logic apps are similar to functions. Both enable you to trigger logic based on an event. Where functions execute code, logic apps execute workflows that are designed to automate business scenarios and are built from predefined logic blocks. Logic app creates automated work flows.

Tuesday 4 May 2021

TRIGGER in sqlserver

CREATE TRIGGER triggerName ON table AFTER INSERT |After Delete |After Upadte AS BEGIN INSERT INTO dbo.User END ========================================= DML Instead of Trigger: An Instead of trigger is fired instead of the triggering action such as an insert, update, or delete After Trigger: An After trigger executes following the triggering action, such as an insert, update or delete ========================================= DDL Trigger This type of trigger is fired against DDL statements like Drop Table, Create Table or Alter Table. DDL Triggers are always After Triggers.

Table variable Vs Temporary tables

Table variable can be passed as a parameter to functions and stored procedures while the same cannot be done with Temporary tables.Temporary tables are visible in the created routine and also in the child routines. Whereas, Table variables are only visible in the created routine. Temporary Tables are physically created in the tempdb database. These tables act as the normal table and also can have constraints, index like normal tables. Table Variable acts like a variable and exists for a particular batch of query execution. It gets dropped once it comes out of batch. It is created in the memory database but may be pushed out to tempdb. Use Table variable, if you have less than 1000 rows otherwise go for Temporary tables. 1.Table variable (@table) is created in the memory. Whereas, a Temporary table (#temp) is created in the tempdb database. However, if there is a memory pressure the pages belonging to a table variable may be pushed to tempdb. 2. Table variables cannot be involved in transactions, logging or locking. This makes @table faster then #temp. So table variable is faster then temporary table. 3. Temporary tables are allowed CREATE INDEXes whereas, Table variables aren’t allowed CREATE INDEX instead they can have index by using Primary Key or Unique Constraint. 4. Table variable can be passed as a parameter to functions and stored procedures while the same cannot be done with Temporary tables. 5. Temporary tables are visible in the created routine and also in the child routines. Whereas, Table variables are only visible in the created routine. 6. Temporary table allows Schema modifications unlike Table variables. There are two types of temporary tables: local and global. Local temporary tables are visible only to their creators during the same connection to an instance of SQL Server as when the tables were first created or referenced. Local temporary tables are deleted after the user disconnects from the instance of SQL Server. Global temporary tables are visible to any user and any connection after they are created, and are deleted when all users that are referencing the table disconnect from the instance of SQL Server. Local Temporary Table Scope If a local temporary table created in a stored procedure, it is dropped automatically when the stored procedure is finished. This means that this local temporary table can be referenced only by nested stored procedures. The local temporary table cannot be referenced by the stored procedure or application that called the stored procedure that created the local temporary table. Global Temporary Tables A global temporary table is created using CREATE TABLE statement with the table name prefixed with a double number sign (##table_name). In SQL Server, global temporary tables are visible to all sessions (connections). So if you create a global temporary table in one session, you can start using it in other sessions.