This project demonstrates an API optimized for high performance using techniques like Dapper for faster data access, caching strategies (Redis, In-Memory), and efficient query handling with both Entity Framework (EF) and Dapper. It also explores various performance improvement strategies for APIs.
-
Efficient Data Access
- Entity Framework Core for complex queries
- Dapper for optimized read operations
- Asynchronous programming for improved responsiveness
-
Caching Strategies
- In-Memory caching for frequently accessed data
- Distributed caching with Redis for scalability
-
Performance Optimizations
- Pagination for large data sets
- Sorting capabilities
- AsNoTracking for read-only queries
-
Clean Architecture
- Repository pattern
- Separation of concerns
- Dependency Injection
-
Data Mapping
- AutoMapper for object-to-object mapping
-
Data Seeding
- Bogus library for generating realistic test data
- Clone the repository
- Ensure you have .NET Core SDK installed
- Set up your database connection string in
appsettings.json
- Run
dotnet ef database update
to create the database - Run
dotnet run
to start the application
- Database: PostgreSQL
- Caching: Redis (ensure Redis server is running)
- ORM: Entity Framework Core
- Micro-ORM: Dapper
- Seed the database using Bogus (configured in the DataSeeder class).
- Use the API endpoints to test CRUD operations and observe the performance difference between EF and Dapper.
- Monitor Redis for cache hits and database access reduction.
If you have any questions or need further assistance, please contact the project author at @kawser2133 ||
I want you to know that contributions to this project are welcome. Please open an issue or submit a pull request if you have any ideas, bug fixes, or improvements.
This project is licensed under the MIT License.