API Maker
The backend engine for the AI era
Data safetyEpisode 4 6:42 10 chapters November 2026
Encryption, hashing, auto increment numbers, generated ids and updates that never erase each other: in API Maker each one is a key in the schema of a table, on MongoDB as on SQL. See what the database really holds, how your code reads it back with the secret, and how a stale update is refused.
In the playlists The complete course Databases & schemas
Some data must be protected. In API Maker, you can encrypt or hash a field, make numbers and IDs, and stop two updates from erasing each other. Each one is just a key in the schema of a table. In this video, we use the reviews and the products of Calm Home.
Protecting data is usually hard work. You write encryption code, and keep keys, in every service. You write counters by hand, and on MongoDB, they can clash. And one save can quietly erase the save before it. With API Maker, one key in the schema encrypts or hashes a field. Numbers and IDs come from the schema. And an update made on old data is refused. In this video: four fields in a schema, encrypted and hashed values, how to read them back on the server, the counters, a version field, and two people saving the same product.
Open Instance API. Pick mongodb, then catalog, then reviews, and open its schema. Calm Home wants to contact the people who write reviews. So we add four fields after _id, each with one key. review_no is a number that API Maker counts, from one thousand and one. MongoDB has no auto increment, so this helps. public_id is a ULID. It is an ID you can share. It is sorted by time, and it does not show how many reviews there are.
contact_email is encrypted. contact_phone is hashed. Click Update and Close.
Now let us save a review. Open API Testing, pick mongodb, then catalog, then reviews, and Save single-multiple. We type the review of Kabir, with his email and his phone, as plain text. The answer is two hundred and one. The review number is one thousand and one, and it has its ULID. The email is encrypted, and the phone is hashed. This is what the database holds now. Send the same review again.
Now it is one thousand and two, with another ULID. The same email is encrypted differently each time. But the same phone always gives the same hash. You can search for a hash, but you can never read it back. An encrypted value can be read back, with the key. The keys are in the default secret, on the server. To encrypt, there is an algorithm and a secret. To hash, there is an algorithm and a nonce.
The schema names no key, so Git holds no key. A copy of the database, or a backup, shows only encrypted text and hashes.
Reading these values back is the job of your code, on the server. The support team wants to call back the people who used one phone number. First, hash the phone the same way, and find its reviews. Then the keys of the secret decrypt each email, for this API only. Here is the custom API Review Contacts. Click Test API, type the phone of Kabir, and click Send. His two reviews are found by the hash, and the emails are shown as plain text.
Now open Database, then Auto Increments. These are the counters of the account. For reviews, review_no is now at one thousand and two. Every server of the installation uses this one counter. Edit sets where the count goes on. We set one thousand five hundred, for reviews brought in from an older shop. The next number is the higher of this value and the highest number in the table, plus the step.
Click Update.
Now the products. Two people can edit the same product at the same time. Go back to Instance API. Pick mongodb, then catalog, then products, and open its schema. We add a version field. An update must send the version it read, and each save adds one to it. Click Update and Close. Ana and Ben both opened the Ash nightstand, at version one. Pick the API Update by ID.
Give its ID, and ask for only the name, the price, and the version in the answer. Ana sets the price to two hundred and nine, with version one. It is saved, and now it is version two. Ben is still on version one. He sets one hundred and ninety nine. The answer is four hundred. The version does not match, so nothing is written. Ben loads it again, sees version two, and decides.
Now it is saved, as version three.
Good to know. There are four ID types: ObjectID, GUID_UUID, ULID, and ShortUUID. They are used when the request has no value. On SQL, isAutoIncrementByDB lets the database do the numbering. The version is checked by update by ID, and replace by ID. When your code uses g.sys.db, it skips the check unless it asks for it. And like a database sequence, numbers can have gaps. If a save is refused after it got its number, that number is not used again.
Keys stay in the secret, never in code or in Git. The schema says what is protected, and every write follows it: the APIs and your code too. So an API written by an AI assistant cannot save an email as plain text.
To sum up. Encryption and hashing, with one key each. Values read back on the server, with the secret. Numbers and IDs from the schema, on MongoDB too. All counters on one page. And updates on old data are refused. Next: relations across databases, and the ER diagram. API Maker. Build faster, spend smarter, deliver better.
Length 4:56ER diagram
Length 10:05Six engines
Length 6:49Databases
Length 12:35Table designer