Key Points
- The Parse Server community continues to thrive and now supports MongoDB 3.2, making MongoDB Atlas an ideal backend for Parse Server-based applications. Existing users can use Parse's database migration tool to migrate directly to MongoDB Atlas.
- To set up a new Parse Server application using the MongoDB Atlas backend, you need to deploy the MongoDB Atlas cluster, deploy Parse Server, configure Parse Server to connect to MongoDB Atlas, and confirm connectivity. AWS Elastic Beanstalk and Heroku are easy options for deploying Parse Server.
- Migrating from Parse to MongoDB Atlas offers many advantages such as automated management tasks, powerful security features, and detailed insights into database performance and query optimization. MongoDB Atlas also provides automatic scaling of the database infrastructure to ensure your applications remain high performance and responsive.
This article was originally published on mongoDB. Thank you for supporting the partners who made SitePoint possible.
Whether you are migrating from a deprecated Parse.com (api.parse.com) or building new applications, the Parse Server community is full of vitality and has supported MongoDB since Parse Server 2.1.11 3.2, which makes MongoDB Atlas an ideal backend for Parse Server-based applications.
Existing managed Parse/api.parse.com users can use Parse's database migration tool to migrate their backend directly using the following connection string (replace bold items with your details):
<code>mongodb://username:password@node1.mongodb.net:27017,node2.mongodb.net:27017,node3.mongodb.net:27017/applicationDbName?replicaSet=clusterName-shard-0&ssl=true&authSource=admin</code>
We will learn from this blog post:
- How to deploy MongoDB Atlas cluster
- How to deploy Parse Server (In this case, we will show how to deploy using AWS Elastic Beanstalk Quick Start, but has been updated to use the latest version of Parse Server)
- How to configure Parse Server to connect to MongoDB Atlas
- How to confirm connectivity
How to set up a new example of how to use MongoDB Atlas backend Parse Server application
- Deploy MongoDB Atlas Cluster
- Consider the size option, but for hello world-style applications, start at a small scale. You can scale at any time (MongoDB Atlas allows you to migrate to larger instances without interrupting your database).
- Register MongoDB Atlas
- Build and deploy your first cluster (we will use a small M10 instance-sized replica set as an example and deploy it to the Eastern U.S. region)
- We will create a user with at least read and write permissions to the applicationDbName database (or automatically created users with readWriteAnyDatabase@admin permissions can also be)
- For testing purposes, we initially open the IP address to all IP addresses (0.0.0.0/0): later, we should only open it to the public IP address of our application server.
- Select where and how you want to deploy Parse Server:
- Many options are described here, some of which offer simpler settings than others. AWS Elastic Beanstalk and Heroku are simple options.
For the purposes of this post, we will use AWS Elastic Beanstalk for a quick start deployment of Parse Server by following the following URL (an AWS account required):
- Click here to view an example of a quick start deployment of AWS Elastic Beanstalk Parse Server.
- But we will make sure that Parse Server 2.1.12 or later is installed, for example, in parse-server-example, make sure that the package.json file contains "parse-server": "~2.2.16" (where 2.2.2. 16 is the latest version at the time of writing).
- Parse Server example can be downloaded from github:
- If we extract the Zip file, we can edit the version in package.json
- We set the Parse Server version to 2.2.16 (the latest version at the time of writing)
- We will select files in the directory and recompress them into a new Zip file
- We will upload a new zip file so that it can be deployed
- Configure Parse Server to connect to MongoDB Atlas
- Inside the AWS Elastic Beanstalk UI
- We will navigate to the "Configuration" section in the menu on the left
- We will then navigate to the "Software Configuration" section by clicking the gear icon and scroll down to the "Environmental Properties" section
- In the environment properties, we will use any myAppId, myFileKey, mySecretMasterKey we want (because this is a new application, so we set these).
- We will set up content to display near the top of our AWS Elastic Beanstalk application UI, located to the right of "URL:..."
- We set DATABASE_URI as follows (replace bold text with details for our specific cluster)
- mongodb://username:password@node1.mongodb.net:27017,node2.mongodb.net:27017,node3.mongodb.net:27017/applicationDbName?replicaSet=clusterName-shard-0&ssl=true&authSource=admin
- We can see that the appropriate MongoDB URI should be located in the cluster "connection" UI of MongoDB Atlas, under the driver connection section
- Test to confirm the connectivity of our sample application to Parse Server and MongoDB Atlas backend:
<code>mongodb://username:password@node1.mongodb.net:27017,node2.mongodb.net:27017,node3.mongodb.net:27017/applicationDbName?replicaSet=clusterName-shard-0&ssl=true&authSource=admin</code>
<code>$ curl -X POST \ > -H "X-Parse-Application-Id: newParseTest" \ > -H "Content-Type: application/json" \ > -d '{"score":1337,"playerName":"John Doe","cheatMode":false}' \ > http://parseserver-365pk-env.us-east-1.elasticbeanstalk.com/parse/classes/GameScore</code>
<code>返回: { "objectId": "YMgGV6kVTP", "createdAt": "2016-08-26T14:54:26.580Z" }</code>
<code>$ curl -X GET \ > -H "X-Parse-Application-Id: newParseTest" \ > -H "X-Parse-Master-Key: MASTER_KEY" \ > http://parseserver-365pk-env.us-east-1.elasticbeanstalk.com/parse/classes/GameScore</code>
You can now use the SDK to build a new application pointing to your Parse Server MongoDB Atlas instance!
Frequently Asked Questions about Building New Parse Server MongoDB Atlas-based Applications
What are the benefits of migrating from Parse to MongoDB Atlas?
Migrating from Parse to MongoDB Atlas offers several benefits. First, MongoDB Atlas is a fully managed cloud database developed by the same person who built MongoDB. It automates time-consuming management tasks such as infrastructure configuration, database setup, ensuring availability, global distribution, backup, and more. Second, MongoDB Atlas provides powerful security features including IP whitelisting, automated patching, and encryption at rest. Finally, it provides built-in operational and security best practices, providing detailed insights into database performance and query optimization.
How to ensure a smooth migration from Parse to MongoDB Atlas?
To ensure a smooth migration, planning ahead is crucial. First understand the structure of the Parse application and how it interacts with the database. Then, create a migration plan that includes a schedule, resources required, and potential risks. Test the migration process in a non-production environment before migrating to a production environment. Also, consider using MongoDB's migration tools and services to assist in this process.
What are the main differences between Parse and MongoDB Atlas?
Parse is a backend as a service (BaaS) platform that provides developers with a suite of tools for building mobile applications. MongoDB Atlas, on the other hand, is a database-as-a-service (DBaaS) platform that provides fully managed MongoDB databases in the cloud. While Parse includes features such as user management, push notifications, and social integration, MongoDB Atlas focuses on providing powerful, scalable, and secure database solutions.
How to ensure data security with MongoDB Atlas?
MongoDB Atlas provides multiple security features to protect your data. These features include network isolation using Amazon VPC, encryption at rest with your own key management system, encryption in transit with TLS, role-based access control, IP whitelisting, and automation patches.
Can I use MongoDB Atlas with my existing Parse application?
Yes, you can use MongoDB Atlas with your existing Parse application. You need to migrate your data from Parse to MongoDB Atlas and update your application to connect strings using MongoDB Atlas. This process may require some code changes, so it is important to thoroughly test before deploying to a production environment.
What tools and services does MongoDB provide to assist with migration?
MongoDB provides a variety of tools and services to assist with migration. These tools include the MongoDB Atlas Live Migration Service, which helps you migrate data from Parse to MongoDB Atlas with minimal downtime. They also provide consulting services to assist in planning and performing your migration.
How does MongoDB Atlas handle scalability?
MongoDB Atlas provides automatic scaling of database infrastructure. This means it can adapt to changes in workload and traffic patterns, ensuring your application remains high performance and responsive. You can also manually scale the cluster at any time.
What support options do MongoDB Atlas provide?
MongoDB Atlas provides 24/7 support, with a team of experts ready to assist with any issues. They also provide comprehensive documentation, tutorials, and guides to help you make the most of the platform.
How does MongoDB Atlas compare to other cloud database solutions?
MongoDB Atlas stands out for its powerful feature set, scalability and security features. It is a fully managed solution, which means it is responsible for infrastructure configuration, database setup, backup and more. It also offers global distribution, allowing you to deploy data across multiple regions for improved performance and availability.
How much does it cost to use MongoDB Atlas?
The cost of using MongoDB Atlas depends on a number of factors, including the size of the database, the number of requests issued by the application, and the area where the data is deployed. They offer a variety of pricing plans to meet different needs, including a free tier for small projects.
All image links are retained in original format.
The above is the detailed content of Building a New Parse Server & MongoDB Atlas-Based Application. For more information, please follow other related articles on the PHP Chinese website!

This tutorial guides you through building a serverless image processing pipeline using AWS services. We'll create a Next.js frontend deployed on an ECS Fargate cluster, interacting with an API Gateway, Lambda functions, S3 buckets, and DynamoDB. Th

This pilot program, a collaboration between the CNCF (Cloud Native Computing Foundation), Ampere Computing, Equinix Metal, and Actuated, streamlines arm64 CI/CD for CNCF GitHub projects. The initiative addresses security concerns and performance lim

This Go-based network vulnerability scanner efficiently identifies potential security weaknesses. It leverages Go's concurrency features for speed and includes service detection and vulnerability matching. Let's explore its capabilities and ethical

Website construction is just the first step: the importance of SEO and backlinks Building a website is just the first step to converting it into a valuable marketing asset. You need to do SEO optimization to improve the visibility of your website in search engines and attract potential customers. Backlinks are the key to improving your website rankings, and it shows Google and other search engines the authority and credibility of your website. Not all backlinks are beneficial: Identify and avoid harmful links Not all backlinks are beneficial. Harmful links can harm your ranking. Excellent free backlink checking tool monitors the source of links to your website and reminds you of harmful links. In addition, you can also analyze your competitors’ link strategies and learn from them. Free backlink checking tool: Your SEO intelligence officer


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.