MongoDB Stitch FAQ

Introduction to Stitch

MongoDB Stitch is a serverless platform which accelerates application development with simple, secure access to data and services from the client – getting your apps to market faster while reducing operational costs and effort.

What is MongoDB Stitch?

Back to Table of Contents

The MongoDB Stitch serverless platform accelerates application development with simple, secure access to data and services from the client – getting your apps to market faster while reducing operational costs and effort.

The Stitch serverless platform provides four services:

  • Stitch QueryAnywhere. Exposes the full power of working with documents in MongoDB and the MongoDB query language, directly from your web and mobile application frontend code. A powerful rules engine lets developers declare fine-grained security policies.

    • Allow a doctor to read medical records for just their patients; allow a nurse to check for allergies and record test results; allow an administrator to execute real-time aggregations to find which doctors or services are keeping patients waiting longest.
  • Stitch Functions. Allows developers to run simple JavaScript functions in Stitch’s serverless environment, making it easy to create secure APIs or to build integrations with microservices and server-side logic. Enables integration with popular cloud services such as Twilio, enriching your apps with a single Stitch method call.

    • Submit an expense claim to the database, and send a text notification to the approver – all with a single method call from the client application.
  • Stitch Triggers. Real-time notifications that launch functions in response to changes in the database. The functions can make further database changes, push data to other places, or interact with users – such as through push notifications, text messages, or emails.

    • Send an email to a customer when their account balance falls below a threshold.
  • Stitch Mobile Sync (coming soon). Automatically synchronizes data between documents held locally in MongoDB Mobile and the backend database. MongoDB Mobile allows mobile developers to use the full power of MongoDB locally. Stitch Mobile Sync ensures that data is kept up to date across phones and all other clients in real time.

    • Push gate changes to a mobile airline app, as they happen. Copy offline meal preferences to the backend when back online.

How do I build an app with MongoDB Stitch?

Back to Table of Contents

You should use the MongoDB Stitch console to configure the services that you want to use from your application – including MongoDB Atlas. You can optionally also define server-side JavaScript functions to compose multiple services calls into a single operation. By default, an end-user of your application may only access the data they created – you can add extra security/privacy rules to change that.

Once you have configured the MongoDB Stitch backend, you can access the services directly from your frontend application code using one of Stitch's native SDKs (available for iOS, Android, and JavaScript).

The best way to understand MongoDB stitch is to try it out for yourself by following the tutorial.

Is MongoDB Stitch Generally Available?

Back to Table of Contents

Yes, the MongoDB Stitch service went GA in June 2018. Stitch Mobile Sync will be available later. The availability levels are described in the MongoDB Stitch SLA.

Can I develop iOS apps with Stitch?

Back to Table of Contents

Yes, MongoDB Stitch provides a native iOS client SDK.

Can I develop Android apps with Stitch?

Back to Table of Contents

Yes, MongoDB Stitch provides a native Android client SDK.

Can I develop web apps with Stitch?

Back to Table of Contents

Yes, MongoDB Stitch provides a native JavaScript client SDK.

Where is MongoDB Stitch available?

Back to Table of Contents

MongoDB Stitch is currently available in AWS region us-east-1; it can work with Atlas clusters in other regions, but there may be some extra latency. We will roll MongoDB Stitch out to additional regions and cloud providers in the coming months.

How much does MongoDB Stitch cost?

Back to Table of Contents

You pay for both data transfer and compute usage (memory x time).

For data that you transfer to your frontend applications from Stitch, and from Stitch to your backend services (excluding Atlas), you will be charged $0.50 for each GB of data transferred.

You will be charged $0.000025 for each GB-second of compute consumed by your Stitch application.

Stitch provides a free tier:

  • The first 25 GB of data transfer per month is free.

  • The minimum of 1,000,000 requests and 100,000 GB-seconds compute per month are free.

Refer to the Stitch pricing page for more details and examples.

What kind of applications can I build on MongoDB Stitch?

Back to Table of Contents

MongoDB Stitch is designed to work with a broad set of applications. It is especially suitable if you plan on implementing most of your application's logic in the frontend – with the backend focussed on accessing the database and other public or internal services.

If you have an existing MongoDB database, then Stitch can be used to safely and selectively expose your existing data to new applications.

What scale does MongoDB Stitch support?

Back to Table of Contents

MongoDB Stitch intelligently provisions and manages compute across tens of thousands of applications making it simple for us to transparently scale to your workload at any point in time. Stitch scales automatically to cope with any workload that you throw at it.

What services does MongoDB Stitch integrate with?

Back to Table of Contents

MongoDB Stitch already integrates with many of your favorite public cloud services – including Facebook and Google for authentication, Twilio, AWS (S3 & SES), GCM, GitHub, and, of course, MongoDB Atlas. Use MongoDB Stitch's HTTP service to use any other public service or internal microservice.

We will continue to add new service integrations, and you also have the option to use MongoDB Stitch's HTTP service to access any service that presents a REST API.

Can I use my existing MongoDB database with MongoDB Stitch?

Back to Table of Contents

Yes, MongoDB Stitch works with any MongoDB Atlas cluster using version 3.4+.

If you want to open up data that you hold in an existing MongoDB Atlas database, then you can define security rules to selectively expose portions of the data to other applications through Stitch.

Can I still access my MongoDB database using any of the MongoDB drivers?

Back to Table of Contents

Yes, you have complete control of your MongoDB database. Your existing applications can continue to use the MongoDB drivers, you can perform analytics using the BI or Spark Connector, and new applications can use MongoDB Stitch.

Can I use MongoDB Stitch with a MongoDB cluster which is not in MongoDB Atlas?

Back to Table of Contents

Not at this time, but this is something in our roadmap.

How does MongoDB Stitch handle backups?

Back to Table of Contents

MongoDB Stitch automatically backs up all of your configured metadata to protect against data loss. There is no additional cost associated with backing up your metadata. You can also use the Stitch CLI to export your Stitch backend app as a series of folders and files, containing the JSON configuration data and JavaScript code for every authentication provider, service, function, and value. Once you've exported your app, you can back up the files or add them to a source control system such as GitHub.

MongoDB Atlas continuously backs up the data in your database, ensuring your backups are typically just a few seconds behind the operational system. MongoDB Atlas provides point-in-time backup of replica sets and consistent, cluster-wide snapshots of sharded clusters. With MongoDB Atlas, you can quickly and safely restore to precisely the moment you need.

What support is included with MongoDB Stitch?

Back to Table of Contents

MongoDB Stitch is covered under MongoDB Atlas support.

How is MongoDB Stitch priced for development, test, or QA environments?

Back to Table of Contents

MongoDB Stitch provides a generous free tier that should cover most development, test, and QA environments.

There are no pricing tiers for development, test, and QA environments. MongoDB Stitch is priced the same regardless of environment type.

Refer to the Stitch pricing page for more details and examples.

What is meant by "Serverless"?

Back to Table of Contents

Stitch represents the next stage in the industry's migration to a more streamlined, managed infrastructure. Virtual Machines running in public clouds (notably AWS EC2) led the way, followed by hosted containers, and serverless offerings such as AWS Lambda and Google Cloud Functions. With serverless systems, you don't need to pre-provision computing resources – you just send requests and rely on the provider to handle them.

Existing serverless offerings (sometimes referred to as "Functions as a Service" still require backend developers to implement and manage access controls and REST APIs to provide access to microservices, public cloud services, and of course data. Frontend developers were held back by needing to work with APIs that weren't suited to rich data queries.

The Stitch serverless platform addresses these challenges by providing four services:

  • Stitch QueryAnywhere. Exposes the full power of working with documents in MongoDB and the MongoDB query language, directly from your web and mobile application frontend code. A powerful rules engine lets developers declare fine-grained security policies.

  • Stitch Functions. Allows developers to run simple JavaScript functions in Stitch’s serverless environment, making it easy to create secure APIs or to build integrations with microservices and server-side logic. Enables integration with popular cloud services such as Twilio, enriching your apps with a single Stitch method call.

  • Stitch Triggers. Real-time notifications that launch functions in response to changes in the database. The functions can make further database changes, push data to other places, or interact with users – such as through push notifications, text messages, or emails.

  • Stitch Mobile Sync. Automatically synchronizes data between documents held locally in MongoDB Mobile and the backend database. MongoDB Mobile allows mobile developers to use the full power of MongoDB locally. Stitch Mobile Sync ensures that data is kept up to date across phones and all other clients in real time.

Can I version control my Stitch app configuration and functions?

Back to Table of Contents

The MongoDB Stitch CLI automates the export and import of Stitch applications while also protecting any secrets (such as keys). A series of folders and files, containing the JSON configuration data and JavaScript code for every authentication provider, service, function, and value represent the exported application:

yourStitchApp/
├── stitch.json
├── secrets.json
├── variables.json
├── auth_providers/
│   └── <provider name>.json
├── functions/
│   └── <function name>/
│       ├── config.json
│       └── source.js
├── services/
│   └── <service name>/
│       ├── config.json
│       ├── incoming_webhooks/
│       │   ├── config.json
│       │   └── source.js
│       └── rules/
│           └── <rule name>.json
├── triggers/
│   └── <trigger name>/
│       ├── config.json
│       └── source.js
└── values/
    └── <value name>.json

The CLI makes it simple to manage the lifecycle of your Stitch application – build your app, export it, modify it offline, use GitHub for source control, and deploy it wherever you need it to run. Read more about how to install and use the CLI here.

What is MongoDB Mobile?

Back to Table of Contents

MongoDB Mobile lets you store data where you need it, from IoT, iOS, and Android mobile devices to your backend – using a single database and query language. Applications can use the Stitch SDK to access data, whether it's held on the mobile client or the backend. With native JSON storage, indexing, and aggregations, users can query data any way they want. With local reads and writes, MongoDB Mobile lets you build the fastest, most reactive apps. Stitch Mobile Sync will automatically synchronize data changes between data held locally and your backend database – even after the mobile device has been offline.

How do I join the MongoDB Mobile Beta?

Back to Table of Contents

You can register your interest in joining the Beta program on the MongoDB Mobile page.

Can I really run any MongoDB query on MongoDB Mobile?

Back to Table of Contents

Yes, any query that you can execute on MongoDB Atlas, or on-premises MongoDB (including aggregations) can also be run on MongoDB Mobile.

Can I add indexes to collections stored in MongoDB Mobile?

Back to Table of Contents

Yes, secondary indexes can be added to MongoDB Mobile collections, just as they can for MongoDB running in the backend.

Can I sync data changes between MongoDB Atlas and MongoDB Mobile?

Back to Table of Contents

This will be possible soon. Stitch Mobile Sync automatically synchronizes data between documents held locally in MongoDB Mobile and your backend database, detecting any conflicts – even after the mobile device has been offline for a while.

How much does MongoDB Mobile cost?

Back to Table of Contents

MongoDB Mobile is free to run on your mobile and IoT devices. If you want to synchronize the data with your backend database, then you'll be using the Stitch Mobile Sync service. Stitch offers a generous free tier to get you up and running, refer to the Stitch pricing page for more details and examples.

Can I develop iOS apps with MongoDB Mobile?

Back to Table of Contents

Yes, using the Stitch native iOS client SDK.

Can I develop Android apps with MongoDB Mobile?

Back to Table of Contents

Yes, using the Stitch native Android client SDK.

Can I develop web apps with MongoDB Mobile?

Back to Table of Contents

Not at this time.