This one is a nine-minute whiteboard session from a live lesson, the kind of architecture concept you need even if AI writes all your code. The question: what is a DAL, how does your code actually talk to the database, and why does everyone insist on creating a model class for every single table? Ariel answers with a red database that looks suspiciously like a thumb, a green DAL, and a table called “schnitzel.”
Background: when do you find out you messed up?
Ariel starts with what he calls managed languages. What he’s really describing is the difference between typed and loosely typed code, and the point is when you get the error.
- In Python or JavaScript, you can declare
aandb, seta = 1, put something completely different inb, write a hundred more lines, and then doc = a + b. You only find out it’s broken at run time, when the code actually runs. - In Java, C# or TypeScript, the error shows up at compile time, before anything runs. The compiler basically says: “Buddy, I don’t know what type you’re talking about. You can’t do this to me.” You fix it to
int a,int b, and in C# you can’t even leave anintempty; you have to give it a value like0.
Programmers sometimes hate that strictness, right up until they run their loosely typed code in production, cry a little, and say “wow, there’s nothing like C#.”
The database and the model
A database has tables, and tables have columns: name, age, and so on. To use a table comfortably in typed code, you define a matching type in your language, called a model. Same names, same shape.
Ariel’s example table is “schnitzel.” So in your code you create a Schnitzel type (or SchnitzelModel, or SchnitzelClass) with SchnitzelId, SchnitzelName, SchnitzelAge. That’s also the reason TypeScript exists: it’s a layer on top of JavaScript that lets you define those types.
So what is the DAL?
DAL = Data Access Layer. It’s the layer whose job is communicating between your code and the database. That doesn’t happen by magic.
In C#, the DAL Ariel shows uses Microsoft’s SQL client behind the scenes: a low-level library that really knows how to talk to SQL Server. Your part is to give it a connection string with the server name, the database name, and credentials. On his dev machine he uses a trusted connection (the same Windows user), unlike the username and password you’d use in production.
What comes back is raw: a table object with .Rows, an array of rows, where each row is an array of columns. More or less what you see when you run a SELECT in the database. Modern SQL clients help a bit with data types, but by and large you get data and it’s your job to convert it.
Why not just work with the raw rows?
You could convert everything to strings and pass JSON-like objects around, and some people do. But when that data reaches your controllers and business logic, you don’t want code that looks like this:
- parse the value at
rows[0][i]to an int, - but first check it isn’t a database null,
- and hope that column really is a number.
For every single field. Instead, you say “leave me alone” and map it in advance, at the DAL level, into a Person. Create a Person class with a Name (string) and an Age (int), plus a function like FromDataRow(row) that does the parsing once. From then on, anywhere in your code, you just write person.Age.
That’s the pattern in pretty much every language: the DAL brings the data, and the DAL (or the business layer) converts raw data into classes, so the rest of the code can work with them logically. Ariel adds that people like him often build one very generic DAL and reuse it everywhere.
“Couldn’t I do that in the business logic too?”
A student asks exactly that. Ariel’s answer: you could put the conversion anywhere, but the typed language is what forces you to do it. Skip the conversion and the compiler stops you the moment you try to do arithmetic on an unknown object.
In JavaScript, age + 1 keeps working as long as the data happens to be a number, and blows up the day it isn’t. In a typed language, it tells you on day one: “Bro, there’s an unknown object here, you can’t do math on it.” That’s why loosely typed languages are great for prototypes and research where you don’t know exactly what’s coming, and why both JavaScript (TypeScript) and Python (type hints and similar wrappers) grew ways to get a more managed experience.
Why this matters when AI writes the code
If you vibe code, you’ll see AI agents create a model class per table and a data access layer without being asked. Now you know why: it keeps parsing and null checks in one place, it lets the compiler catch mistakes early, and it gives your controllers clean objects like person.Age instead of rows[0][i]. When you review the AI’s architecture, that’s one of the layers you should expect to find.
๐ฅ Roast Corner
Let’s appreciate the teaching materials. The database, drawn in red, “looks like a thumb, but never mind, let’s assume it’s a database.” The flagship example table is “schnitzel,” with columns for schnitzel ID, schnitzel name, and schnitzel age. Ariel, nobody wants to know the age of their schnitzel. If your schnitzel has an age column, that’s not a data model, that’s a health inspection.
And the compiler gets the best lines in the lesson: “Buddy, I don’t know what type you’re referring to.” “You can’t do this to me.” The C# compiler is the only coworker who reviews your code instantly, never takes a vacation, and still gets called annoying. Meanwhile JavaScript happily lets you add "1" + 1, hands you "11", and waits silently until 3 AM in production to tell you about it. Sorry, it doesn’t tell you. A customer does.
The best part: nine minutes on why you must map every column to a strict type, delivered by the man who runs his whole life on an AI agent that answers in free-form text. Ariel, your schnitzel has stricter typing than your assistant.
๐ค AI for Humans
Turning raw data into something people can act on is the whole idea of a DAL, and it’s also the idea behind one of the biggest AI-for-good bets of the year. In September 2026, the OpenAI Foundation announced a $60 million investment to bring AI-powered weather and crop-disease forecasts to 100 million smallholder farmers across South and Southeast Asia and East Africa over three years.
Why it matters: nearly 500 million small family farms support the livelihoods of more than two billion people, and one bad season can decide whether a family eats, keeps the kids in school, or falls into debt. A false monsoon start can make farmers plant too early and lose the crop; rain at harvest can ruin it. Traditional forecasts need expensive supercomputers that many meteorological offices in low- and middle-income countries can’t run. AI weather models can now match or beat those forecasts at a fraction of the compute cost, and can be tuned for farmer-specific questions like “when will the rains really start?”
The money goes to six organizations, including the University of Chicago, UC Berkeley, Precision Development, AIM for Scale, Digital Green and CIMMYT, working with national governments to deliver the forecasts to farmers’ phones. Raw atmospheric data in, a clear “plant now” or “wait” out. That’s a data access layer worth building.
Source: OpenAI Foundation, “AI forecasting for smallholder farmers”

๐ฌ Comments