add translater
Wednesday, 25 September 2024
Angular Add translater in .ts file
Tuesday, 24 September 2024
in live url refresh page getting error resource not found in angular 18
import { ApplicationConfig, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
Friday, 20 September 2024
Remove duplicate worfkflow approvers
WITH CTE AS (
SELECT
WorkflowProgress_ID,
Division_ID,
Country_Code,
Site_Location,
AFINumber,
WorkFlow_ID,
Approver_userID,
ROW_NUMBER() OVER (PARTITION BY Division_ID, Country_Code, Site_Location, AFINumber, WorkFlow_ID, Approver_userID ORDER BY WorkflowProgress_ID) AS RowNum
FROM
YourTableName
)
DELETE FROM CTE
WHERE RowNum > 1;
Wednesday, 18 September 2024
triggers in sql for update and insert
CREATE TRIGGER tr_tbl_EmpCompetencies
ON [dbo].[tbl_EmpCompetencies]
AFTER UPDATE, DELETE
AS
BEGIN
IF EXISTS (SELECT 1 FROM DELETED) AND NOT EXISTS (SELECT 1 FROM INSERTED)
BEGIN
INSERT INTO [History].[tbl_EmpCompetencies] (
[Action], [ID], [LC_ID], [AppraisalID], [AppraisalTypeID], [EmpNumber],
[EmpRating], [EmpComment], [MgrRating], [MgrComment], [ApprovalStatusID],
[ApproverID], [ModifiedBy], [ModifiedDate], [IsActive])
SELECT
'DELETE', [ID], [LC_ID], [AppraisalID], [AppraisalTypeID], [EmpNumber],
[EmpRating], [EmpComment], [MgrRating], [MgrComment], [ApprovalStatusID],
[ApproverID], [ModifiedBy], [ModifiedDate], [IsActive]
FROM DELETED;
END
-- Handle UPDATE action (log only the updated/new data)
IF EXISTS (SELECT 1 FROM INSERTED) AND EXISTS (SELECT 1 FROM DELETED)
BEGIN
INSERT INTO [History].[tbl_EmpCompetencies] (
[Action], [ID], [LC_ID], [AppraisalID], [AppraisalTypeID], [EmpNumber],
[EmpRating], [EmpComment], [MgrRating], [MgrComment], [ApprovalStatusID],
[ApproverID], [ModifiedBy], [ModifiedDate], [IsActive])
SELECT
'UPDATE', [ID], [LC_ID], [AppraisalID], [AppraisalTypeID], [EmpNumber],
[EmpRating], [EmpComment], [MgrRating], [MgrComment], [ApprovalStatusID],
[ApproverID], [ModifiedBy], [ModifiedDate], [IsActive]
FROM INSERTED;
END
END;
Monday, 16 September 2024
5 Essential Techniques for Turbocharging API Performance
5 Essential Techniques for Turbocharging API Performance
A high-performing API is crucial for a great user experience and efficient application operation.
1. Caching
Store frequently accessed data in a cache (like Redis or Memcached) for rapid retrieval, bypassing the database for repeated requests.
Benefits
- Drastically reduces database load.
- Significantly improves response times.
Challenges
- Deciding on the right caching strategy (time-based, event-based, etc.)
- Managing cache invalidation to ensure data consistency.
2. Scale-out with Load Balancing
Distribute incoming requests across multiple server instances using a load balancer (like Nginx or HAProxy).
Benefits
- Handles increased traffic and prevents a single server from becoming a bottleneck.
- Improves reliability as requests can be routed to healthy instances if one fails.
Considerations
- Stateless applications are easier to scale horizontally.
- Requires infrastructure to manage load balancers.
3. Asynchronous Processing
Acknowledge client requests immediately and process them in the background, sending results later.
Benefits
- Unblocks the client and improves perceived responsiveness.
- Allows the API server to handle long-running tasks without delaying other requests.
Considerations
- Requires careful design to manage background tasks and notifications.
- Not suitable for all API operations (e.g., real-time data updates).
4. Pagination
Limit the number of records returned per request and provide a way to retrieve subsequent pages.
Benefits
- Reduces response sizes, especially for large datasets.
- Prevents excessive memory consumption on both client and server.
Implementation
- Use query parameters for page number and size.
- Include metadata in the response (e.g., total records, next/previous page links).
5. Connection Pooling
Maintain a pool of reusable database connections instead of creating a new one for each request.
Benefits
- Minimizes the overhead of establishing new connections.
- Significantly improves performance under high concurrency.
Implementation
- Most database libraries/frameworks offer built-in connection pooling mechanisms.
**Additional Tips**
- Optimize Database Queries
- Gzip Compression - Reduce response sizes.
- Content Delivery Network (CDN) - Cache static assets globally for faster delivery.
- Monitor and Profile - Use tools like New Relic or Datadog to identify bottlenecks.
HCL healthcare
hcl health care f2f second round interview asked more uestions on microservice 1.apim manage all apis in one place 2.sql profiler in one fo...
-
D:\A-MyProjects2024-2025\ReactNative2025\BookRental\android\app\build\outputs\apk\debug path of apk To build an Android app using Capacitor...
-
OLX, like many large-scale online platforms, employs a variety of data structures and technologies to manage its data effectively. While s...