After doing her best to make her own Skittles, Bon Appétit’s Claire Saffitz once again is determined to make a gourmet version of a popular food – and nobody better mess with her Lucky Charms! Of course our method for getting those marshmallows is a bit simpler.
Comic for June 27, 2018
Transcript
Boss: We started using A.I. to identify when employees are unproductive. Device: Ping ping ping ping ping ping. Boss: Looks like this meeting is setting off some alarms.
Encrypting an existing MySQL/MariaDB RDS Instance
Often it is necessary to convert an unencrypted RDS instance into an encrypted one. And it is usually expected that this process is done with minimum or no downtime. Unfortunately, one can only enable encryption when the instance is created. However, there is still hope, as there are a couple of workarounds to encrypt your existing data.
In this article, I will discuss two different solutions to achieve this result.
Solution 1: Create a snapshot and copy the snapshot to a new encrypted snapshot:
- Create a manual snapshot of the unencrypted RDS instance
- Go to Snapshots from the left panel and choose the snapshot just created
- From the Actions, choose Copy snapshot option and enable encryption
- Select the new encrypted snapshot
- Go to Actions and select Restore snapshot
Of course, we need to stop writes on the instance while the above steps are executed. However, since we are using RDS snapshots to create the new instance, this can still be a feasible option for a production instance.
To help you decide on the best solution for you, I am sharing the statistics of a test case I performed.
Case: On a t2.medium RDS instance of 100 GB allocated storage, the used data size is of 96GB, running in single AZ deployment.
Here is the time consumed at different stages of the complete process:
Creating a snapshot: 47 mins 16 secs
Copying snapshot: 14 mins 15 secs
Restoring snapshot: 2 mins 38 secs
The total time consumed, which can be considered as the downtime in this process, was approximately 64 mins in my test case.
Please note that this time will always vary and it will depend on many factors like the storage size, workload of your instance, the number of transactions going on your instance at that time, instance class, etc.
Also, note that new volumes created from existing EBS snapshots load lazily in the background. This means that after a volume is created from a snapshot, there is no need to wait for all the data to transfer from Amazon S3 to your EBS volume before your attached instance can start accessing the volume and all its data. This is the reason why restore operation takes such less amount of time.
If your instance accesses data that hasn’t yet been loaded, the volume immediately downloads the requested data from Amazon S3 and continues loading the rest of the data in the background. Storage blocks on volumes that were restored from snapshots must be initialized, i.e pulled down from Amazon S3 and written to the volume, before you can access the block. This preliminary action takes time and can cause a significant increase in the latency of an I/O operation the first time each block is accessed. Performance is restored after the data is accessed once.
If looking for a reduced downtime option, keep reading.
Solution 2: Set up external replication from unencrypted to encrypted RDS instance:
The below-mentioned steps are performed on an unencrypted RDS MySQL 5.7.17 to convert it into an encrypted one. It’s recommended that before implementing this procedure in a production environment, you test it in your development instance and create your action plan accordingly.
Here is the overview of the steps:
- Extend the Binary Log Retention Period on the unencrypted RDS instance
- Create a Read Replica from the unencrypted RDS instance
- Stop Replication on the Read Replica and note down the Relay_Master_Log_File & Exec_Master_Log_Pos from SHOW SLAVE STATUS
- Create a manual snapshot from that Read Replica (This snapshot will be unencrypted)
- Copy that snapshot and enable encryption
- Restore that snapshot (this will create an encrypted RDS instance)
- Start an external replication from the binary log file and position mentioned in Step-3
Below are the details of each step:
Step-1: Extend the binary log retention period on the unencrypted RDS instance
mysql> CALL mysql.rds_set_configuration(‘binlog retention hours’, 144);
RDS normally purges a binary log as soon as possible, but the binary log might still be required for the external replication. Please specify the number of hours to retain binary log files as per your requirement.
Created replication user on the unencrypted RDS instance.
mysql> GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* to ‘REPL_USER’@’%’ IDENTIFIED BY ‘REPL_PASSWORD’;
NOTE: REPLICATION SLAVE privilege is restricted in the RDS MySQL 5.5
Step-2: Create a Read Replica of the unencrypted RDS instance
Step-3: Once the Read Replica RDS instance becomes available, stop the replication using below command:
mysql> CALL mysql.rds_stop_replication;
After stopping the replication, note the Relay_Master_Log_File & Exec_Master_Log_Pos from the output of SHOW SLAVE STATUS\G
Step-4: Create a manual snapshot from that Read Replica
Select the Read Replica RDS instance and from the Instance Actions take a snapshot (this snapshot will be the unencrypted snapshot).
Step-5: Copy that snapshot and enable the encryption
Select the created snapshot and from the snapshot actions menu, copy the snapshot. Enable encryption and provide a name for the snapshot.
Step-6: Restore that snapshot to the RDS instance
Choose this encrypted snapshot and from snapshot actions select Restore Snapshot. This will create the new encrypted RDS instance from the snapshot.
Step-7: Set up external replication between unencrypted RDS instance and encrypted RDS instance
Once the encrypted RDS instance becomes available, set up its external replication with the unencrypted RDS instance. Start the external replication from the binary log file and position noted in Step 3.
mysql> CALL mysql.rds_set_external_master (‘RDS_ENDPOINT’, 3306, ‘repl’, ‘repl’, ‘BINARY_LOG_FILE’, ‘BINARY_LOG_POS’, 0);
Please replace the RDS_ENDPOINT with the endpoint of unencrypted RDS instance. Also replace the BINARY_LOG_FILE and BINARY_LOG_POS with the details noted down in Step 3.
Start the replication using the below command:
mysql> CALL mysql.rds_start_replication;
A few things to make sure when setting up the external replication between RDS instances:
- The binary log retention period is extended on the master RDS instance, as in RDS, binary logs will be flushed as soon as the replica executes events.
- On the master RDS instance, a replication user is created with the required privileges.
- The access of the replica RDS instance is allowed into the security group of the master RDS instance.
Please monitor your slave status and once the slave gets in sync with the master, your instance is ready to be used. You can switch the traffic to the encrypted RDS instance. The cutover time will be the downtime in this case.
Conclusion:
While encrypting an existing RDS instance, if you are using the first solution, a read-replica creation is not required, but on the flipside, the downtime required will be considerably more. So if downtime is a considerable factor for you, then evaluate the feasibility of creating a read-replica at your end and go for the second solution, as the cutover time of moving the pointer from unencrypted to encrypted instance would be the only downtime in this solution.
I hope this helps!
via Planet MySQL
Encrypting an existing MySQL/MariaDB RDS Instance
Schema Management Tips for MySQL & MariaDB

Database schema is not something that is written in stone. It is designed for a given application, but then the requirements may and usually do change. New modules and functionalities are added to the application, more data is collected, code and data model refactoring is performed. Thereby the need to modify the database schema to adapt to these changes; adding or modifying columns, creating new tables or partitioning large ones. Queries change too as developers add new ways for users to interact with the data – new queries could use new, more efficient indexes so we rush to create them in order to provide the application with the best database performance.
So, how do we best approach a schema change? What tools are useful? How to minimize the impact on a production database? What are the most common issues with schema design? What tools can help you to stay on top of your schema? In this blog post we will give you a short overview of how to do schema changes in MySQL and MariaDB. Please note that we will not discuss schema changes in the context of Galera Cluster. We already discussed Total Order Isolation, Rolling Schema Upgrades and tips to minimize impact from RSU in previous blog posts. We will also discuss tips and tricks related to schema design and how ClusterControl can help you to stay on top of all schema changes.
Types of Schema Changes
First things first. Before we dig into the topic, we have to understand how MySQL and MariaDB perform schema changes. You see, one schema change is not equal to another schema change.
You may have heard about online alters, instant alters or in-place alters. All of this is a result of work which is ongoing to minimize the impact of the schema changes on the production database. Historically, almost all schema changes were blocking. If you executed a schema change, all of the queries will start to pile up, waiting for the ALTER to complete. Obviously, this posed serious issues for production deployments. Sure, people immediately start to look for workarounds, and we will discuss them later in this blog, as even today those are still relevant. But also, work started to improve capability of MySQL to run DDL’s (Data Definition Language) without much impact to other queries.
Instant Changes
Sometimes it is not needed to touch any data in the tablespace, because all that has to be changed is the metadata. An example here will be dropping an index or renaming a column. Such operations are quick and efficient. Typically, their impact is limited. It is not without any impact, though. Sometimes it takes couple of seconds to perform the change in the metadata and such change requires a metadata lock to be acquired. This lock is on a per-table basis, and it may block other operations which are to be executed on this table. You’ll see this as “Waiting for table metadata lock” entries in the processlist.
An example of such change may be instant ADD COLUMN, introduced in MariaDB 10.3 and MySQL 8.0. It gives the possibility to execute this quite popular schema change without any delay. Both MariaDB and Oracle decided to include code from Tencent Game which allows to instantly add a new column to the table. This is under some specific conditions; column has to be added as the last one, full text indexes cannot exist in the table, row format cannot be compressed – you can find more information on how instant add column works in MariaDB documentation. For MySQL, the only official reference can be found on mysqlserverteam.com blog, although a bug exists to update the official documentation.
In Place Changes
Some of the changes require modification of the data in the tablespace. Such modifications can be performed on the data itself, and there’s no need to create a temporary table with a new data structure. Such changes, typically (although not always) allow other queries touching the table to be executed while the schema change is running. An example of such operation is to add a new secondary index to the table. This operation will take some time to perform but will allow DML’s to be executed.
Table Rebuild
If it is not possible to make a change in place, InnoDB will create a temporary table with the new, desired structure. It will then copy existing data to the new table. This operation is the most expensive one and it is likely (although it doesn’t always happen) to lock the DML’s. As a result, such schema change is very tricky to execute on a large table on a standalone server, without help of external tools – typically you cannot afford to have your database locked for long minutes or even hours. An example of such operation would be to change the column data type, for example from INT to VARCHAR.
Schema Changes and Replication
Ok, so we know that InnoDB allow online schema changes and if we consult MySQL documentation, we will see that the majority of the schema changes (at least among the most common ones) can be performed online. What is the reason behind dedicating hours of development to create online schema change tools like gh-ost? We can accept that pt-online-schema-change is a remnant of the old, bad times but gh-ost is a new software.
The answer is complex. There are two main issues.
For starters, once you start a schema change, you do not have control over it. You can abort it but you cannot pause it. You cannot throttle it. As you can imagine, rebuilding the table is an expensive operation and even if InnoDB allows DML’s to be executed, additional I/O workload from the DDL affects all other queries and there’s no way to limit this impact to a level that is acceptable to the application.
Second, even more serious issue, is replication. If you execute a non-blocking operation, which requires a table rebuild, it will indeed not lock DML’s but this is true only on the master. Let’s assume such DDL took 30 minutes to complete – ALTER speed depends on the hardware but it is fairly common to see such execution times on tables of 20GB size range. It is then replicated to all slaves and, from the moment DDL starts on those slaves, replication will wait for it to complete. It does not matter if you use MySQL or MariaDB, or if you have multi-threaded replication. Slaves will lag – they will wait those 30 minutes for the DDL to complete before the commence applying the remaining binlog events. As you can imagine, 30 minutes of lag (sometimes even 30 seconds will be not acceptable – it all depends on the application) is something which makes impossible to use those slaves for scale-out. Of course, there are workarounds – you can perform schema changes from the bottom to the top of the replication chain but this seriously limits your options. Especially if you use row-based replication, you can only execute compatible schema changes this way. Couple of examples of limitations of row-based replication; you cannot drop any column which is not the last one, you cannot add a column into a position other than the last one. You cannot also change column type (for example, INT -> VARCHAR).
As you can see, replication adds complexity into how you can perform schema changes. Operations which are non-blocking on the standalone host become blocking while executed on slaves. Let’s take a look at couple of methods you can use to minimize the impact of schema changes.
Online Schema Change Tools
As we mentioned earlier, there are tools, which are intended to perform schema changes. The most popular ones are pt-online-schema-change created by Percona and gh-ost, created by GitHub. In a series of blog posts we compared them and discussed how gh-ost can be used to perform schema changes and how you can throttle and reconfigure an undergoing migration. Here we will not go into details, but we would still like to mention some of the most important aspects of using those tools. For starters, a schema change executed through pt-osc or gh-ost will happen on all database nodes at once. There is no delay whatsoever in terms of when the change will be applied. This makes it possible to use those tools even for schema changes that are incompatible with row-based replication. The exact mechanisms about how those tools track changes on the table is different (triggers in pt-osc vs. binlog parsing in gh-ost) but the main idea is the same – a new table is created with the desired schema and existing data is copied from the old table. In the meantime, DML’s are tracked (one way or the other) and applied to the new table. Once all the data is migrated, tables are renamed and the new table replaces the old one. This is atomic operation so it is not visible to the application. Both tools have an option to throttle the load and pause the operations. Gh-ost can stop all of the activity, pt-osc only can stop the process of copying data between old and new table – triggers will stay active and they will continue duplicating data, which adds some overhead. Due to the rename table, both tools have some limitations regarding foreign keys – not supported by gh-ost, partially supported by pt-osc either through regular ALTER, which may cause replication lag (not feasible if the child table is large) or by dropping the old table before renaming the new one – it’s dangerous as there’s no way to rollback if, for some reason, data wasn’t copied to the new table correctly. Triggers are also tricky to support.
They are not supported in gh-ost, pt-osc in MySQL 5.7 and newer has limited support for tables with existing triggers. Other important limitations for online schema change tools is that unique or primary key has to exist in the table. It is used to identify rows to copy between old and new tables. Those tools are also much slower than direct ALTER – a change which takes hours while running ALTER may take days when performed using pt-osc or gh-ost.
On the other hand, as we mentioned, as long as the requirements are satisfied and limitations won’t come into play, you can run all schema changes utilizing one of the tools. All will happen at the same time on all hosts thus you don’t have to worry about compatibility. You have also some level of control over how the process is executed (less in pt-osc, much more in gh-ost).
You can reduce the impact of the schema change, you can pause them and let them run only under supervision, you can test the change before actually performing it. You can have them track replication lag and pause should an impact be detected. This makes those tools a really great addition to the DBA’s arsenal while working with MySQL replication.
Rolling Schema Changes
Typically, a DBA will use one of the online schema change tools. But as we discussed earlier, under some circumstances, they cannot be used and a direct alter is the only viable option. If we are talking about standalone MySQL, you have no choice – if the change is non-blocking, that’s good. If it is not, well, there’s nothing you can do about it. But then, not that many people run MySQL as single instances, right? How about replication? As we discussed earlier, direct alter on the master is not feasible – most of the cases it will cause lag on the slave and this may not be acceptable. What can be done, though, is to execute the change in a rolling fashion. You can start with slaves and, once the change is applied on all of them, promote one of the slaves as a new master, demote the old master to a slave and execute the change on it. Sure, the change has to be compatible but, to tell the truth, the most common cases where you cannot use online schema changes is because of a lack of primary or unique key. For all other cases, there is some sort of workaround, especially in pt-online-schema-change as gh-ost has more hard limitations. It is a workaround you would call “so so” or “far from ideal”, but it will do the job if you have no other option to pick from. What is also important, most of the limitations can be avoided if you monitor your schema and catch the issues before the table grows. Even if someone creates a table without a primary key, it is not a problem to run a direct alter which takes half a second or less, as the table is almost empty.
If it will grow, this will become a serious problem but it is up to the DBA to catch this kind of issues before they actually start to create problems. We will cover some tips and tricks on how to make sure you will catch such issues on time. We will also share generic tips on how to design your schemas.
Tips and Tricks
Schema Design
As we showed in this post, online schema change tools are quite important when working with a replication setup therefore it is quite important to make sure your schema is designed in such a way that it will not limit your options for performing schema changes. There are three important aspects. First, primary or unique key has to exist – you need to make sure there are no tables without a primary key in your database. You should monitor this on a regular basis, otherwise it may become a serious problem in the future. Second, you should seriously consider if using foreign keys is a good idea. Sure, they have their uses but they also add overhead to your database and they can make it problematic to use online schema change tools. Relations can be enforced by the application. Even if it means more work, it still may be a better idea than to start using foreign keys and be severely limited to which types of schema changes can be performed. Third, triggers. Same story as with foreign keys. They are a nice feature to have, but they can become a burden. You need to seriously consider if the gains from using them outweight the limitations they pose.
Tracking Schema Changes
Schema change management is not only about running schema changes. You also have to stay on top of your schema structure, especially if you are not the only one doing the changes.
ClusterControl provides users with tools to track some of the most common schema design issues. It can help you to track tables which do not have primary keys:

As we discussed earlier, catching such tables early is very important as primary keys have to be added using direct alter.

ClusterControl can also help you track duplicate indexes. Typically, you don’t want to have multiple indexes which are redundant. In the example above, you can see that there is an index on (k, c) and there’s also an index on (k). Any query which can use index created on column ‘k’ can also use a composite index created on columns (k, c). There are cases where it is beneficial to keep redundant indexes but you have to approach it on case by case basis. Starting from MySQL 8.0, it is possible to quickly test if an index is really needed or not. You can make a redundant index ‘invisible’ by running:
ALTER TABLE sbtest.sbtest1 ALTER INDEX k_1 INVISIBLE;
This will make MySQL ignore that index and, through monitoring, you can check if there was any negative impact on the performance of the database. If everything works as planned for some time (couple of days or even weeks), you can plan on removing the redundant index. In case you detected something is not right, you can always re-enable this index by running:
ALTER TABLE sbtest.sbtest1 ALTER INDEX k_1 VISIBLE;
Those operations are instant and the index is there all the time, and is still maintained – it’s only that it will not be taken into consideration by the optimizer. Thanks to this option, removing indexes in MySQL 8.0 will be much safer operation. In the previous versions, re-adding a wrongly removed index could take hours if not days on large tables.
ClusterControl can also let you know about MyISAM tables.

While MyISAM still may have its uses, you have to keep in mind that it is not a transactional storage engine. As such, it can easily introduce data inconsistency between nodes in a replication setup.
Another very useful feature of ClusterControl is one of the operational reports – a Schema Change Report.

In an ideal world, a DBA reviews, approves and implements all of the schema changes. Unfortunately, this is not always the case. Such review process just does not go well with agile development. In addition to that, Developer-to-DBA ratio typically is quite high which can also become a problem as DBA’s would struggle not to become a bottleneck. That’s why it is not uncommon to see schema changes performed outside of the DBA’s knowledge. Yet, the DBA is usually the one responsible for the database’s performance and stability. Thanks to the Schema Change Report, they can now keep track of the schema changes.
At first some configuration is needed. In a configuration file for a given cluster (/etc/cmon.d/cmon_X.cnf), you have to define on which host ClusterControl should track the changes and which schemas should be checked.
schema_change_detection_address=10.0.0.126
schema_change_detection_databases=sbtest
Once that’s done, you can schedule a report to be executed on a regular basis. An example output may be like below:

As you can see, two tables have changed since the previous run of the report. In the first one, a new composite index has been created on columns (k, c). In the second table, a column was added.

In the subsequent run we got information about new table, which was created without any index or primary key. Using this kind of info, we can easily act when it is needed and solve the issues before they actually start to become blockers.
Canadian Music Festival on Hold Due to a Single Nesting Bird

Birds couldn’t care less about your human entertainment, and a killdeer certainly isn’t going to change its breeding plans to accommodate Ottawa’s annual Bluesfest music festival.
CNN reports:
This year, preparations for the festival are on hold to protect one very special attendee: a mother bird and her nest. Workers discovered the bird, a killdeer, guarding her four eggs while they were setting up one of the festival’s main stages. The breed is protected by the Canadian government and cannot be moved without federal permission.
Killdeers are quirky migratory shorebirds, and you may see them nesting in odd places—like in the middle of a parking lot, for example. But even if the birds don’t choose the safest spots to brood, they’re thankfully defended by some very old conservation laws. Back in the early 1900s, humans were really wrecking bird species, hunting many to near extinction for fun or for their beautiful feathers. In response, the United States and Canada signed a 1916 treaty to protect migrating birds.
Advertisement
Here in the US, the resulting law is called the Migratory Bird Treaty Act of 1918, and Canada has its own version. Since the killdeer is on the list of protected species, the organizers of Bluesfest must ask the Canadian government for permission to move the eggs.
And moving the eggs can be bad. According to the CBC, the killdeer might abandon its eggs if the nest is moved too far.
While it’s a very silly problem to have, it didn’t surprise at least one scientist we spoke to. “They choose some strange places to nest,” Susan Elbin, Director of Conservation and Science at New York City Audubon, told Gizmodo. “We had one nesting in the middle of a construction site on Governor’s Island.” You just need to cordon off and protect the eggs, Elbin said.
Advertisement
The eggs have a three-to-four week incubation period, and then babies are up, running, and flying fairly quickly after hatching. The festival is slated to begin July 5 and will have 300,000 attendees, reports CNN. The festival organizers have an idea as to where to move the birds, but just need the government to give the OK.
Bird conservation is a good thing. If anything, the festival organizers can let the killdeer be this year’s Bluesfest mascot.
[via CNN]
via Gizmodo
Canadian Music Festival on Hold Due to a Single Nesting Bird
How to Deal With Rude People

In this week’s episode of the Upgrade, we spoke with Danny Wallace: comedian, radio host, and author of the book F You Very Much: Understanding the Culture of Rudeness—And What We Can Do About It.
Listen to The Upgrade above or find us in all the usual places where podcasts are served, including Apple Podcasts, Google Play, Spotify, iHeartRadio, Stitcher, and NPR One.
Discussed in This Episode
- Why we’re all becoming such total a-holes
- How noise can make us less polite
- Why we seem to love rude people on television (and in politics)
- How rudeness can spread like the common cold
- How we can cope with rudeness
- How Danny is British, and thus can get away with using a term like “tickety-boo.” (We may not have discussed this, but certainly thought it.)
And so much more.
Our Upgrades of the Week
Every week we like to let you in on the upgrades we’ve made in our own lives. This week we talked about eradicating an ant invasion, purchasing a lopper, and riding along with turbulence.
Want to Say Hello?
Please do. We’re so very lonely.
Call (347) 687-8109 and leave us a voice mail. OR: Email your question or comment or deep thoughts to upgrade@lifehacker.com.
How Tabasco Sauce is Made
“It’s a 5-year process from the beginning to the end.” Business Insider takes us to the Avery Island, Louisiana Tabasco company to learn about the how they make their tasty and ubiquitous hot pepper sauce. The process is not dissimilar from aging good whiskey.
Apple launches service program to address MacBook keyboard woes

Apple has publicly acknowledged that the butterfly switch keyboards in some MacBook and MacBook Pro computers have given consumers some trouble, and it has launched a new repair service program that promises to fix problems with those keyboards for free, regardless of whether the consumer purchased AppleCare.
Apple says in its public documentation on the program that certain models of MacBook and MacBook Pro “may exhibit one or more of the following behaviors”:
- Letters or characters repeat unexpectedly
- Letters or characters do not appear
- Key(s) feel “sticky” or do not respond in a consistent manner
When they do, “Apple or an Apple Authorized Service Provider will service eligible MacBook and MacBook Pro keyboards, free of charge.” Apple also says that consumers who previously paid for a repair can contact the company to request a refund.
It’s difficult to say exactly how widespread the problem has been, but anecdotally, I know multiple people who have had to deal with it. I encountered this problem with my own 2016 MacBook Pro as well. I was able to get it fixed for free because I had purchased AppleCare; the repairs could have otherwise cost me more than $700, based on the receipts given to me by Apple with the repair.
Last month, AppleInsider combed through a small and insufficiently representative repair record dataset to come to some tentative conclusions—namely that the butterfly switch-equipped 2016 MacBook Pros experienced twice as many repair events related to the keyboard (excluding Touch Bar repairs) as the 2015 MacBook Pros that had the older chiclet design. The same data suggested that small tweaks made to the keyboard design in 2017 models returned the repair frequency closer to normal.
Regardless, the new repair program covers the 2017 MacBook Pros, not just the 2016 models. This is the complete list of machines Apple says it will service in this new program:
- MacBook (Retina, 12-inch, Early 2015)
- MacBook (Retina, 12-inch, Early 2016)
- MacBook (Retina, 12-inch, 2017)
- MacBook Pro (13-inch, 2016, Two Thunderbolt 3 Ports)
- MacBook Pro (13-inch, 2017, Two Thunderbolt 3 Ports)
- MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
- MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)
- MacBook Pro (15-inch, 2016)
- MacBook Pro (15-inch, 2017)
These butterfly keyboards have proven divisive among consumers. On the positive side, Apple likely chose the new design primarily because it saved space for other components in the machines, and some users feel that they’re faster to type on than other keyboards because of the very shallow, clicky keys. However, the keyboards have numerous passionate and vocal detractors who say that they’re terrible to type on, and who also cite reliability concerns.
We believe Apple is more likely to continue to refine the existing keyboard design in future laptops to address detractors’ complaints than to go back to an earlier design. But in the meantime, consumers can at least get keyboards that are having problems repaired at no cost—other than some of their time, of course. It took a long time for this service program to arrive given how long users have been reporting problems, though.
via Ars Technica
Apple launches service program to address MacBook keyboard woes
US Army asks startups to deliver next-generation weapons
guvendemir via Getty Images
While the US Army already works with huge military contractors, it still wants to make sure that it won’t miss the chance nab new technologies developed by small businesses. That’s why it has launched the Army Expeditionary Technology Search or xTechSearch, which will give “nontraditional defense partners” the chance to work with the military division. xTechSearch is a four-phase competition that promises a $200,000 cash prize for the final winner to be announced in April 2019. It’s soliciting innovative technologies the army could use, such as next-gen combat vehicles that can replace tanks.
The competition is also looking for new technologies that reduce the cost of missile defense, as well as innovations that can “enhance [soldier] lethality in close combat.” By launching this challenge, the army is likely hoping to find a gem it wouldn’t have found otherwise, something big corporations might not think of — something born out of necessity to innovate due to lack of funds and access to resources. The challenge is open to all small businesses and is now accepting all technology proposals until July 11th, 2018.
via Engadget
US Army asks startups to deliver next-generation weapons
Back to basics: Isolation Levels In MySQL
In this blog, we will see the very basic thing “I” of “ACID” and an important property of Transaction ie., “ISOLATION”
The isolation defines the way in which the MySQL server (InnoDB) separates each transaction from other concurrent running transaction in the server and also ensures that the transactions are processed in a reliable way. If transactions are not isolated then one transaction could modify the data that another transaction is reading hence creating data inconsistency. Isolation levels determine how isolated the transactions are from each other.
MySQL supports all four the isolation levels that SQL-Standard defines.The four isolation levels are
- READ UNCOMMITTED
- READ COMMITTED
- REPEATABLE READ
- SERIALIZABLE
The Isolation level’s can be set globally or session based on our requirements.
Choosing the best isolation level based, have a great impact on the database, Each level of isolation comes with a trade-off, let’s discuss on each of them,
READ UNCOMMITTED:
In READ-UNCOMMITTED isolation level, there isn’t much isolation present between the transactions at all, ie ., No locks. A transaction can see changes to data made by other transactions that are not committed yet. This is the lowest level in isolation and highly performant since there is no overhead of maintaining locks, With this isolation level, there is always for getting a “Dirty-Read”
That means transactions could be reading data that may not even exist eventually because the other transaction that was updating the data rolled-back the changes and didn’t commit. lest see the below image for better understanding
Suppose a transaction T1 modifies a row if a transaction T2 reads the row and sees the modification even though T1 has not committed it, that is a dirty read, the problem here is if T1 rolls back, T2 doesn’t know that and will be in a state of “totally perplexed”
READ COMMITTED:
IN READ-COMMITTED isolation level, the phenomenon of dirty read is avoided, because any uncommitted changes are not visible to any other transaction until the change is committed. This is the default isolation level with most of popular RDBMS software, but not with MySQL.
Within this isolation level, each SELECT uses its own snapshot of the committed data that was committed before the execution of the SELECT. Now because each SELECT has its own snapshot, here is the trade-off now, so the same SELECT, when running multiple times during the same transaction, could return different result sets. This phenomenon is called non-repeatable read.
A non-repeatable occurs when a transaction performs the same transaction twice but gets a different result set each time. Suppose T2 reads some of the rows and T1 then change a row and commit the change, now T2 reads the same row set and gets a different result ie.., the initial read is non-repeatable.
Read-committed is the recommended isolation level for Galera ( PXC, MariaDB Cluster ) and InnoDB clusters.
REPEATABLE READ:
In REPEATABLE-READ isolation level, the phenomenon of non-repeatable read is avoided. It is the default isolation in MySQL.This isolation level returns the same result set throughout the transaction execution for the same SELECT run any number of times during the progression of a transaction.
This is how it works, a snapshot of the SELECT is taken the first time the SELECT is run during the transaction and the same snapshot is used throughout the transaction when the same SELECT is executed. A transaction running in this isolation level does not take into account any changes to data made by other transactions, regardless of whether the changes have been committed or not. This ensures that reads are always consistent(repeatable). Maintaining a snapshot can cause extra overhead and impact some performance
Although this isolation level solves the problem of non-repeatable read, another possible problem that occurs is phantom reads.
A Phantom is a row that appears where it is not visible before. InnoDB and XtraDB solve the phantom read problem with multi-version concurrency control.
REPEATABLE READ is MySQL’s default transaction isolation level.
SERIALIZABLE
SERIALIZABLE completely isolates the effect of one transaction from others. It is similar to REPEATABLE READ with the additional restriction that row selected by one transaction cannot be changed by another until the first transaction finishes. The phenomenon of phantom reads is avoided. This isolation level is the strongest possible isolation level. AWS Aurora do not support this isolation level.
Photo by Alberto Triano on Unsplash