Skip to main content

Best Practices

Follow these best practices to build secure, performant, and production-ready OData APIs.

Categories

CategoryDescription
SecurityProtect your API and data
PerformanceOptimize query execution and response times
ProductionDeploy and operate in production environments

Quick Reference

Security Essentials

  • Use environment variables for credentials
  • Limit allowed HTTP methods per controller
  • Restrict field access with custom controllers
  • Validate and sanitize inputs

Performance Essentials

  • Configure connection pooling
  • Use $select to limit returned fields
  • Add database indexes on filtered/sorted columns
  • Limit $expand nesting depth

Production Essentials

  • Enable structured logging
  • Configure appropriate pool sizes
  • Use SSL for database connections
  • Monitor query execution times

Detailed Guides