If
an app development project uses the Parse backend, it is necessary to plan
Parse migration before the service shuts down in January 2017. Thankfully, for
Parse developers, the service provider has just released a tool for database
migration. This tool allows app developers to migrate their apps seamlessly to
a MongoDB database. While the migration is taking place, the Parse API will
operate as usual, thereby doing away with any issues related to downtime and
hence maintain business continuity.
Furthermore,
Parse has also released its open-source Parse Server that allows app developers
to run most of the Parse APIs using their own Parse hosting that supports
Node.js. Once the data is migrated to its own database, the Parse Server
ensures the app runs with changes to the client side code.
Parse Migration
The
migration requires two steps. One is migrating the data to MongoDB, which has
to be self-hosted. The second is configuring Parse
hosting for Parse Server and making sure that the app points to this server.
Data Migration
As
stated earlier, for data migration, you need a self-hosted MongoDB. You can use
Heroku for this purpose or go with Amazon Web Services (AWS).
AWS
offers several features to help you design as well as host MongDB cluster. And,
if in the future you decide that you don’t want to use Parse platform, AWS
allows you to transition seamlessly to Amazon DynamoDB, which a scalable, fast
and no SQL database backend.
Heroku
is a cloud-based platform as a service and offers support for numerous
programming languages. Although it works differently from AWS, it allows
developers to manage their infrastructure environment. Also, it takes away the
need for infrastructure administration but allows app developers build as well
deploy apps in a number of new ways.
Transferring the
Database
This
involves transferring the database from Parse-hosted database to self-hosted
MongoDB. Once the transfer occurs then the Parse APIs have to be pointed to the
new self-hosted MongoDB. The lets the client interact with the MongoDB through
the Parse APIs.
Before
the MongoDB is set up, it is important to ensure that it meets the Parse
database size. It is imperative that the MongoDB is at least 10 times the
specifications of the Parse database. Also, set the fail index Key too Long to
false since MongoDB does not allow index keys to be bigger than 1024 bytes. If
the value is greater than 1024 bytes, you will get an error. Also, remember
that the latency between your MongoDB and Parse should not be over 20ms. To reduce
latency, it is prudent that the Parse hosting for the Parse Server is in the
same geographic region.
The
good thing about the Parse migration is that you can attempt it as many times
as you want as long as you are using the Parse database migration tool. Once
you are happy with the migration and have manually verified everything, you can
click on Finalize to complete the transfer in the migration UI. Thereafter,
your app will begin using the new MongoDB.
Local Parse Server
You
will need to set up a local Parse Server with proper Parse hosting. This server
will bridge the communication between the MongoDB and development client. Make
sure from the Parse dashboard, in the Security and Keys section of App Setting,
you take down the values of the Master Key, File Key, Client Key, JavaScript
Key and dotNETKey. These values have to be fed into the server constructor in
the index.js. Perform a query to ensure it works properly.
Deployment of
Production Parse Server
The
open source version of the Parse backend it known as Parse Server. You can
deploy it to any infrastructure environment that runs Node.js. The Server does
not depend on the hosted Parse backend. Instead, it uses MongoDB independently
of the hosted Parse database.
For
deployment of the production Parse Server, you require the following:
●
MongoDB
●
Node
4.3
●
Heroku
or AWS for the infrastructure
●
Python
2.x
Once
the deployment is done, point the app to the Production Parse Server. Test the
app that is pointed to your self-hosted MongoDB using the Parse APIs, which are
deployed on your platform. Thereafter, as users of the app to begin using the
new app since after January 28, 2017, any call made to the hosted Parse backed
will end in a call off.
The Bottom Line
For
some app developers, Parse migration will be easy and they will be able to
migrate without difficulties. For others, it may become too technical to figure
out what to do. Under such circumstances, it is best to get a technical
professional who excels in Parse migration using AWS or Heroku. The
professional will handle all aspects of the migration, including setting up
self-hosted MongoDB, local Parse hosting for the Parse Server and more. By
doing this as quickly as possible, the risk of losing your app reduces
substantially.