Implement a rate limiter to throttle API requests, and explain the trade-offs between a token bucket and a sliding window log approach.