Upgrade path from Sails.JS 0.10 to 0.11 Backward compatibility support

I have an old Sails.JS project that is currently in Sails version 0.10.5. I would like to upgrade the project to Sails 0.11.x and beyond, but there is a trick. This project acts as a backend for the native mobile application, so unlike updating the web server, where you can simply link the new client libraries sails.io.js and socket.io on your website, we cannot rely on users for Updating your own application.

It seems unreasonable that I am the only one who has encountered this problem, so I decided to ask the community a question to find out if there is something brilliant that I did not think about in order to make the update smooth.

The ideas I thought of are as follows:

  • Launch two versions of the application using subdomains ( https://v2.domain.com/api/ ... ). This is obviously the most obvious solution, but it requires a significant amount of server configuration, and we are currently working on PAAS, which has limited ability to configure the environment, so this will probably require switches.

    In addition to the work associated with this route, there is a decision on what to do with the code base. You could support two branches of code for two versions of the sails, but this means that fixing errors is twice as likely as errors. Or you could put provisions in code to check which version of his sails it works on. None of them look terribly clean, but I think I would choose the second of two options if this were to happen.

  • Dig through the sails.js kernel code and find a way to get socket.io 0.9 and socket.io 1.0 to run at the same time. This will allow me to force all users to update their mobile application before disabling support 0.9. It has obvious pitfalls, though, the main one performs such comprehensive changes at the frame level.

I would like to know what others did in this situation, if the solution just stays on Sails 0.10.5, then that’s fine, but I would like to get additional benefit from the native Socket.IO libraries released for version v.1.0, and not for the half house solution I'm using right now. It would also be nice to continue to receive security and feature updates.

+6
source share
1 answer

The only right solution to solve this problem would be to create a reverse nginx proxy server with the current server as the base, and then before starting each other path with the / v 2 prefix before each created path, and then migrating users to the / v 2 path as you you can, I would recommend using the same git repo for both servers, but supporting them on different branches so that you can merge new changes on both if necessary.

0
source

All Articles