Representational State Transfer (REST)
REST is an architectural style that defines the communication between client and server via the HTTP protocol.
Classification
- ComplexityMedium
- Impact areaTechnical
- Decision typeDesign
- Organizational maturityIntermediate
Technical context
Principles & goals
Use cases & scenarios
Compromises
- Sicherheitsanfälligkeiten
- Data loss on faulty calls
- Insufficient error handling
- Use standard HTTP methods
- Document the API for users
- Follow security practices
I/O & resources
- API Specifications
- Server Resources
- Security Certificates
- API Documentation
- Accessible Endpoints
- API Statistics
Description
REST is a widely used architectural style based on the principle of resource orientation. It allows interaction between client and server through standardized HTTP methods. Applications that follow RESTful principles often exhibit high scalability and flexibility.
✔Benefits
- High scalability
- Easy to use
- Separation of concerns
✖Limitations
- Can complicate complex data operations
- Firewall and security issues
- Dependency on HTTP
Trade-offs
Metrics
- Access Times
Measurement of the time taken to access resources.
- Error Rates
Measurement of the frequency of errors in API calls.
- User Requests per Second
Number of requests processed per unit of time.
Examples & implementations
GitHub API
The GitHub API allows developers to access GitHub resources.
Twitter API
The Twitter API allows access to tweets and user information.
OpenWeatherMap API
The OpenWeatherMap API provides weather data for various locations.
Implementation steps
Define API goals
Select technology stack
Carry out implementation and testing
⚠️ Technical debt & bottlenecks
Technical debt
- Outdated API endpoints
- Insufficient testing
- Lack of API modularity
Known bottlenecks
Misuse examples
- Overusing resource services
- Misusing authentication methods
- Bypassing security policies
Typical traps
- Insufficient documentation and examples
- Neglecting error handling
- Introducing unnecessary complexity
Required skills
Architectural drivers
Constraints
- • Compliance with REST guidelines
- • Organization security policies
- • Network bandwidth and stability