appfolio cost tuning | sed 's/\b(.)/\u\1/g'
개요
AppFolio Stack API 가격은 파트너 계약을 기반으로 합니다. 불필요한 API 호출을 줄여 최적화하세요.
비용 최적화
- 적극적으로 캐싱하세요 — 속성/단위 데이터는 거의 변경되지 않습니다 (5-15분 TTL)
- 배치 작업 — 모든 임대를 한 번에 가져와 로컬에서 필터링하세요
- 증분 동기화 — 마지막 동기화 이후 수정된 레코드만 가져오세요
- 웹훅 기반 — 폴링 대신 이벤트에 반응하세요
사용량 모니터
class ApiUsageMonitor {
private calls: Array<{ endpoint: string; timestamp: number }> = [];
record(endpoint: string) { this.calls.push({ endpoint, timestamp: Date.now() }); }
getHourlyReport() {
const cutoff = Date.now() - 3600000;
const recent = this.calls.filter(c => c.timestamp > cutoff);
const byEndpoint: Record<string, number> = {};
for (const c of recent) byEndpoint[c.endpoint] = (byEndpoint[c.endpoint] || 0) + 1;
return { total: recent.length, byEndpoint };
}
}