How to start your NETWAYS Managed Database

How to start your NETWAYS Managed Database

In the first Database tutorial, Sebastian already explained what Vitess is all about and what possibilities it offers you, when running your application compared to an ordinary database.

In this tutorial, I would like to explain how easy it is for you to start your NETWAYS Managed Database(s) within a few minutes in our Vitess Cluster!

 

What Makes Your Database Special

It has to be mentioned in advance that your setup is always highly available. We run Vitess in a Kubernetes cluster, which is equally distributed between our two data centers.

We always replicate the data from left to right. A managed database therefore consists of at least two replicas – a primary and at least one replica. If the primary is located in one data center (left), the replica automatically moves to the other (right). So, if one data centers fails, Vitess swings over and continues to run the database on the second data center without affecting your application.

Furthermore, disaster recovery is included out of the box. As soon as the database is created, an initial backup is made and subsequently a daily backup (MySQL dump) is created. The data is copied to S3 in Xtrabackup format and from this storage the data is restored, in case of emergency.

 

How to Get Your First Database Started

Enough of the theory – how does the start of a Managed DB work in practice? First of all you have to register on our NETWAYS Web Services (NWS) platform.

As soon as you have created your account and entered your payment method, you are ready to go!

First of all, you start your Vitess Cluster, as seen above. Within a Vitess Cluster you can start as many databases as you want. Under “Managed Contract” you have the option to rename your cluster.

 

 

Now you have to start the first database. Just click on “1. create a new database”.

In the following you can name your DB and choose in which Vitess cluster the database should be started (if you have more than one cluster).

Now you have to choose one of our four plans. These plans differ in the replica size, the included backup size and the included traffic. In addition, each next higher plan is assigned more resources (in the form of CPU and memory). So if you have a lot of load, it is recommended to choose a higher plan, because it can handle more queries/second.

After that, you can decide how many replicas should be created. The smallest value is always two (consisting of one primary and one replica). If your application is very read-intensive, you can increase the number of replicas as much as you like and thus distribute the load efficiently.

The retention period of the daily backups can also be freely determined. The backup of the last day is delivered by default. If you want the backups to be kept for several days, you can easily set this by increasing the days to the desired duration.

Last but not least, you can select the replication mode. Here, you can set how your data should be replicated.

In Asyn mode the primary is “fired” with transactions and the replicas just try to keep up with the primary as much as possible without a time delay – but these time delays (seconds behind master) can/may occur. In case of a failover, it can happen that a replica is switched to the primary, which did not get the latest transactions, because it was a few seconds behind.

This cannot happen in semi-sync mode. In semi-sync mode MySQL always expects at least one replica to have fulfilled the last transaction. This ensures that at least one replica is always at the exact same state as your primary. If the primary is broken, Vitess automatically switches to the latest replica and appoints it as the new primary – so it continues without data loss.

Here’s an advice: Ideally, a database setup in semi-sync mode consists of three replicas – a primary and two replicas. One of these two replicas is always up to date with the primary. If a failover occurs, the primary replica can continue to work, because it has an additional replica that confirms new transactions.

If this were not the case (and you had only one replica), then the replica appointed as primary would now lack a counterpart for the commitment of new transactions. So it would have to wait until a new replica is up to commit the transactions (this only affects writes or deletes; read queries are not affected).

Now click on “Create” and your database will be started! Et voilà – after a short moment your data is available and you can start. For your database you now have the options “Connect”, “Edit” and “Destroy”.

 

 

Connect” shows you how to connect to the database – as usual with mySQL with host, user, password and SSL options (we reject non-SSL connections).

There is one more special feature: your SQL connection will include the database name!

If you add @replica to the database name, then you connect to the replica (which is read-only).

So, if your application supports it (e.g. Ruby on Rails), you can specify your primary database connection and your replica database connection – and subsequently, all selected statements go to replicas and all data manipulation statements go to the primary. This way your setup can scale super well, as your application can direct the load of the read queries to the replicas.

 

 

With “Edit” you can configure your database.

So, if you run out of storage, you can simply switch to the next bigger plan here. Or you can increase the number of replicas and backups or adjust the replication mode again.

If the largest plan is no longer sufficient, our scaling via sharding takes effect. For this, however, a detailed tutorial follows.

 

 

As shown above, with “Destroy” you delete your database again.

 

 

Under “User” you will find all the credentials for the automatically created user. Furthermore, you can create (and delete) additional users and assign passwords.

 

 

With “Backups” you will always find the backup that is automatically created once a day by default.

You can also create a backup manually at any time (e.g. in case you are working on your database and want to make a last database backup) by clicking on “Create Backup” and selecting the database to be backed up (if you have started several in your cluster).

Depending on which rentention cycle you have set for your database, your intermediate backups will be deleted in the evening.

 

If you have several backups here, you can delete them – only the last (highest) backup cannot be deleted, because it is used to restore the replicas if necessary.

Under “Graphs” we visualize the utilization of your setup (queries/second), the storage allocation and the slave lag for all replicas.

Under “Manage contract” you can rename or cancel your Vitess cluster.

 

Now that’s all the magic behind starting your first NETWAYS Managed Database built with Vitess! 

Cloud 101

Cloud 101

The NETWAYS group offers a wide range of services and products for setting up, managing, automating, and monitoring IT infrastructures in the OpenSource domain. We operate a hardware store, provide training, organize conferences, offer operational support, and advise customers on challenges related to automating and monitoring their on-premises systems. Furthermore, we have successfully established ourselves as a leading cloud provider in the German market through our NETWAYS Web Services.

As we embark on our NETWAYS Cloud tutorial series, we will initially focus on addressing the fundamental aspects and the very basic questions.

 

What do we actually do as a cloud provider?

As a cloud provider, we offer you flexible cloud services. The fundamental idea revolves around the virtualization of computer resources. These are subsequently provided to our customers as a service in the form of servers, data storage or applications. Mostly accessible via Internet, these resources can be utilized independently of the device. This therefore requires an IT infrastructure on our side, consisting of hardware (i.e. servers), virtualization, storage and network components.

We utilize two ISO27001-certified data centers located in Nuremberg for our hardware needs, which are managed by our trusted partners. Each of our data centers operates autonomously, with its dedicated infrastructure that includes firewalls, load balancers, switches, and other essential components. Both are redundantly connected to each other with 10,000 MBit/s via fiber optics, so that in case of problems a failover to the other location can take place.

All availability zones and locations are therefore in Germany and are GDPR-compliant. We take a maximally transparent approach to data protection and security: you can view our TOMs, AVV, the list of all subcontractors and all GTCs here and find out that your data is in good hands with us.

 

What is our NETWAYS Cloud based on?

We utilize the OpenStack software project as the foundation for our cloud computing architecture. OpenStack, a continuously evolving Open Source initiative, is backed by prominent companies such as SUSE, Linux, and HP. Originally launched by Rackspace and NASA, OpenStack consists of individual software elements (Nova, Keystone, Glance, Neutron, Cinder, Swift, Horizon) that empower the creation of a network-based cloud platform. With its extensive range of functions, OpenStack serves as a comprehensive cloud operating system.

As the name OpenStack suggests, the source code is freely accessible and thus promises transparency and security. People can make changes to the code themselves to adapt it to their own requirements. In addition, the huge community ensures that new innovations are constantly being driven forward.

Since we only use standardized OpenStack interfaces for our NETWAYS Cloud, there is no risk of vendor lock-in for you. This means that you can easily migrate your company data if necessary, which makes it possible to switch providers at any time.

 

What are your benefits?

A weighty argument is the point of flexibility. You simply don’t have to invest in your own hardware. Continuous attention is required to maintain, upgrade, or completely replace the hardware, resulting in the expenditure of time and, ultimately, financial resources. This whole procedure is eliminated when you run cloud computing on our NETWAYS Cloud. With just a few clicks you can start the desired VMs in the appropriate size via our web interface. In case you run out of storage space or need more power on your VMs – no problem: You can freely scale up and down your resources at any time. And if you no longer need a VM, you can simply delete it to reduce costs.

Additionally there are no contract periods coming with our NETWAYS Cloud and there are no flat rates with us either. Billing is based on the pay-as-you-go principle. At the end of the month, you are only charged for the resources that were used for your setup.

Another important argument in favor of our NETWAYS Cloud is our MyEngineer support service. Of course, you could use our cloud as a pure Infrastructure as a Service and take care of setup and maintenance by yourself. Alternatively, you can also hand over these tasks to our MyEngineer support service. Our colleagues will discuss upcoming tasks with you and take care of their execution.

You get help when you ask for it – 24/7, and if you don’t need support, there’s no charge.