Technical Guidelines for Migration to Vercel
Learn the key factors in enhancing the effectiveness, performance, and reliability of your migration to Vercel.When your application is hosted across multiple servers, maintaining session information consistency can be challenging.
For example, if your legacy application is served on a different domain than your new application, the HTTP session cookies will not be shared between the two. If the data that you need to share is not easily calculable and derivable, you will need a central session store as in the use cases below:
- Using cookies for storing user specific data such as last login time and recent viewed items
- Using cookies for tracking the number of items added to the cart
If you are not currently using a central session store for persisting sessions or are considering moving to one, you can use Vercel KV.
Learn more about creating a session store and managing session data with Edge Functions in our quickstart guide.
By pointing your domain to Vercel at the start of migration, all your traffic gets directed to Vercel, affecting your bandwidth usage. Be sure to account for potential additional costs associated with this approach.
The Usage tab on your dashboard can assist in monitoring your bandwidth usage.
Minimize risk and perform A/B testing by combining your migration by feature with a user group strategy. You can use Edge Config to store user group information and Edge Middleware to direct traffic appropriately.
- Review our Edge Config feature flag template for a deeper understanding of this approach
- You can also consult our guide on A/B Testing on Vercel for implementing this strategy
Consider using Serverless Functions or Edge Functions as you migrate your application.
This allows for the implementation of small, specific, and independent functionality units triggered by events, potentially enhancing future performance and reducing the risk of breaking changes. However, it may require refactoring your existing code to be more modular and reusable.
Prevent the loss of indexed pages, links, and duplicate content when creating rewrites to direct part of your traffic to the new Vercel deployment. Consider the following:
- Write E2E tests to ensure correct setting of canonical tags and robot indexing at each migration step
- Account for existing redirects and rewrites on your legacy server, ensuring they are thoroughly tested during migration
- Maintain the same routes for migrated feature(s) on Vercel
Was this helpful?