Middle
Task: design a feature flags management service for three platforms (iOS, Android, Web). Draw an architectural diagram, describe the database schema, and provide examples of client and web interface requests.
sobes.tech AI
Answer from AI
For a feature flags management service operating on iOS, Android, and Web, the architecture might look like this:
- Backend API — a central service that stores and manages flags.
- Database — stores information about flags, their states, and inclusion conditions.
- Clients (iOS, Android, Web) — request current flags and apply them.
- Web interface for administrators — allows creating, modifying, and viewing feature flags.
Architectural diagram (simplified):
[Admin Web Interface] <--> [Backend API] <--> [Database]
^
|
-------------------|-------------------
| | |
[iOS client] [Android client] [Web client]
Database schema (example in relational model):
-
feature_flags
- id (PK)
- name (unique flag name)
- description
- is_active (bool)
- created_at
- updated_at
-
flag_conditions (optional, for targeting)
- id (PK)
- feature_flag_id (FK)
- condition_type (e.g., "user_segment", "platform")
- condition_value
-
flag_audit_logs
- id (PK)
- feature_flag_id (FK)
- changed_by
- change_type (creation, update, deletion)
- timestamp
Example client request to get flags:
GET /api/feature-flags?platform=ios&user_id=12345
Authorization: Bearer <token>
Response:
{
"flags": [
{"name": "new_ui", "enabled": true},
{"name": "beta_feature", "enabled": false}
]
}
Example web interface request to create a flag:
POST /api/feature-flags
Content-Type: application/json
{
"name": "new_ui",
"description": "Enabling new interface",
"is_active": true
}
Response:
{
"id": "uuid",
"name": "new_ui",
"is_active": true
}
This service allows centralized management of flags, quick toggling of features across platforms, and change auditing.