<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nazmul Khalid</title>
    <description>The latest articles on DEV Community by Nazmul Khalid (@technonazmul).</description>
    <link>https://dev.to/technonazmul</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F718665%2F3be3805a-5a65-418e-adc1-809d53e55cb0.jpg</url>
      <title>DEV Community: Nazmul Khalid</title>
      <link>https://dev.to/technonazmul</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/technonazmul"/>
    <language>en</language>
    <item>
      <title>Shipping Software Updates to Servers You Don't Control</title>
      <dc:creator>Nazmul Khalid</dc:creator>
      <pubDate>Tue, 10 Nov 2026 10:37:33 +0000</pubDate>
      <link>https://dev.to/technonazmul/shipping-software-updates-to-servers-you-dont-control-40fk</link>
      <guid>https://dev.to/technonazmul/shipping-software-updates-to-servers-you-dont-control-40fk</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nazmulkhalid.com/ideas/shipping-updates-to-servers-you-dont-control" rel="noopener noreferrer"&gt;nazmulkhalid.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; When your software runs on servers you can't SSH into, an update has to be safe without anyone watching. In Bicitra Commerce, a self-hosted eCommerce platform, the update pipeline checks every planned file write (permissions, ownership, disk space) before touching anything, verifies each release against a checksum, skips &lt;code&gt;vendor/&lt;/code&gt; when dependencies haven't changed, and rolls back completely on any failure.&lt;/p&gt;

&lt;p&gt;Bicitra Commerce ships differently from most SaaS products. There isn't one application that I deploy and control. Each merchant runs their own Laravel/MySQL install, usually on the cheapest shared hosting they can find. That gives merchants independence and low hosting bills. It also means every update lands on a production server I have no SSH access to, under hosting conditions I can't predict.&lt;/p&gt;

&lt;h2&gt;
  
  
  The failure that shaped the design
&lt;/h2&gt;

&lt;p&gt;The pipeline checks permissions first because a real update failed halfway through on a permissions problem. On one host, &lt;code&gt;vendor/&lt;/code&gt; had been left owned by the SSH user after a manual composer install.&lt;/p&gt;

&lt;p&gt;The update only found out once it tried to write files it wasn't allowed to touch. By then the site was already down and the update was half-applied. There's no ops team on the other end of a shared hosting account to step in.&lt;/p&gt;

&lt;p&gt;That's the worst moment to discover a permissions problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check everything before anything goes down
&lt;/h2&gt;

&lt;p&gt;The fix is to check what the update will need before changing a single file. The pipeline now checks every planned file write (permissions, ownership, disk space) and reports a problem with zero files touched.&lt;/p&gt;

&lt;p&gt;Before, the same problem showed up three steps into an update with the site offline. Now a cPanel host that disables &lt;code&gt;symlink()&lt;/code&gt; outright, or a server with mixed file ownership after a manual install, gets caught before it turns into an outage.&lt;/p&gt;

&lt;h2&gt;
  
  
  One check isn't enough
&lt;/h2&gt;

&lt;p&gt;The other safeguards come from the same constraint: nobody can step in if an update breaks halfway.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Checksum verification.&lt;/strong&gt; Every release package is checked against a checksum before it's applied, so a corrupted or incomplete download can't get partly installed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skip what hasn't changed.&lt;/strong&gt; &lt;code&gt;vendor/&lt;/code&gt; is left alone when dependencies haven't changed. That means fewer files written and fewer things that can fail on hosts with slow or unreliable disks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roll back completely.&lt;/strong&gt; If an update fails partway, it rolls back, and that includes removing new top-level files the failed update had already added, not just restoring the ones it changed. A failed update should leave the site exactly as it was.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd tell anyone shipping to other people's servers
&lt;/h2&gt;

&lt;p&gt;Build for the update that fails on a host you'll never see. Most update tooling assumes a person is watching and can react when something breaks.&lt;/p&gt;

&lt;p&gt;Once you ship to infrastructure you don't run (shared hosting, a customer's VPS, an air-gapped network), that person is gone. A broken update isn't a Slack alert anymore. It's a merchant's store offline with nobody who can log in and fix it.&lt;/p&gt;

&lt;p&gt;There's no single clever check that solves this. It's four habits together: check before you commit, verify before you apply, change as little as you can, and make failure fully reversible.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Nazmul Khalid, a lead software engineer. I build SaaS products and MVPs for founders. The Bicitra Commerce case study is &lt;a href="https://nazmulkhalid.com/work/bicitra-commerce" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and how I work is on &lt;a href="https://nazmulkhalid.com/hire" rel="noopener noreferrer"&gt;my hire page&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How Long a SaaS MVP Really Takes, and What It Costs</title>
      <dc:creator>Nazmul Khalid</dc:creator>
      <pubDate>Tue, 27 Oct 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/technonazmul/how-long-a-saas-mvp-really-takes-and-what-it-costs-2eac</link>
      <guid>https://dev.to/technonazmul/how-long-a-saas-mvp-really-takes-and-what-it-costs-2eac</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nazmulkhalid.com/ideas/saas-mvp-timeline-and-cost" rel="noopener noreferrer"&gt;nazmulkhalid.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;"How long will it take, and what will it cost?"&lt;/p&gt;

&lt;p&gt;It's the first question almost every founder asks me, and the honest answer is "it depends", which is useless on its own. So here's what it depends on, with real build times from products I've shipped and the prices I actually charge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What real builds took
&lt;/h2&gt;

&lt;p&gt;Two of my own products give a useful baseline, because I built both of them alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A school management platform: about three weeks.&lt;/strong&gt; &lt;a href="https://nazmulkhalid.com/work/bicitra-ems" rel="noopener noreferrer"&gt;Bicitra EMS&lt;/a&gt; is one system shared by many schools, with each school's data kept apart. In roughly three weeks of solo work I built the API, the web dashboards and a mobile app for parents, teachers, gate staff and bus drivers. That covered admissions, QR attendance, fees, academic records, live bus tracking and a full Bangla/English interface, backed by 338 automated tests. A collaborator supplied the school registers and government requirements, so I didn't have to work those out myself. Payments by mobile banking and SMS were built to plug in later, because they were waiting on vendor accounts rather than on code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A self-hosted store platform: about a month.&lt;/strong&gt; &lt;a href="https://nazmulkhalid.com/work/bicitra-commerce" rel="noopener noreferrer"&gt;Bicitra Commerce&lt;/a&gt; is installed separately for each merchant. In about a month I built the store itself with two themes, a central hub for licences and updates, a safe self-update system and a plugin system that can't take a store down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What a longer build looks like.&lt;/strong&gt; &lt;a href="https://nazmulkhalid.com/work/docbee" rel="noopener noreferrer"&gt;DocBee&lt;/a&gt;, a telemedicine platform I was lead engineer on, has five parts: two mobile apps, an API, an admin panel and a public website. It didn't ship in one go. The patient app came first, then the doctor app and the API, then the admin panel, over roughly two years of building and improving it while it was live. That's normal for a real product. The MVP is only the start.&lt;/p&gt;

&lt;p&gt;These numbers are real, but they're also best cases: one experienced engineer who knows the domain, a clear scope, and quick decisions. Your MVP might be simpler than these, or it might have one hard part that takes longer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What drives the cost up or down
&lt;/h2&gt;

&lt;p&gt;The tech stack matters much less than people think. These are the things that actually change the size of the job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User roles.&lt;/strong&gt; Every extra type of user (admin, staff, customer, driver) means its own screens, permissions and tests. Three roles cost noticeably more than one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payments.&lt;/strong&gt; Taking money means handling failures, refunds, receipts and the case where someone taps "Pay" twice. It's never just adding a button.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time features.&lt;/strong&gt; Live chat, video calls, live tracking or instant updates add real work, especially once more than one server is involved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile apps.&lt;/strong&gt; Android and iOS apps roughly add a second product on top of the web app, plus app store reviews.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrations.&lt;/strong&gt; Every outside service (SMS, maps, payment gateways, accounting tools) has its own quirks, and some take days just to get an account approved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Many customers in one system.&lt;/strong&gt; If you're selling to businesses, keeping each customer's data apart has to be designed in from day one. It's much cheaper to build it in than to add it later.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs to build with me
&lt;/h2&gt;

&lt;p&gt;These are the "from" prices on my site, in USD:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MVP scoping and technical plan: $400.&lt;/strong&gt; A call, a feature spec, user flows, the architecture, a milestone plan and a fixed quote for the build, in about five days. The plan is yours to keep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MVP with web app, API and admin panel: from $8,000.&lt;/strong&gt; Usually 4–8 weeks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MVP plus Android and iOS apps: from $15,000.&lt;/strong&gt; Usually 8–12 weeks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The final price is fixed in writing before work starts and paid by milestone, where each milestone is something you can click through and check yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd cut from month one
&lt;/h2&gt;

&lt;p&gt;The fastest way to lower the cost is to build less, and most first versions can lose more than their founders expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your own login system.&lt;/strong&gt; Use email login or a proven provider, not a custom one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An admin panel for everything.&lt;/strong&gt; Build admin screens only for the things you'll change every week. Edit the rest directly for now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every payment method.&lt;/strong&gt; Start with the one your first customers actually use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The mobile app, sometimes.&lt;/strong&gt; A web app that works well on phones is enough to test whether people want the product.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reports and dashboards.&lt;/strong&gt; Until you have real data, a spreadsheet export is fine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The one thing I wouldn't cut is the core rule your product can't get wrong, like &lt;a href="https://nazmulkhalid.com/ideas/preventing-double-booking-in-a-real-time-appointment-system" rel="noopener noreferrer"&gt;two patients booking the same slot&lt;/a&gt;, or one customer seeing another's data. That has to be right from day one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The costs nobody puts in the first quote
&lt;/h2&gt;

&lt;p&gt;A launched product keeps costing money, and it's better to know that before you start:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Servers and hosting.&lt;/strong&gt; Usually modest at MVP scale, but it's a monthly bill.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Third-party services.&lt;/strong&gt; Email, SMS, maps and payment fees grow with your users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App store accounts.&lt;/strong&gt; Apple charges $99 a year and Google $25 once, if you have mobile apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintenance.&lt;/strong&gt; Bug fixes, security updates and dependency upgrades don't stop. My maintenance plan starts from $750 a month, and server care from $150 a month per server.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A focused web MVP: usually 4–8 weeks. With mobile apps: 8–12 weeks.&lt;/li&gt;
&lt;li&gt;User roles, payments, real-time features, mobile apps and integrations move the price most.&lt;/li&gt;
&lt;li&gt;Cut everything that isn't needed to test the idea, but never the one rule your product can't get wrong.&lt;/li&gt;
&lt;li&gt;Budget for running costs after launch, not just the build.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're not sure what your first version should include, that's exactly what the &lt;a href="https://nazmulkhalid.com/hire" rel="noopener noreferrer"&gt;$400 scoping week&lt;/a&gt; is for.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Nazmul Khalid, a lead software engineer. I build SaaS products and MVPs for founders. How I work, and what it costs, is on &lt;a href="https://nazmulkhalid.com/hire" rel="noopener noreferrer"&gt;my hire page&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>startup</category>
      <category>saas</category>
      <category>mvp</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Enforcing Multi-Tenant Isolation Structurally, Not by Convention</title>
      <dc:creator>Nazmul Khalid</dc:creator>
      <pubDate>Tue, 13 Oct 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/technonazmul/enforcing-multi-tenant-isolation-structurally-not-by-convention-4870</link>
      <guid>https://dev.to/technonazmul/enforcing-multi-tenant-isolation-structurally-not-by-convention-4870</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nazmulkhalid.com/ideas/enforcing-multi-tenant-isolation-structurally" rel="noopener noreferrer"&gt;nazmulkhalid.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Relying on every query to remember &lt;code&gt;WHERE schoolId = ...&lt;/code&gt; doesn't survive a real codebase. Bicitra EMS injects the tenant scope automatically with a Prisma Client Extension, but a nested &lt;code&gt;include&lt;/code&gt; still bypassed it and leaked one school's data through seven endpoints. The fix was structural: a central registry of tenant-scoped foreign keys, validated at write time, so new endpoints are protected by default.&lt;/p&gt;

&lt;p&gt;Bicitra EMS is a multi-tenant education management system: one shared platform, any number of schools, each school's data supposed to be fully invisible to every other school. Tenant isolation is the one property a multi-tenant SaaS cannot get partially right — a single leaked row is a data breach, not a bug ticket.&lt;/p&gt;

&lt;h2&gt;
  
  
  The convention that almost worked
&lt;/h2&gt;

&lt;p&gt;Every tenant-scoped table in the system carries a &lt;code&gt;schoolId&lt;/code&gt; column. The straightforward way to enforce isolation is convention: every query that touches a tenant table includes a &lt;code&gt;WHERE schoolId = ...&lt;/code&gt; clause, and every engineer remembers to add it.&lt;/p&gt;

&lt;p&gt;That convention doesn't scale past the first missed line. So instead of trusting each call site, isolation is applied by a Prisma Client Extension that intercepts queries and injects the tenant scope automatically — a caller doesn't get the chance to forget the clause, because the clause isn't theirs to write.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the convention still had a gap
&lt;/h2&gt;

&lt;p&gt;Automated testing is what actually found the problem: 225 API tests running against a real Postgres instance, as part of a 338-test suite that also covered browser and mobile flows. Tenant isolation is exactly the kind of property a mock can't validate — a mocked database can't tell you whether your real query actually stayed inside its tenant boundary.&lt;/p&gt;

&lt;p&gt;The tests found a defect in code that had already been marked done: a &lt;strong&gt;nested Prisma &lt;code&gt;include&lt;/code&gt; on a relation is evaluated as part of its parent query and never gets routed back through the extension that owns tenant scoping.&lt;/strong&gt; A fee invoice, an attendance record, or a salary row referencing another school's student ID would pull that other school's guardian details and QR gate-scan credential straight back out — reachable through seven different endpoints, none of which looked wrong in isolation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing the class of bug, not the seven instances
&lt;/h2&gt;

&lt;p&gt;Patching each of the seven endpoints individually would have left the same gap open for the eighth endpoint someone writes next month. Instead, the fix is structural: every inbound tenant-scoped foreign key is declared in one central registry and validated at write time, inside the same extension that already owns tenant scoping. A new endpoint gets the protection automatically, because the registry — not the endpoint author's memory — is what enforces it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters beyond one bug
&lt;/h2&gt;

&lt;p&gt;"We enforce tenant isolation with an ORM extension" sounds airtight until you remember that ORMs have edge cases — relation includes, raw queries, batch operations — that don't always route through the same code path as a normal query. The lesson isn't "use a query extension." It's narrower and more useful than that: &lt;strong&gt;whatever mechanism you use to enforce a security invariant, assume it has at least one code path that bypasses it, and go looking for that path with real tests before an attacker — or another tenant — finds it for you.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The same test pass caught two other real defects: a double-payment race condition from two simultaneous "pay now" taps, and a gate console accidentally exposing password hashes to the lowest-privilege role in the building. None of the three were found by code review. All three were found by tests that exercised real concurrency and real data, not mocks.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Nazmul Khalid, a lead software engineer. I build multi-tenant SaaS products and review existing codebases for founders. The Bicitra EMS case study is &lt;a href="https://nazmulkhalid.com/work/bicitra-ems" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and more on how I review code is &lt;a href="https://nazmulkhalid.com/services/technical-leadership" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>saas</category>
      <category>database</category>
      <category>security</category>
      <category>postgres</category>
    </item>
    <item>
      <title>How to Hire a Remote Developer Without Getting Burned</title>
      <dc:creator>Nazmul Khalid</dc:creator>
      <pubDate>Fri, 09 Oct 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/technonazmul/how-to-hire-a-remote-developer-without-getting-burned-206c</link>
      <guid>https://dev.to/technonazmul/how-to-hire-a-remote-developer-without-getting-burned-206c</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nazmulkhalid.com/ideas/how-to-hire-a-remote-developer-without-getting-burned" rel="noopener noreferrer"&gt;nazmulkhalid.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most remote hires that go wrong don't fail because the developer couldn't code. They fail because of things nobody checked before the contract was signed.&lt;/p&gt;

&lt;p&gt;The founder finds out three months in that the developer only worked on a small part of the portfolio project. Or the code sits in the developer's own GitHub, and the server runs on their credit card. Or the invoices kept coming while the product never quite got to a state anyone could try.&lt;/p&gt;

&lt;p&gt;I'm writing this from the other side of the table. I've spent more than 10 years building software for clients, most recently as lead engineer on products like DocBee and BD Doctors Directory. These are the five things I'd check if I were hiring someone like me.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Find out which part they actually built
&lt;/h2&gt;

&lt;p&gt;A portfolio shows you a finished product. It doesn't tell you who did what.&lt;/p&gt;

&lt;p&gt;Pick one project and ask them to walk you through a single decision they made on it, and why. You don't need to follow every technical detail. You're listening for whether they can explain it from the inside.&lt;/p&gt;

&lt;p&gt;For example, if you asked me about DocBee, a telemedicine app I was lead engineer on, I'd tell you why the booking system &lt;a href="https://nazmulkhalid.com/ideas/preventing-double-booking-in-a-real-time-appointment-system" rel="noopener noreferrer"&gt;lets the database refuse a second booking for the same slot&lt;/a&gt; instead of trusting the app to check. I'd also tell you what goes wrong if you do it the other way. That's the kind of answer you're looking for: specific, and clearly theirs.&lt;/p&gt;

&lt;p&gt;A good answer sounds like "I designed the API and built both mobile apps." A vague one sounds like "we built it", with nothing more when you ask.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Ask how they'd stop your worst bug
&lt;/h2&gt;

&lt;p&gt;Every product has one thing that must never go wrong. For a booking app, it's two customers getting the same slot. For software sold to many businesses, it's one customer seeing another customer's data. For anything that takes payments, it's charging someone twice.&lt;/p&gt;

&lt;p&gt;Ask the developer what your worst bug is and how they'd prevent it.&lt;/p&gt;

&lt;p&gt;The answer you want sounds like "the database won't allow it" or "there's a test that tries to break it on every change". The answer to worry about is "we'll be careful".&lt;/p&gt;

&lt;p&gt;Being careful doesn't hold up. On a &lt;a href="https://nazmulkhalid.com/work/bicitra-ems" rel="noopener noreferrer"&gt;school management system&lt;/a&gt; I built, I wrote 338 automated tests for code I had already called finished. They found six real bugs. One of them let a school read another school's data. Careful wasn't enough, and I was the one being careful.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Own the code and the accounts from day one
&lt;/h2&gt;

&lt;p&gt;This is the one I'd push hardest on, and it's the one that gets skipped most.&lt;/p&gt;

&lt;p&gt;Before any work starts, set these up in your own name and invite the developer in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The code repository.&lt;/strong&gt; Create a GitHub or GitLab organisation for your company and add the developer to it. Don't let the only copy of your code live in their personal account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The cloud or hosting account.&lt;/strong&gt; Your name, your card. They get access, not ownership.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The domain.&lt;/strong&gt; Registered to you, at a registrar you can log in to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App store accounts.&lt;/strong&gt; Apple and Google developer accounts in your company's name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Third-party services.&lt;/strong&gt; Payment gateways, email providers, maps and so on, with your company as the account holder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then get the contract to say that the rights to the work pass to you once it's paid for. Add an NDA if the idea needs one. I'm not a lawyer, so for anything unusual, have a lawyer look at the contract.&lt;/p&gt;

&lt;p&gt;If the code lives in the developer's account and the server runs on their card, you don't really own your product. You're renting it. And you usually find that out at the worst moment, when the relationship ends.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Pay for milestones you can click through
&lt;/h2&gt;

&lt;p&gt;Hourly billing with no clear milestones is how budgets drift. Nobody is doing anything wrong, and the product still never quite gets finished.&lt;/p&gt;

&lt;p&gt;Split the work into milestones you can check yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a login that works&lt;/li&gt;
&lt;li&gt;a booking you can actually make&lt;/li&gt;
&lt;li&gt;a payment that shows up in the admin panel&lt;/li&gt;
&lt;li&gt;the app installed on your own phone from a test link&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pay when each one works, not because a month has gone by. For fixed-price work, a deposit of 30–50% upfront with the rest paid by milestone is normal. That's how I work too, and it protects both sides.&lt;/p&gt;

&lt;p&gt;If you're unsure about a developer, start with something small and paid: a &lt;a href="https://nazmulkhalid.com/hire" rel="noopener noreferrer"&gt;scoping plan or a review of your existing code&lt;/a&gt;. You'll learn how they think, how they write things down and how they handle your questions, before you commit to a big build.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Agree how you'll hear from them
&lt;/h2&gt;

&lt;p&gt;Time zone overlap matters less than people think. Updates matter more.&lt;/p&gt;

&lt;p&gt;Before you start, agree what a normal week looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When you'll talk live.&lt;/strong&gt; One or two calls a week in your overlap hours is usually enough.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What you'll get in writing on the other days.&lt;/strong&gt; A short update: what's done, what's next, and anything blocking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where you can see progress.&lt;/strong&gt; A test version of the app you can open any time, not just screenshots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What happens when they're stuck.&lt;/strong&gt; You want to hear about a problem the day it shows up, not at the next deadline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Being far apart can help. I work 05:00–23:00 Bangladesh time, which covers the whole UK, European and Gulf working day. For US teams, we talk in their morning and the work moves forward overnight.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick checklist before you sign
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;They walked you through one real decision on a past project, in their own words.&lt;/li&gt;
&lt;li&gt;They named your worst bug and explained how they'd stop it.&lt;/li&gt;
&lt;li&gt;The repo, cloud account, domain and app store accounts are in your name.&lt;/li&gt;
&lt;li&gt;The contract gives you the rights to the work once it's paid for.&lt;/li&gt;
&lt;li&gt;Payment is tied to milestones you can click through.&lt;/li&gt;
&lt;li&gt;You've agreed when you'll talk and how you'll get updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is complicated. It's just easy to skip when you're excited to get started. A good developer won't mind any of it. The good ones would rather you checked.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Nazmul Khalid, a lead software engineer. I build SaaS products and MVPs for founders. How I work, and what it costs, is on &lt;a href="https://nazmulkhalid.com/hire" rel="noopener noreferrer"&gt;my hire page&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>startup</category>
      <category>hiring</category>
      <category>freelance</category>
      <category>career</category>
    </item>
    <item>
      <title>Preventing Double-Booking in a Real-Time Appointment System</title>
      <dc:creator>Nazmul Khalid</dc:creator>
      <pubDate>Wed, 30 Sep 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/technonazmul/preventing-double-booking-in-a-real-time-appointment-system-55l0</link>
      <guid>https://dev.to/technonazmul/preventing-double-booking-in-a-real-time-appointment-system-55l0</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nazmulkhalid.com/ideas/preventing-double-booking-in-a-real-time-appointment-system" rel="noopener noreferrer"&gt;nazmulkhalid.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Checking a slot is free in application code and then writing the booking breaks when two requests arrive together. In DocBee, a telemedicine app I was lead engineer on, the database enforces it instead. A unique index on doctor + date + slot refuses the second hold, a TTL index clears abandoned holds, and one transaction covers the booking, the payment ledger entry and removing the hold.&lt;/p&gt;

&lt;p&gt;A telemedicine marketplace lives or dies on one guarantee: when a patient taps "book," that slot is theirs. If two patients can end up holding the same doctor's slot at the same time, the product doesn't work — a doctor shows up to a double-booked consultation, or a patient pays for a slot that's already gone.&lt;/p&gt;

&lt;p&gt;The obvious first approach is to check-then-write in application code: read the slot, confirm it's free, then create the booking. That works until two requests arrive close enough together that both read "free" before either writes. Under real traffic, "close enough together" happens more often than people expect, and a race condition that only shows up under concurrent load is one of the worst kinds of bug to chase — it won't reproduce in a manual test, and it won't show up in a demo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Push the constraint into the database
&lt;/h2&gt;

&lt;p&gt;DocBee doesn't try to prevent the race in application code at all. When a patient picks a slot, the API creates a hold document with a MongoDB unique compound index on &lt;code&gt;doctor&lt;/code&gt;, &lt;code&gt;date&lt;/code&gt;, and &lt;code&gt;slot&lt;/code&gt;. If a second, simultaneous hold attempt targets that exact combination, the database rejects the write outright — it fails at the storage layer, not inside application logic that has to remember to check correctly every single time.&lt;/p&gt;

&lt;p&gt;This is a meaningfully different guarantee than an application-level check. A unique index is enforced by the database itself, on every write, regardless of which code path created it, how many API instances are running, or whether a future engineer forgets to add the check to a new endpoint. The invariant lives in the schema, not in someone's memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleaning up abandoned holds without a cron job
&lt;/h2&gt;

&lt;p&gt;Locking a slot the instant a patient starts checkout raises an obvious follow-up problem: what happens if they abandon the flow? The slot can't stay locked forever.&lt;/p&gt;

&lt;p&gt;Rather than run a scheduled job to sweep for stale holds, the hold document carries a MongoDB TTL index. The document expires and is removed automatically once its window passes — no cleanup process to write, deploy, monitor, or forget to run. The slot frees itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the booking atomic, and making it visible
&lt;/h2&gt;

&lt;p&gt;Confirming a booking touches more than one piece of state: the booking record itself, a payment ledger entry, and the removal of the hold. All three happen inside a single MongoDB transaction, so there's no window where a booking exists without its payment record, or a hold lingers after a booking is confirmed.&lt;/p&gt;

&lt;p&gt;The last piece is making the result visible immediately to everyone else looking at that doctor's calendar. Once the transaction commits, Socket.IO broadcasts the update, so a slot disappears from other patients' screens the instant it's taken — instead of them finding out only when their own booking attempt fails against a database constraint they never saw coming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;Application code is a bad place to enforce an invariant that absolutely cannot be violated. Database constraints (unique indexes, TTL indexes, transactions) exist precisely because they're enforced consistently, under concurrency, regardless of which code path or how many server instances are involved. Where a business rule is truly non-negotiable — "this slot has exactly one owner" — push it as close to the data as the database will let you.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Nazmul Khalid, a lead software engineer. I build multi-tenant SaaS products and MVPs for founders. The full DocBee case study is &lt;a href="https://nazmulkhalid.com/work/docbee" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and more write-ups like this one are on &lt;a href="https://nazmulkhalid.com/ideas" rel="noopener noreferrer"&gt;my site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>architecture</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
