Key Points
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:
<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!
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.
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.
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.
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.
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.
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.
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.
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.
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.
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!