The Four Floors
What is an app actually made of?
This film needs JavaScript and WebGL.
- Meet Doña Carmen. For thirty years, her bakery in Cayey has sold pan sobao through a window on the plaza. This year, she put the bakery in your phone.
- Almost every app is built like her bakery. A counter you can see. A kitchen you can't. A pantry under the floor. And lately, a helper who takes orders in plain words.
- The frontend is the counter and the display case. Buttons, photos, prices. It lives on your phone, and its only job is to show things and catch your taps.
- When you tap Order, the counter doesn't bake anything. It writes a ticket and sends it down to the kitchen.
- The backend is the kitchen. It checks the ticket. Is there bread left? Is the price right? Did the payment go through? The rules of the business live here, where customers can't touch them.
- Under the floor is the pantry, and the notebook. Every loaf, every customer, every sale. That's the data layer. The kitchen forgets. The notebook remembers.
- To sell you the last pan sobao, the kitchen checks the notebook and crosses it off in one single move. So two people can never buy the same loaf.
- The newest floor is a helper. Say, the usual, for four people, and it understands, checks the pantry, and fills the ticket for you. It doesn't replace the kitchen. It uses it.
- Counter. Kitchen. Pantry. Helper. Four floors, one order, about a second from tap to gracias.
- But how does the counter talk to the kitchen? Through a window, with rules. That window is called an API.