How to Add a Database to an iPhone App Without a Backend (2026)

Add a database to an iPhone app without setting up a backend: on the phone or in the cloud, privacy rules, sync, costs, and the steps with Borel.

By Sigsten Gustavii· · 8 min read

To add a database to an iPhone app, decide whether the data stays on one phone or must be shared, pick on-device storage or a cloud database, define the tables and who may read each one, and connect the app's screens to it. In a Borel app, you describe what the app should remember and Borel declares the tables, the rules and the storage.

On-phone or cloud: which database an app needs
QuestionOn the phone (SwiftData)In the cloud (Borel Cloud)
Works offline?Yes, alwaysNeeds a connection to save and load
Syncs between devices?NoYes, with an account
Shared between people?NoYes, with access rules
Needs an account?NoYes, for anything private or shared
Running costNonePay as you go, from the app's balance
Good forHabits, journals, notes, personal logsSocial feeds, shared lists, marketplaces, bookings

"Add a database" sounds like one decision, but it is really two: where the data lives, and who may see it. Get those right and the rest is screens. This guide explains both in plain words, then shows how Borel builds it.

On the phone: SwiftData

For data that belongs to one person on one phone, Apple's SwiftData keeps it on the device. The app opens instantly, works on a plane, and costs nothing to run. Borel uses it for apps like a habit tracker, a journal, a budget app or a workout log; see offline data.

The trade-off: data on one phone doesn't follow someone to a new phone unless they restore a backup, and it can't be shared with a partner. When either matters, it's time for the cloud.

In the cloud: Borel Cloud

When the app needs shared or synced data, Borel gives it Borel Cloud: a Postgres database, email sign-in and file storage, run by Borel. There is no account to create with a database company, no key to paste, and no server to deploy. You don't write SQL; Borel declares the tables from what the app needs.

What Borel declares for each kind of data
What you describeWhat Borel creates
"People save recipes"A recipes table with an owner, private to them
"Comments on a post"A comments table related to posts, readable when the post is
"Likes, with a count"A likes table and a count on each post the database keeps up to date
"Search by title and notes"A search field over those columns
"One check-in per day"A rule that allows one row per day
"Upload a photo"A file in the app's storage, with its path in the row

Who can read what: access rules

The most important part of a cloud database is the rule on each table. Borel picks one of a small set, and the database enforces it, so it holds even if someone calls the database without the app:

Access rules in a Borel app's database
RuleWho readsWho writesExample
PrivateThe owner (and someone named, if chosen)The ownerJournal entries, saved items
Public read, owner writeEveryone signed in, or everyoneThe ownerProfiles, listings, posts
FollowersThe owner and their followersThe ownerPosts in a follow-based feed
ParticipantsMembers of a conversationMembersDirect messages
GroupMembers of a shared groupOwners and editorsA family shopping list, a team's tasks
InheritWhoever can read the parentDepends on the parentLikes and comments on a post

Groups come with invite codes and roles (owner, editor, viewer), so "share this list with my partner" is a sentence, not a project.

Changing the database later

Apps grow, and the database grows with them. When you ask for a new field or table, Borel declares the change and runs it. A field added to a table that already has rows gets a default, so existing data stays valid. Before a change to a field's type or a table's access rule, Borel saves a restore copy, and for an app already on the App Store such a change waits for you to approve it. You never type a migration by hand.

Files and photos

Pictures and documents don't belong in database rows. Borel uploads them to the app's own file storage and keeps their path in the row, and screens show them from there. Uploads count toward the app's storage costs, and a person's files are removed when they delete their account.

Common database mistakes, and how to avoid them

  1. Putting everything in the cloud. Data that only one person uses on one phone is faster, free and offline in SwiftData. Move it to the cloud when sharing or syncing needs it.
  2. Rules only in the app. If the only thing keeping data private is a filter in the app's code, anyone who calls the database directly can read it. Rules belong in the database, which is where Borel puts them.
  3. Storing pictures in rows. Large files slow every list down. Keep them in file storage and store the path.
  4. Counting on the phone. Adding up likes on the phone gets slow and wrong as data grows. Let the database keep the count.
  5. Inventing sample data. Fake rows in a real app confuse people and reviewers. Borel's builder is told never to insert invented rows into a live database.
  6. Forgetting deletion. When someone deletes their account, their rows and files have to go too. Plan for it from day one.

Apple's rules that touch your data

Apple's rules for apps that store personal data
GuidelineWhat Apple asksIn a Borel app
5.1.1(v) Account deletionDelete account in the appRemoves the person's rows and files, then the sign-in
5.1.1(i) Privacy policySay what you collect and whyBorel hosts a policy that covers its cloud use
5.1.1(v) Login only when neededNo login without account-based featuresOn-phone data needs no account
2.1 CompletenessA working back end during reviewBorel Cloud stays on; add a demo account

When you fill in App Store Connect's app privacy details, list what the cloud stores, such as email addresses and content people post.

What a database costs

Database costs for a Borel app
ItemCostNotes
On-phone data$0SwiftData on the device
Borel CloudPay as you goDatabase, sign-in and storage from your app's balance
BuildingCredits, from 5 credits a dayPro from $20 a month for more
PublishingPro plus $99 a year to AppleNeeded for the App Store

See pricing, and Cloud cost in the workspace for what each app uses.

How to choose the right database setup

  • Borel, for an iPhone app where you describe the data and get SwiftData or a cloud database with access rules, sign-in and storage, without a backend to run.
  • Firebase or Supabase by hand, if you write the app in Xcode and want to manage the service, its rules and its bill yourself.
  • Apple's CloudKit, if you are a Swift developer and want data in each person's own iCloud; Borel apps don't use it.
  • [CatDoes](/compare/catdoes), if you need Android too; it has its own cloud for React Native apps.

How to do it with Borel, step by step

Step 1: Say what the app remembers

In plain words, list the things the app keeps, who owns each, and who else sees it. Borel decides the tables.

A prompt to start from
Keep a shared shopping list for a household. Anyone can create a household and invite others with a code. Every member can add, tick and remove items; each item remembers who added it. Each person also has private favourite products only they see. Let people search items by name.

Step 2: Check the data with two accounts

In the iOS Simulator in your browser, make two accounts. Join one household from both, add items from each, and confirm a third account outside the household sees nothing.

Step 3: Add to it as the app grows

Ask for new things in plain words: "add a quantity to each item", "keep a history of what we bought". Borel declares each change and keeps existing data.

Step 4: Publish

Stamp checks the app, and Publish builds and uploads it under your Apple Developer account. Add a demo account in a household with items so Apple's reviewer can see the shared list.

The Bottom Line

A database is two decisions: where data lives and who may read it. Borel keeps personal data on the phone with SwiftData and shared data in Borel Cloud, with access rules enforced by the database, uploads in storage and account deletion that really deletes. Describe what your app should remember in Borel and test it with two accounts on a live iPhone.

Questions people ask

Can I add a database to an iPhone app without a backend?

Yes. On-phone data needs none, and Borel apps that need a cloud database get Borel Cloud, a Postgres database with sign-in and storage that Borel runs, with no setup.

What database do iPhone apps use?

On the phone, usually Apple's SwiftData or Core Data. In the cloud, anything from Postgres to Firebase. Borel apps use SwiftData on the phone and Postgres in Borel Cloud.

Is SwiftData or a cloud database better?

SwiftData for data that belongs to one person on one phone; it is free and works offline. A cloud database when data must sync between devices or be shared between people.

How do I keep each person's data private?

With access rules enforced in the database, not only in the app. Borel declares a rule for every table, such as private to its owner or readable by a group's members.

Do I need to know SQL?

No. You describe what the app remembers, and Borel declares the tables, relations, indexes and rules.

What happens to my data when I change the app?

Borel changes the tables without losing rows. New fields get defaults, and before a change to a field's type or access rule it saves a restore copy.

How much does a cloud database cost for a small app?

In a Borel app it is pay as you go from the app's balance, so a small app with few people costs little. Cloud cost in the workspace shows what each app uses.

Can people share data, like a family list?

Yes. Borel's groups have invite codes and roles, so members of a household or a team see and edit the same items.

I started Borel because I wanted to make iPhone apps without a Mac or a team behind me. If this helped you build something, I would love to see it.

– Sigsten

Make your iPhone app in Borel

Describe the app you want and see its first screens before you pay anything.

See your app free

Keep reading