The HiveSQL database maintenance is now complete

in #hive-1395313 years ago

On March 1, 2022, I had to put HiveSQL in maintenance mode to make a major change to the database structure. You can read more about it here.

This unexpected maintenance, which lasted almost 3 days, is now over and HiveSQL is back alive and kicking!

Why did it take so long?

As explained in the announcement post, the purpose of this intervention was to modify the type of the field which stores the transaction reference in about fifty tables.

Easier said than done when you're managing a 3TB database with tables that store millions of records, sometimes even billions.

The indexes nightmare

HiveSQL contains many indexes that greatly speed up the information retrieval and query execution processes.

When you make changes to a field that is indexed, the server must update this index with each change and sometimes rebalance it. This process is extremely expensive in terms of resource usage and can significantly slow down operations performed on a large number of records.

It is therefore often more efficient to delete an index, even at the expense of performance, then to make your changes, and finally to recreate this index.

But sometimes it can be counterproductive. The relevance of these actions must therefore be assessed with the greatest care.

Add to this that these operations have to be done manually and often take a long time to complete.

The transactions log nightmare

You should know that to guarantee the consistency and integrity of the data contained in a database, the SQL server records in a separate log file each modification that you make to them.

This generates a huge amount of disk activity and also consumes a lot of additional storage space, sometimes more than the volume of data handled.

Although the available storage space is currently sufficient for the usual activity of HiveSQL, it turned out to be a bit short for logging billions of changes at one time.

Therefore, I had to adapt and cut these modifications into smaller batches, which had to be executed sequentially with even more care in order not to make errors.

Data security and recovery

Finally, before carrying out all these operations, I took all the necessary precautions to be able to roll back everything in the event of a problem. This means taking a backup of the database before any intervention, which for a 3TB database can easily take several hours.

A great idea because I almost needed it. Indeed, fatigue helping, I made a mistake at the very last moment which almost compromised all the work already done.

I was really scared at that time, not because part of the database would have been fucked up, but because hours of work would have been ruined and it would have been necessary to start all over again after restoring the latest backup.

Fortunately, I found a workaround to fix my error that allowed me to complete the maintenance with only a few extra hours of work.

Stay alert!

All this to explain to you that maintenance consists of an uninterrupted series of successive action and verification steps, of variable duration, carried out manually and during which I remained permanently in front of my screen to check that everything was going well, ready to react quickly in case of a problem.

Nothing could be more silly than going to sleep for a bit and, during that time, the operation you just launched ends and your infrastructure is waiting idly while everyone outside has only one question in mind: when back?

I need to sleep!

Those who know me know that I'm a fan of Power Naps. These are naps of a maximum of 20 minutes so as not to fall into a deep sleep. I have used and abused it. That's what kept me going. In the last three days, I think I slept a maximum of 8 hours in all.

But you should also know that this cannot replace a full night's sleep. The periods of deep sleep contain cleaning cycles for your brain necessary for its proper functioning, and these cycles are not present during short periods of sleep.

HiveSQL is back and all apps and processes relying on it running are fully operational again. That's been my only concern lately and I did not allow myself any respite, or very little. I am relieved but exhausted.

Time to start new brain cleaning cycles.

Meanwhile, I wish you all a good day!


Check out my apps and services


Vote for me as a witness

Sort:  

Wow. Thank you so much for your extremely hard work here on Hive. It's greatly appreciated.
So glad you could restore your work and it was not lost. That is extremely frustrating.
Now, please get some rest/sleep that you are in deep need of.

$WINE


Hi @theguruasia, You Do Not Have Enough WINEX Tokens To Make Another Successful Call.
Please Stake More WINEX Tokens.
(We Will Not Send This Error Message In Next 24 Hrs).

wine_logo


Contact Us : WINEX Token Discord Channel
WINEX Current Market Price : 0.300


Swap Your Hive <=> Swap.Hive With Industry Lowest Fee (0.1%) : Click This Link
Read Latest Updates Or Contact Us

Thank you so much for the hard work!!! Very much appreciated! Also, I am trying to figure out what the voting_power in the Account table means? Do they represent the average vote value a user casts? Thank you in advance!

Thanks for all your hard work! Really appreciate it!

Thank you @relf87

pixresteemer_incognito_angel_mini.png
Bang, I did it again... I just rehived your post!
Week 95 of my contest just started...you can now check the winners of the previous week!
!BEER
5

Thanks @arcange for the great work, support, and high contributions towards making hive a better place for its user, through your apps and services. Highly appreciates you boss 🤝👍.

Thank you @techlhab 😊


The rewards earned on this comment will go directly to the person sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.

Thank you so much for all you do…

Hope you can get some sleep or at least rest @arcange

Posted Using LeoFinance Beta

Thank you @littlebee4

You are welcome 😊

Posted Using LeoFinance Beta


Hey @arcange, here is a little bit of BEER from @pixresteemer for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.