A constraint is a practical limit that shapes which solutions are feasible. Time, money, and team capacity can narrow the options—and help focus design decisions. section 2.12 section 2.5.1
State constraints plainly before comparing designs. They help determine which qualities can be traded down and which must remain protected: an internal tool might temporarily favor speed over scalability, while security, reliability, or data integrity may be non-negotiable. section 2.5.1
A one-day CSV export
A background worker, message queue, and notification service would take about a week. With one day available, a direct web-request export can meet the immediate need in hours, but may time out on large datasets. It is a reasonable fit only if its limits and acceptable risks are understood. section 2.5.1
Listing 2.9 “Good enough for now” solution (exportCSV.js)
app.get('/export-user-data', async (req, res) => {
try {
const userId = req.user.id;
const userData = await db.fetchUserData(userId); #A
if (!userData) {
return res.status(404).send('User not found.');
}
// Simple CSV conversion
const headers = 'id,name,email\n';
const csvRow = '${userData.id},${userData.name},
${userData.email}\n';
const csvData = headers + csvRow;
res.setHeader('Content-Type', 'text/csv');
res.setHeader('Content-Disposition',
'attachment; filename="user_data_${userId}.csv"');
res.status(200).end(csvData);
} catch (error) {
console.error('Export failed:', error);
res.status(500).send('An error occurred during export.');
}
});See a direct CSV-export implementation that illustrates the faster, less scalable option. section 2.5.1




























