SaaS From Zero to 100: Servers, Auth, Multi-Tenancy, Billing and Webhooks Explained

SaaS From Zero to 100: Servers, Auth, Multi-Tenancy, Billing and Webhooks Explained
Get in touch or AI consulting Join the AI Community & Comprehensive Online Courses for All Levels

Everyone is vibe coding a SaaS now. Very few people can explain what turns “an app on my laptop” into actual Software as a Service. In this almost two-hour lesson (in Hebrew, and free), Ariel sits with his student Shani and builds the whole picture on a whiteboard, one concept at a time. The running example is a tiny fitness app: you log what you ate and how much you ran, and it tells you if you gained or burned calories. By the end, that little app has users, tokens, tenants, subscriptions, webhooks and containers. The goal is two kinds of understanding: the vocabulary, and the infrastructure and tools you need around it, so you can actually brief Claude (or a developer) properly.

Part A: software, and where it lives

Every piece of software in the world is the same skeleton: a screen with a few inputs and a button, a server that receives what you sent, and a database that stores it. Run the app locally and your own computer is the server. Run it on a friend’s computer and theirs is. Put it on a hosting company and the server sits in their building.

Then the cloud. Every computer is made of three things:

  • Processing (CPU): the ability to calculate.
  • Memory (RAM): the short-term memory of what it is working on.
  • Storage (disk): where things are saved. A disk-on-key is storage.

A cloud data center is shelves and shelves of drawers full of chips, memory and disks, wired to a central manager. When you “buy a server”, the cloud just says: give me four units from here, three from there, six from there, and you are now machine X1. Ariel shows his own provider’s panel: pick shared, dedicated or burstable CPUs, slide the memory and disk up, done.

Two practical points that people miss:

  • Shared vs dedicated. Dedicated CPUs are yours even when you are idle, so they cost more. Shared CPUs are cheaper because the provider sells more units than physically exist and everyone competes, first come, first served.
  • Storage is never shared, because data has to be permanent. And with daily backups kept for two weeks, the 30 GB you “bought” is really your live 30 GB plus 14 more copies of it.

Why not just host from home? You can, but home computers are built to receive, not to serve. A cloud server has a static IP, it is always on, it sits closer to the internet backbone, and the shared power, backup electricity and connectivity make it far cheaper than doing all that yourself.

Part B: users, and the three “A"s

Shani logs in to the fitness app, records an egg and seven workouts, and suddenly the app shows Ariel’s steak mixed with her egg. Everyone’s data is one salad. Fixing that is the first real SaaS lesson, in three steps:

  1. Identification: who are you? Every user gets a unique ID.
  2. Authentication: prove that you are you. A password at minimum, ideally multi-factor. Ariel’s advice for people who do not want to complicate things: just log in with Google.
  3. Authorization: what are you allowed to do, and in what scope? Ariel can delete food records, but only his own, and he can never delete users.

On top of that come roles (admin, editor, viewer), two-factor codes, and Single Sign-On: the reason YouTube, Gmail, Drive and Calendar all know you are you after one login. A security bonus: admins should keep a separate admin account just for admin work.

Part C: scaling, and why independence is the whole game

You also buy bandwidth: how much data can flow in and out, like a water pipe that joins bigger and bigger pipes from your building to the street, the city, and the internet providers. When the app gets popular, one of the four resources (CPU, memory, storage, bandwidth) fills up and everything stutters.

The SaaS answer: prepare the infrastructure so it can grow on its own. Either the provider adds resources to the same machine (vertical scaling) or it duplicates the machine (horizontal scaling), with a load balancer in front that spreads requests across the copies and spins up a new one when each copy hits its limit.

That only works if the three blocks are truly independent:

  • The database has a clear, stable schema (all the tables and columns) and does not care which backend talks to it.
  • The backend exposes an API, which Ariel explains with a car: a steering wheel and two pedals are a four-action interface, the API is that same interface for code, and the “contract” (press gas, car moves) stays the same while each car implements it differently. REST is today’s standard contract style.
  • The frontend only needs to know its backend’s contract.

If each piece can be swapped, each piece can also be multiplied. Whether you start from the screens or from the database is a school-of-thought debate; Ariel’s flow is spec first, then entities, then tables, then endpoints. (For the database side in depth, see planning an app database with AI and the eight backend layers.)

Part D: tokens, encryption and statelessness

Modern apps are single-page apps: you log in once and then fire many separate actions. So how does every action still prove it is Shani? With a token, usually a JWT (JSON Web Token): after login the server packs who you are and what you may do into a signed token that only it could have issued, and your browser sends it with every request.

Underneath sits asymmetric encryption, explained with a bank account: you hand out your account number (the public key) so anyone can deposit, but only you hold the password (the private key) that can withdraw. Anything encrypted with the public key can only be opened by the server’s private key, so even if the carrier pigeon is caught, nobody can read the message.

That gives you stateless requests: “delete yesterday’s pizza” works in one step, with no history needed, because the token is the login. In bigger systems the token check becomes its own layer or server, and the real backend is never exposed to the internet at all; you always pass two layers to reach it. (Related: secure AI bot architecture and why there is no frontend security.)

Part E: tenants, isolation and multi-tenancy

Now gyms want to buy the app for their members, and each gym wants to manage its own users, rules and data. That needs a new object above users: the organization, which SaaS calls a tenant. Many tenants in one building is multi-tenancy.

The danger is not load (that is solved), it is leaks: a bug or a breach, and someone from gym A pulls data from gym B. The answer is isolation, on a spectrum: one app and one database for everyone, one app with a separate database per tenant, or fully separate servers per tenant so there is no road between them. More isolation costs more, so it is the customer’s decision and the customer’s bill. And again, it is only cheap if your three blocks are independent.

Part F: getting paid

Servers have fixed monthly costs, so SaaS loves fixed monthly subscriptions: predictable cash flow and a clean yearly forecast. Ariel’s tip is to plan billing from day one: which tiers, which add-ons, upgrades and downgrades, and the billing date. He breaks down proration with his own Claude plan: upgrade from the $100 plan to the $200 plan halfway through the month and you are not charged a second full month, only the upgrade for the part of the month that is left, and from next month you pay the new price. There are also the boring-but-expensive questions: what happens when a card fails, how long you wait, whether you backdate the renewal, and when you switch to usage-based billing (pay per message or per email) instead of a subscription. SaaS products take the longest to succeed, he warns, but the ones that make it (Monday, Office 365, Google Docs, WhatsApp) make it big. (For the business-model angle, see white label vs SaaS.)

Part G: webhooks are just automations

A gym wants welcome emails to go out from its own domain. Option A: you spend a fortune customizing code for every customer. Option B: every time something happens (a user registered, a payment went through), your system shouts “beep beep, here is the data” to a URL the customer gave you, and they hook whatever automation they want onto it: send the email, update their BI, alert the manager. That is a webhook: a hook you catch over the web. Ariel’s synagogue version: sunrise is the event, Shacharit is the hook. Permissions apply here too: a gym only hears the “beep beep” of its own users. (For wiring these up in practice, see how software, servers and AI providers connect.)

Part H: the rest of the toolbox

The last stretch is a fast tour through the advanced items:

  • Retries and nagging for failed payments, rate limiting so one tenant cannot bombard you, one-click deployments to all servers, feature flags, logs and metrics.
  • Partitioning (splitting data across servers), encryption at rest, and a strong default: unless you have a very clear reason, use SQL.
  • Docker containers: a mini-server box with its own settings that runs on any machine with Docker installed. Ariel’s starter recommendation: the database in one container and backend plus UI in another; go three-way (and even give the JWT check its own container) if you want to be a ninja.
  • SaaS, PaaS, IaaS and everything-as-a-service, SLA uptime promises (99% means roughly three and a half days of downtime a year, 99.9% roughly nine hours), churn, MRR and the other business metrics.
  • Microservices (many small services instead of one that breaks everything when you fix one function) and serverless, where you upload just a function with an input and output contract and the platform brings it to life, runs it, and buries it. The name of the game, once again, is independence.
  • Security layers: attack detection, a VPN as a second door in front of the server (Ariel’s analogy is the police cordon around Uman: no permit, no entry to the compound at all), protected records even admins cannot delete, backups and a business continuity plan, bring-your-own-device rules, and sandboxing your developers into one folder or container.
  • Data words: data warehouse, data lake, BI, NoSQL vs SQL, data science, and a pile of “X as a service” acronyms left as homework.

The best part is the student questions along the way, like how to build a recommendation “algorithm” for a South Korea tour guide app when you do not have Google’s data. Ariel’s honest answer: list the tasks, figure out where each piece of data comes from, and rack your brain step by step. That is SaaS in one sentence.

๐Ÿ”ฅ Roast Corner

This course is “completely free”, a fact Ariel proves by saying “Hostinger” sixteen times in under two hours, often followed by a gentle reminder that the discount code is in the description. At one point he even announces “a short commercial break” for his paid course, inside his free course. That is not a lesson in SaaS. That is a live demo of the business model. By minute 30, Shani knew the referral link better than the word “schema”.

Then there is the fitness app math. A ribeye steak is “plus 100 calories” and three runs are “minus 70”, so you only gained 30. Ariel, anyone who has eaten a ribeye knows 100 calories is the sauce. If his calorie app ships with that database, the SLA should promise 99.9% uptime and 0% accuracy. But hey, the architecture is beautifully decoupled: the frontend lies, the backend lies, and the database lies, each one independently and at scale.

๐Ÿค– AI for Humans

Speaking of 24/7 services that should never go down: in Sofia, on November 11, 2026, Bulgaria’s Stroke and Aphasia Association presented “Aya”, an AI assistant for people who have had a stroke and for their families. It answers around the clock by phone, email, chat and voice, in Bulgarian and English, on rehabilitation, speech therapy, social support, paperwork and the practical stuff that piles up after a stroke.

What makes it humane is how it was designed for people who struggle to communicate. For people with aphasia it offers short, clear written answers and a chat, it can slow its speech down, it copes with being interrupted, and it works even when someone can only type one or two words. It refuses to wander off-topic, and for anything complex it hands over to a human operator, with a callback from a speech therapist when communication is hard. The pilot was funded with EUR 15,000 from Sofia Municipality’s social innovation program and will be tested until spring. It is a nice reminder that a “SaaS” does not have to make anyone rich to matter. Source: xMATRIX.

Get in touch or AI consulting Join the AI Community & Comprehensive Online Courses for All Levels

๐Ÿ’ฌ Comments