Migrating and building infrastructure in AWS for SimpleMining.net
SimpleMining OS is an easy-to-use platform (Plug&Play Linux Mining OS) for mining cryptocurrencies using GPUs. It offers users from all over the world a wide pool of capabilities from monitoring to hardware management to real-time mining statistics. As the popularity of cryptocurrencies grew very rapidly, so did the popularity of the system provided by SimpleMining. The traffic, growing almost at a logarithmic rate, made it impossible to maintain the application within the on-premise (OVH) infrastructure used so far. At the client's request, we began to verify the available options in order to find and implement the best and cost-optimal solution. The result of our actions was the decision to migrate to the AWS cloud and build a completely new infrastructure.
Thanks to the implementation of AWS solutions proposed by Hostersi, the infrastructure was able to cope with a very large increase in customers. We can scale resources horizontally and vertically without any problem. To define the scale in question, I will only say that monthly our Cloudflare receives 12 MILLION requests.
Tytus Rogalewski
CEO of SimpleMining.net
Methodology
Thanks to a long-standing, perfectly interlocking cooperation, we have jointly developed a number of solutions to save money and constantly keep up with current cloud trends. Thanks to this approach, both the application and the infrastructure have no technological debt.
The environment was created according to the IaC approach, based on ARM architecture. The whole thing is managed by Terraform. AMI instance images are built using Packer, which in turn uses Ansible. SimpleMinig's infrastructure consists of three standard environments: dev, test and prod. The whole thing is also divided between two independent AWS accounts.
Due to very high performance and scalability, we decided that the best solution would be to use the Aurora MySQL database, while the application stack consists of: Nginx, PHP and Node.js. At the optimization stage, we implemented a websocket system, which allowed us to further optimize costs and performance.
Code structure
All code, we divided into three main parts: Terraform, Packer, Ansible.
Ansible -is used to implement the configuration for each infrastructure layer. Each layer has its own playbook.
Packer - is used to prepare AMI images based on Ansible's playbooks.
Terraform - is used to deploy infrastructure written in code within AWS, and is also responsible for provisioning the MySQL component.
Rundeck
After analyzing the Client's needs, we decided that Rundeck would be the optimal tool to handle the entire IaC stack on both the Hostersi and Client side. With it, the Customer can with a single click enable or disable the Development environment to reduce costs, or scale the test environment to a larger size on demand for performance testing. We, on the other hand, can efficiently manage the entire stack from one place.
VPC Tools
VPC Tools is a separate piece of infrastructure, providing a place for the tools that support the infrastructure (Gitlab, Zabix, OpenVPN, Rundeck or monitoring tools) and used by the customer. VPC tools are located outside the Terraform stack.
Network organization, routing
All of the Client's services are set up in private subnets without Internet access. External access is possible only through Load Balancers, and the entire infrastructure is prepared based on best practices recommended by AWS. Each environment is in a separate VPC (Virtual Private Cloud), and resources are stored within private subnets. We prepared all elements of the environment based on the Multi-AZ deployment model. The entry point for the infrastructure is Cloudflare, which is also used as protection against DDoS and WAF attacks. Access for Hostersi's employees is only possible based on IPsec, and for the customer through a VPN server.
The stability of the implemented solutions exceeded my expectations, and cooperation with Hostersi allowed me to optimize the application code, improving its performance and significantly reducing infrastructure costs. A big plus of our cooperation is the 24/7 care of the infrastructure, which definitely saved both my and my developers' time.
Tytus Rogalewski
CEO of SimpleMining.net
Other services
Amazon RDS - the entire Infrastructure uses Aurora for MySQL cluster version 5.7.
Amazon SES - to handle email delivery
Amazon SNS - for notification service
AWS IAM - for access and user management
AWS ACM - for certificate management
Amazon CloudWatch - for monitoring system performance
Zabix - for analyzing customer software operation
Atatus, Sentry - APM for finding and diagnosing errors and monitoring application performance
Nagios - for monitoring networks and network devices
Summary
For SimpleMinig, we planned and implemented the migration of applications from OVH environment to AWS. We were also responsible for the design and implementation of a new infrastructure based on the IaC approach and ARM architecture. We built a stable, externally attack-proof environment, the scale of whose workloads can be illustrated by the 12 billion requests directed to CloudFlare each month. Above that, we relieve SimpleMining of the need for 24/7 infrastructure monitoring by providing round-the-clock administrative support.
Read also:
- Nationwide call center, based on Amazon Web Services
- Implementation of cloud infrastructure for Magic Commerce, based on microservices, containers and IaC approach
- Implementation and maintenance of cloud infrastructure in AWS for Displate
- Migration of DANONE applications and websites to Amazon Web Services
- Design and implementation of cloud infrastructure for optAd360, based on Kubernetes clusters and the IaC approach