Get subscribed to our newsletter
Get interesting updates to your email inbox.
At the baseline, every database is a very simple soul. A good database is meant to ingest your data, process it, and return it to the users when needed in whatever form they want it. To be practical for the needs in hand, any given database must allow as many queries as possible to be simultaneously processed. SQL came up as a declarative language for database management.
This does not mean that an SQL statement dictates the database as to how to perform a query. Still, it just raises the parameters with which a database can operate within itself while a statement is executed. In other terms, a programmer who interacts with the given database is ceding control over the specifics to a database. The application logic gets separated from the data storage with this approach. As a result, the database itself becomes capable of managing multiple simultaneous requests. Most specifically, a database has to handle situations where more than one reads and writes transactions on the same piece of data.
The conventional coders may raise a question as to why don’t we try to read/write locks to handle this? It is reasonable to raise this question as to the most adopted solution for databases for years. However, there is a problem with this approach. The readers may tend to block the writers and vice versa. These come as the semantics of a standard read/write lock. In the case of a transactional database, these semantics may have a bigger adverse impact on the performance.
You may consider a system with two different kinds of transactions. One may be a long-running read transaction that builds up a report or likes doing some analytics. Consider there is only one among these that may be running at one time. Another transaction may be a short-running user action with more than one write or read at a time. An order request or similar transaction can be considered as an example. In a typical web application environment, there can be thousands of such transactions.
Here, the primary problem with a standard read/write lock is that there can be an overlap between the set of read data for a long-running transaction. A set of write data on a short-running transaction may get blocked until the former transaction completes. In the tangled internet world of interweb now, even a long-running transaction that runs for a few seconds is unacceptable to the end-users. A study shows that the bounce rate is high for the web pages, which has a response delay of more than 3 seconds. If you are looking for better database solutions to ensure uptime and performance of your web applications, check out what RemoteDBA got to offer you.
The role of Multi-Version Concurrency Control (MVCC)
Considering the above challenge, there is some ‘wow’ factor about what MVCC or Multi-Version Concurrency Control solve. The name itself suggests how it solves the problem. Rather than maintaining predetermined storage space for any given record and applying read/write as lock as done conventionally, an MVCC DB will let a given record keep multiple versions simultaneously.
This means the updates are now installing another fresh row version. With this, the writers are contesting over their rights toa dd a new version on top of the given row, and the readers can read from any visible version out there. This means that long-running transactions will not lock again even when the short transaction queries are processed. Only if two or more transactions are vying for update rights on a row version, there is a possibility of mutual interference. We can see that MVCC is ideally used to implement the snapshots of a database.
As an effect of the same, while a transaction initiates, it gets freeze with a collection of unique records as a visible set. Updates of these versions are logically sequenced after the transactions are read. All that DBAs need to do is support the MVCC semantics as a record storage system that stores various versions of the same record. It also acts as a mechanism that allows users to translate the record version number to transaction IDs to make the visibility calculations.
MVCC and SQL
MVCC system can be used to implement the SQL semantics concurrently. SQL offers different isolation levels, which acts as a knob allowing the programmersto dial in a level of consistency needed. In the case of MVCC, it means that while a transaction hits a specific record updated by another concurrent transaction, the action depends on its isolation level. At the basic level of consistency, one may allow these transactions to read any update before the transaction update is committed, known as dirty read.
However, the next consistency level will prevent any dirty reads and just read the calculated version from the given transaction’s visibility. This is called ‘consistent reading.’ An update which hits a record version that undergoes an uncommitted update may have two options as:
- It can merely freak out, and straightaway fail, or,
- It can wait for the updated transaction to complete and then decide based on the committed state.
The low isolation levels fail faster as logically; they see the transactional updates as they run. The high consistency levels may need to block or retry based on the user needs until the ultimate record state is known.
For example, you can consider a table with 3 live rows. You may assume that each of these has some specific ID values. Provided this, we may examine the below use case.
Also Read: Asthma Patients Not At Risk From Covid-19
The first transaction starts before transaction 2 and begins to read each entry in the tale. Simultaneously, transaction 2 also starts up and looks for updatable records. Transaction #2 may outrace the first transaction to the record 100 and slips in early to updates it. A second transaction is still running; the update is pending. In a lock-based system, transaction 1 may have to get locked or validate that no record is changed while it was reading. On the other hand, in the MVCC model, while the first transaction finally gets around to read the record 100, it reads the most recent version. As a result, no reader is blocking a writer, and no one has to roll back or block.
This way, MVCC concurrency control can ensure multi-version concurrency in SQL distributed databases. It is proved to be the right approach for the DBAs to ensure database concurrency by providing better performance.
Amitabh Bachchan is adored by the public for his unforgettable on-screen performances as well as his magnetic demeanour. Not only do fans love Amitabh Bachchan's outstanding performance, but the actor's heartwarming words are also highly regarded. A much moved Amitabh Bachchan, during his speech to the crowd of over 80,000 people at the Reliance Industries' annual event, said that the legacy left by Dhirubhai has had a positive impact on millions of people's lives worldwide.
When Bollywood superstar Amitabh Bachchan became bankrupt in the late 1990s, Dhirubhai Ambani stepped forward to give him financial assistance. In his speech, Bachchan remembered that Dhirubhai had sent Anil Ambani to offer him financial assistance during the crisis, which he had respectfully declined. Lenders began knocking on his door, losses mounted, and his bank account dwindled to nothing. He said, "Dhirubhai's money might have gotten me out of the problem quickly. However, I respectfully declined his offer and gradually began to find work again, which let me pay off my debt."
Amitabh Bachchan is adored by the public for his unforgettable on-screen performances as well as his magnetic demeanour. | Flickr
Later, after Bachchan had recovered from the bankruptcy, one day he was invited to an event at Dhirubhai's residence; Bachchan added, "Dhirubhai was standing and having a chat with his industrialist friends when he saw me there, he called me, firstly I felt shy even to present myself in front of such big industrialists but then, I went there, and Dhirubhai declared in front of all of them that 'This young man had fallen but managed to get back up on his own, I have a lot of respect for him because of that.' Those words of his were worth much more to me than any amount of money that he could have offered me."
It was the "Reliance Family Day" event and was attended by members of the Ambani family from all generations. The event commemorated the company's 40-year journey since its inception. It also celebrated the 85th birthday of the late Dhirubhai Ambani, RILs (Reliance Industries Limited) founder.
Keywords: Bollywood, Reliance, Amitabh Bachchan, Dhirubhai Ambani, event
In comparison to adults, children are prone to getting traumatized by troubling events easily, and this makes it important for parents to help their children when the times are tough. It could be a brutal accident, an unprecedented pandemic, a violent crime, or other disasters but with the right parental support, children have a higher chance of coming out stronger from an awful situation.
Anuja Kapur, Psychologist shares few tips wherein you can assist your child when tough times comes calling:
Every child responds differently to disturbing events: What children feel about a current disaster in their life and how they react to it can come and go in waves. Children can act moody and withdrawn at times, struck with sorrow and fear at other times. There's no absolute "right" or "wrong" way to feel after a traumatic event so make sure not to dictate what your child or how your child should feel and react to the event.
Children can act moody and withdrawn at times, struck with sorrow and fear at other times. | Photo by Kat J on Unsplash
Encourage your child to be transparent: Just make sure you let your child know that whatever feelings they're experiencing is normal. The unpleasantness will pass if your child opens up about it and that the phase is temporary. While many teens may be reluctant to talk about their feelings with a parent, encourage them to confide in another trusted adult such as a family friend, relative, or a counselor and teacher. It's important to talkeeven if it's not with you.
Just make sure you let your child know that whatever feelings they're experiencing is normal. | Photo by Sebastián León Prado on Unsplash
Deter your child from reliving the disturbing event: Dwelling over, watching the footage, or imagining the event can be overwhelmingly stressful for children and this stress can even block their nervous system. However, to negate such things from happening encourage activities that keep your child's mind occupied so they're not obsessive about the event. You could encourage your children to read, play games together, or simply watch an uplifting movie.
Dwelling over, watching the footage, or imagining the event can be overwhelmingly stressful for children and this stress can even block their nervous system. | Photo by Юлія Дубина on Unsplash
Cocoon your child with warmth: In order to reassure your child that they are safe with you and feel secure, that the worst is over your physical affection is important in making them feel safe again. Teens may try to be tough through it and avoid being held, but they still need the proximity.
In order to reassure your child that they are safe with you and feel secure, that the worst is over your physical affection is important in making them feel safe again. | Photo by adrianna geo on Unsplash
Maintain routines. Establishing a predictable structure and schedule for your child's life can help to make the world seem more stable again. Try to maintain regular times for meals, homework, and family activities. Make sure your child accommodates time and space for rest, play, and fun. Keeping up with a schedule can help countercheck the obnoxious feeling of stress and worry in children about the future being dark, hopeless, and unpredictable.
Try to maintain regular times for meals, homework, and family activities. | Photo by Paico Oficial on Unsplash
Acknowledge and validate your child's concerns. The disastrous events in life may give place to unrelated fright and concerns in your child. However, understanding and accepting your child's present state is a comfort for the child. If at any point the child blames himself for the event make sure to make it clear and crisp the event was not their fault, you love them, and it's okay for them to feel upset, angry, or scared but not guilty.
Understanding and accepting your child's present state is a comfort for the child Photo by Jeremiah Lawrence on Unsplash
Irrespective of the age of your child, it is vital for parents to offer that extra support and assistance following an unsettling event. The traumatic event may bring up unrelated fears and issues in your child. However, by accepting their thoughts and replacing their fear with your love and direction, the ominous feelings will start to fade away. Eventually, the child will be able to return to a normal and healthy life. (IANS/ MBI)
Keywords: Kids, Help, stress, cope, routine, warmth, understanding, encourage, psychology, children
The European Commission, the executive arm of the European Union (EU), has announced plans for smartphone and other electronics manufacturers to fit a common USB-C charging port on their devices in an effort to reduce waste. In addition to phones, the rules will apply to other devices like tablets, headphones, portable speakers, videogame consoles, and cameras, reports The Verge. The decision will have a huge impact on Apple, as the company still uses its own Lightning connector to charge iPhones. The proposals only cover devices using wired, not wireless and a USB-C port is only mandatory for devices that charge using a cable.
"Chargers power all our most essential electronic devices | Photo by Solen Feyissa on Unsplash
"Chargers power all our most essential electronic devices. With more and more devices, more and more chargers are sold that are not interchangeable or not necessary. We are putting an end to that," the report quoted EU commissioner Thierry Breton as saying.
The Commission also wants to unbundle the sale of chargers from the sale of electronic devices, which it says will improve the consumers' convenience. "With our proposal, European consumers will be able to use a single charger for all their portable electronics - an important step to increase convenience and reduce waste." In addition, the Commission will require manufacturers to provide relevant information about charging performance. (IANS/MBI)
Keywords: Electronic Devices, Chargers, Cable, smartphone, Adapters, Charging Cord