Architecture pattern: applications and APIs

Mobile app backend architecture: sign-in, data, files and push

A mobile app needs a back end for sign-in, data, files and push messages. You can use a ready-made backend service or build your own API. Here is how the pieces fit, which service plays each part on AWS, Azure and Google Cloud, and what to decide first.

Quick answer

A mobile app backend gives the app sign-in, an API behind a gateway, a database for app data, object storage for photos and files, and push messages or SMS codes sent back to the phone. A backend-as-a-service product bundles most of these, or you can assemble the parts yourself.

The Mobile app back end pattern at a glance
Best foriOS and Android apps with user accounts, synced data, photo uploads and notifications
Less suited whenA purely offline app with no accounts or shared data
Start withA backend-as-a-service for sign-in and data, then your own API where it falls short
Main services on AWSAWS End User Messaging, Amazon Cognito, Amazon S3, Amazon API Gateway, AWS Amplify, Amazon DynamoDB
Main services on AzureAzure Communication Services, Microsoft Entra External ID, Azure Blob Storage, Azure API Management, Azure Functions + Azure Cosmos DB, Azure Cosmos DB
Main services on Google CloudFirebase Cloud Messaging, Identity Platform, Cloud Storage, API Gateway, Firebase, Firestore

The idea in plain words

A mobile app is only the visible part. Behind it sit sign-in, storage for the app's data and files, an API the app calls, and a way to reach users when the app is closed: push notifications and SMS codes.

Two approaches are common. A backend-as-a-service bundles sign-in, database, files and push into one product and is the fastest to start. Or you assemble the parts yourself behind an API gateway, which gives more control.

Plan for slow and offline networks: keep requests small, keep data on the phone, and handle failures gracefully.

The architecture

Boxes show the job each part does. Pick a cloud to see the service for each job.

Mobile app back end: architecture diagramTwo rows of boxes. The numbered steps below describe the same flow in words.alerts and codessign-inphotos and filesdata back to the app1. Messages, sign-in and filesPush and SMSSends alerts and one-time codesAWS End UserMessagingAzureCommunicationServicesFirebase CloudMessagingSign-inRegisters and signs inusersAmazon CognitoMicrosoft EntraExternal IDIdentity PlatformFile storagePhotos and documentsAmazon S3Azure Blob StorageCloud Storage2. Handle a requestMobile appYour iOS or AndroidappAPI front doorChecks and limitscallsAmazon API GatewayAzure APIManagementAPI GatewayMobile back endApp logic and APIsAWS AmplifyAzure Functions +Azure Cosmos DBFirebaseApp databaseDocuments and settingsAmazon DynamoDBAzure Cosmos DBFirestoreMobile app back end: architecture diagramBoxes from top to bottom. The numbered steps below describe the same flow in words.alerts and codessign-inphotos and files1. Messages, sign-in and filesFile storagePhotos and documentsAmazon S3Azure Blob StorageCloud StorageSign-inRegisters and signs in usersAmazon CognitoMicrosoft Entra External IDIdentity PlatformPush and SMSSends alerts and one-time codesAWS End User MessagingAzure Communication ServicesFirebase Cloud Messaging2. Handle a requestMobile appYour iOS or Android appAPI front doorChecks and limits callsAmazon API GatewayAzure API ManagementAPI GatewayMobile back endApp logic and APIsAWS AmplifyAzure Functions + AzureCosmos DBFirebaseApp databaseDocuments and settingsAmazon DynamoDBAzure Cosmos DBFirestore↩ data back to the app, back to mobile app
Arrows show the direction of the flow, and dashed lines connect the rows. Each box names the main service for that job, taken from CloudBrum's service suggester.

Step by step

  1. The app opensThe user opens the app, which shows saved data from the phone while it checks the network.
  2. The user signs inThe sign-in service registers users, checks their credentials and hands the app a signed token to attach to every call.
  3. The app calls the APIEach request carries the token. An API gateway checks it, applies limits and passes valid calls to the back end.
  4. The back end applies the rulesThe back end, either a backend-as-a-service or your own code, validates the request and reads or writes data.
  5. Data is storedApp data such as profiles and settings goes into a document or key-value database that scales with the number of users.
  6. Files go to object storagePhotos and documents upload directly to object storage with short-lived links, so the API is not a bottleneck.
  7. The phone is reached when closedPush notifications and SMS codes are sent through a messaging service, and the app handles them when it is opened.

Services side by side

The main service for each job on each cloud, with a second option where one exists. Names checked on 23 October 2026.

Services for each job in this architecture on AWS, Azure and Google Cloud
JobAWSAzureGoogle Cloud
SMS, push notifications and OTP
  • AWS End User MessagingSMS, voice, push and WhatsApp messaging APIs (replaces Pinpoint messaging)
  • Amazon SNS
  • Azure Communication Services (SMS)Sends SMS and manages phone numbers; also WhatsApp messaging
  • Azure Notification Hubs
  • Firebase Cloud MessagingFree push notifications to Android, iOS and web
  • Partner SMS provider (Twilio)
Customer sign-up and login
  • Amazon CognitoUser sign-up and sign-in, social login, MFA and tokens for your apps
  • Microsoft Entra External IDCustomer identity for apps; replaces Azure AD B2C for new projects
  • Identity PlatformCustomer sign-in for apps, built on Firebase Authentication
Object storage (files, images, backups)
  • Amazon S3Durable object storage for files, images, backups and data lakes
  • Azure Blob StorageObject storage for unstructured data, with hot, cool and archive tiers
  • Cloud StorageObject storage with Standard, Nearline, Coldline and Archive classes
Publish and secure APIs
  • Amazon API GatewayCreate, secure and monitor REST, HTTP and WebSocket APIs; pairs with Lambda
  • Azure API ManagementFull API gateway with policies, developer portal and analytics
  • API GatewaySimple managed gateway for serverless back ends
  • Apigee API Management
Mobile or web app back end (login, data, push)
  • AWS AmplifyAuth, data, storage, APIs and hosting for web and mobile apps
  • AWS AppSync
  • Azure Functions + Azure Cosmos DBThe usual Azure pattern for app APIs and data; add Entra External ID for sign-in and Notification Hubs for push
  • FirebaseGoogle's app platform: authentication, Firestore, push messaging, hosting and analytics
  • Firestore
NoSQL document or key-value database
  • Amazon DynamoDBServerless key-value and document database with single-digit-millisecond reads
  • Amazon DocumentDB
  • Azure Cosmos DBGlobally distributed NoSQL with APIs for NoSQL, Cassandra, Gremlin and Table
  • Azure DocumentDB
  • FirestoreServerless document database with real-time sync and MongoDB compatibility

Common variations

  • Real-time features such as chat or live updates. Add a real-time channel, such as WebSockets or a managed real-time service, so the app receives changes without asking.
  • The app must work offline. Store data on the phone, queue changes and sync them when the network returns, with rules for conflicts.
  • Users in several countries. Use a CDN for files, keep data in the right region for local rules and test on slow networks.
  • Payments or sensitive data. Keep card details with a payment provider, and add stricter sign-in, logging and review.

Try this in the service suggester

Backend-as-a-service or build your own API?

Each cloud offers a ready-made mobile back end that bundles sign-in, data, files and push, shown in the table above as the mobile back end. Or you build the API and database yourself.

Backend-as-a-service

Good

  • Fastest start for a small team
  • Sign-in, database, files and push in one product
  • Client libraries for iOS and Android

Watch out

  • Less control over data layout and logic
  • Pricing can jump with usage
  • Moving away later takes work

Your own API

Good

  • Full control of data, logic and cost
  • The same back end can serve web, mobile and partners
  • Choose any database and language

Watch out

  • More to build, secure and run
  • You assemble sign-in, files and push yourself
  • Slower to a first release
A common path. Start with a backend-as-a-service to ship quickly, and move parts to your own API when you need control or lower cost at scale.

Keep in mind

  • Tokens and sign-in. Use a sign-in service with short-lived tokens and multi-factor sign-in, and keep tokens in the phone's secure storage. Never put secrets in the app, because apps can be unpacked.
  • Push and SMS rules. Ask permission before push messages, send only useful ones, and follow telecom rules for SMS codes, including opt-out and sender registration where required.
  • Slow and offline networks. Keep payloads small, show saved data first, retry safely and test on slow connections.
  • App updates. Old app versions stay in use for months. Version your API and keep older versions working until few people use them.
  • Cost. Cost grows with active users, database reads and writes, file storage and messages. Estimate per 1,000 users and set budget alerts.
  • Privacy. Collect only what the app needs and explain it clearly. App stores ask for a privacy declaration, and laws such as the GDPR or India's DPDP Act apply. Let users delete their account and data.
  • Abuse and limits. Rate-limit sign-in and message sending, and watch for fake accounts and bots.
A starting point, not a design review. This is a general pattern. Your documents, users, rules and budget decide the real design. Confirm features, limits, pricing and regions on each provider's own pages. CloudBrum is independent of AWS, Microsoft and Google.

Words used on this page

Services in this pattern that have changed

Cloud providers rename and retire services often. These affect the parts above. Checked on 23 October 2026.

  • AWS Retiring Amazon Pinpoint ends support on 30 October 2026. SMS, voice and push continue as AWS End User Messaging; for email AWS recommends Amazon SES. Details
  • Azure Closed to new customers Azure AD B2C has not been sold to new customers since 1 May 2025. Microsoft Entra External ID is the replacement for new projects. Details
  • Azure Renamed Azure Cosmos DB for MongoDB (vCore) is now Azure DocumentDB. Details

Sources and further reading

Check details such as features, limits, prices and regions in the providers' own documentation.

Announcements about the changed services above

Frequently asked questions

What is a mobile app backend?

It is the server side of a mobile app: sign-in, data storage, file storage, business logic and push messages that the phone cannot do alone, reached through an API.

What is a backend-as-a-service?

A backend-as-a-service is a ready-made product that bundles sign-in, a database, file storage and push notifications, with libraries for mobile apps, so you write little server code.

Which database is best for a mobile app?

Document or key-value databases suit most app data and scale easily. Use a relational database when you need strict relationships and reports. Many apps use both.

How do push notifications work?

The app registers with the phone's push service and gives your back end a token. Your back end sends a message to a messaging service, which delivers it to that phone, even when the app is closed.

How do I secure a mobile app's API?

Require a token from a sign-in service on every call, check it at an API gateway, apply rate limits, validate input and never rely on secrets stored inside the app.

Want this reviewed for your case?

CloudBrum architects can adapt this pattern to your documents, users, rules and budget, and estimate the cost. Nothing is sent until you choose.

Building something else?

Describe it in plain words and get matching services on all three clouds.

Service suggester → Cloud consulting →