Home » Posts tagged 'application migration'
Tag Archives: application migration
Five things your code can tell you about migrating to AWS – Fedr8
April 2020
1. User session/state management
Perhaps the most common application technique that Green Rain finds is session management. This is how your application tracks things for users as they use your application. However, outside of the cloud, this might be done in a fragile manner by storing state locally on the server – in memory or on local disk in temporary files. If the server bombs, then so do all your user sessions. Imagine using your banking app and being logged out halfway through making transactions.
Session management is always an opportunity to fix fragility and use cloud architectures like distributed session management. Why not use an external, fast, Cloud Service Provider-managed cache like Memcached or Redis and refactor your code to use them instead?
2. Database technology
I remember the days when the same RDBMS from the same vendor was used for everything. Nowadays, different database systems are used for different purposes:
- MongoDB for NoSQL
- MySQL for SQL
- Neo4j for GraphQL
Do you know what your application uses? You could ask a developer or check the documentation… but is that possible, and will it be accurate? By analysing your code with Green Rain you’ll find things like this:
Green Rain has worked out that — in your Ruby application — it’s using MySQL and has listed down some key files where the code is using it, to prove it to you, write down to the line of code.
This app is definitely using MySQL — but so what? Using this, the human expert can decide:
- Yes, this is the only database engine this app is using.
- It’s MySQL so we can migrate it to the AWS and use their MySQL RDS instead of packaging our own.
- If this was Oracle, maybe we could have looked at migrating from Oracle to AWS Aurora
3. Third party services
On-premises, behind those high datacenter fences and thick walls, there are often shared IT services that your application can rely on for things like email and authentication: but what happens if you move your application to the cloud? Things break.
In this case, the application is expecting to speak with a Microsoft LDAP server. Can it connect if the application is running on AWS and the LDAP server is being those high datacenter fences and thick walls?
Maybe you can create a VPN, or Direct Connect, or maybe use cloud-based authentication.
4. Local disk I/O
It’s normal for a long-living application on a long-living server to read and write from the local filesystem. And, of course, you can do this on virtual machines on the cloud. But should you?
Typically the things you find that an application is writing to the local filesystem are configurations and logs. These are all opportunities to replace them with more distributed, resilient and cloud-native technique. For example, instead of storing configs on the local filesystem, put it in something like AWS Parameter Store. It’s more secure and, well, just better!
5. Logging
If there’s one thing that’s probably, most definitely, needs to change when you move an application to the cloud, it’s logging. But how does your application do logging? Where is the logging code in your application?
This application was a enormous 562,000 lines and 6,100 files. Amongst all of that code, Green Rain has found 72 logging-related code dependencies in 34 files. Armed with this, the expert can start to work out the size of the problem and think of a cloud-based solution.
Logging is an important application subsystem that mustn’t break when you migrate it to the cloud: imagine your application not working properly in the cloud, but you aren’t aware because logging isn’t working either.
Logging is also a great opportunity for modernization and use modern observability techniques and cloud-based products for even better application insights.