Lesson 04: Modeling and Designing Databases

Notes/errata/updates for Chapter 4:
See the official book errata at http://ift.tt/2gJZlRE – Chapter 4 includes pages 109 – 133.

On page 114, it says “For some applications, no combination of attributes can uniquely identify an entity (or it would be too unwieldy to use a large composite key), so we create an artificial attribute that’s defined to be unique and can therefore be used as a key: student numbers, Social Security numbers, driver’s license numbers, and library card numbers are examples of unique attributes created for various applications.” This is known as a “surrogate key”, because the number is a surrogate for the “real” unique way of identification.

On page 131, it says that reverse engineering an ER model from an existing database in MySQL Workbench is in beta testing phase. This function has been stable for a long time, so it’s safe to use.

In the chapter it talks about making sure your data doesn’t repeat itself, and how to design so that there aren’t consistency problems. If you want to learn more about normalization, feel free to listen to the OurSQL Podcast (www.oursql.com), episode 7 about normalization and episode 64, about different normal forms.

As you are reading this chapter, if you are wondering how a model relates to reality, know that for the most part, entities become tables and attributes become fields in a table. Relationships may or may not become tables, though for many-to-many relationships, they usually do.

For the homework, DO NOT USE MySQL Workbench to make Entity/Relationship diagrams. It is not a true E/R diagram and you will not be able to show everything you need to (e.g. the symbols for a weak entity do not exist in MySQL Workbench). Use flowcharting software or just draw it on paper and scan it in or take a picture, and submit the scan/picture as the homework

Topics covered:
Entity-Relationship diagramming

Supplemental material – podcasts on normalization:
Normalization concepts and 1NF: http://ift.tt/2xUHyCd
2NF, 3NF and when to denormalize: http://ift.tt/2xWhXcl

Reference/Quick Links for MySQL Marinate

via Planet MySQL
Lesson 04: Modeling and Designing Databases

Percona Support with Amazon RDS

Amazon RDS

This blog post will give a brief overview of Amazon RDS capabilities and limitations, and how Percona Support can help you succeed in your Amazon RDS deployments.

One of the common questions that we get from customers and prospective customers is about Percona Support with Amazon RDS. As many companies have shifted to the cloud, or are considering how to do so, it’s natural to try to understand the limitations inherent in different deployment strategies.

Why Use Amazon RDS?

As more companies move to using the cloud, we’ve seen a shift towards work models in technical teams that require software developers to take on more operational duties than they have traditionally. This makes it essential to abstract infrastructure so it can be interacted with as code, whether through automation or APIs. Amazon RDS presents a compelling DBaaS product with significant flexibility while maintaining ease of deployment.

Use Cases Where RDS Isn’t a Fit

There are a number of use cases where the inherent limitations of RDS make it not a good fit. With RDS, you are trading off the flexibility to deploy complex environment topologies for the ease of deploying with the push of a button, or a simple API call. RDS eliminates most of the operational overhead of running a database in your environment by abstracting away the physical or virtual hardware and the operating system, networking and replication configuration. This, however, means that you can’t get too fancy with replication, networking or the underlying operating system or hardware.

When Using RDS, Which Engine is Right For Me?

Amazon’s RDS has numerous database engines available, each suited to a specific use case. The three RDS database engines we’ll be discussing briefly here are MySQL, MariaDB and Aurora.

Use MySQL when you have an application tuned for MySQL, you need to use MySQL plug-ins or you wish to maintain compatibility to support external replicas in EC2. MySQL with RDS has support for Memcached, including plug-in support and 5.7 compatible query optimizer improvements. Unfortunately, thread pooling and similar features that are available in Percona Server for MySQL are not currently available in the MySQL engine on RDS.

Use MariaDB when you have an application that requires features available for this engine but not in others. Currently, MariaDB engines in RDS support thread pooling, table elimination, user roles and virtual columns. MySQL or Aurora don’t support these. MariaDB engines in RDS support global transaction IDs (GTIDs), but they are based on the MariaDB implementation. They are not compatible with MySQL GTIDs. This can affect replication or migrations in the future.

Use Aurora when you want a simple-to-setup solution with strong availability guarantees and minimal configuration. This RDS database engine is cloud-native, built with elasticity and the vagaries of running in a distributed infrastructure in mind. While it does limit your configuration and optimization capabilities more than other RDS database engines, it handles a lot of things for you – including ensuring availability. Aurora automatically detects database crashes and restarts without the need for crash recovery or to rebuild the database cache. If the entire instance fails, Aurora automatically fails over to one of up to 15 read replicas.

So If RDS Handles Operations, Why Do I Need Support?

Generally speaking, properly using a database implies four quadrants of tasks. RDS only covers one of these four quadrants: the operational piece. Your existing staff (or another provider such as Percona) must cover each of the remaining quadrants.

Amazon RDS
Amazon RDS

The areas where people run into trouble are slow queries, database performance not meeting expectations or other such issues. In these cases they often can contact Amazon’s support line. The AWS Support Engineers are trained and focused on addressing issues specific to the AWS environment, however. They’re not DBAs and do not have the database expertise necessary to fully troubleshoot your database issues in depth. Often, when an RDS user encounters a performance issue, the first instinct is to increase the size of their AWS deployment because it’s a simple solution. A better path would be investigating performance tuning. More hardware is not necessarily the best solution. You often end up spending far more on your monthly cloud hosting bill than necessary by ignoring unoptimized configurations and queries.

As noted above, when using MariaDB or MySQL RDS database engines you can make use of plug-ins and inject additional configuration options that aren’t available in Aurora. This includes the ability to replicate to external instances, such as in an EC2 environment. This provides more configuration flexibility for performance optimization – but does require expertise to make use of it.

Outside support vendors (like Percona) can still help you even when you eliminate the operational elements by lending the expertise to your technical teams and educating them on tuning and optimization strategies.

via Planet MySQL
Percona Support with Amazon RDS

Watch Sand Magically Flow Like a Liquid When Pumped Full of Air

GIF

The playground you frequented as a kid was probably blanketed in sand to help soften the impact every time you tumbled off the jungle gym. But did you know that something magical happens when you pump a pile of sand full of air? It suddenly enters a liquid-like state.

The effect is known as fluidization, and it will happen with almost any fine powder or granular material when you introduce a constant flow of air from underneath. As the air makes it way towards the surface and through the particles, it gets in-between each granule and reduces the friction that normally makes sand behave more like a solid. The resulting mixture moves and flows like water, even allowing certain objects to float or sink.

In theory this approach could be used to surround and protect your home with a moat full of switchable quicksand. You’d be easily able to walk across it, but when an intruder is detected, switching on a compressor would cause them to sink like a stone.

[YouTube via Reddit]

via Gizmodo
Watch Sand Magically Flow Like a Liquid When Pumped Full of Air

World’s FIRST Automatic Railgun Tested by US Navy

Yes, you don’t own a flying car, but at least some of the promises of the future are coming true: The United States Navy has successfully tested its railgun prototype in multi-shot (autoloading) mode, earlier this summer. Although the US Navy has been testing railguns since 2006, this latest test was the first time such a […]

Read More …

The post World’s FIRST Automatic Railgun Tested by US Navy appeared first on The Firearm Blog.


via The Firearm Blog
World’s FIRST Automatic Railgun Tested by US Navy

Computer Science Degrees Aren’t Returning On Investment For Coders, Research Finds

According to a new survey, coders with a bachelor’s degree in computer science

only earn 3,000 British Pounds (BP) more a year than those who don’t have one

. The survey of 4,700 developers in the UK was conducted by Stack Overflow, a community site frequented by developers for answers to technical questions. The Register reports the findings:

This is despite the average degree now costing 9,000 BP a year in tuition fees alone. Average student debt is now more than 50,000 BP, according the Institute of Fiscal Studies. The research found that the median salary of those who did not have higher education was 35,000 BP per year, while those who gained a bachelor’s degree earned 38,000 BP and postgraduates took home 42,000 BP. It found that 48 per cent of developers with less than four years of professional experience currently hold a Computer Science-related undergraduate degree, while 49 per cent had completed an online course instead. The research also found that JavaScript developers were most in demand, with almost 27 per cent of jobs advertised on Stack Overflow now requiring this skill, followed by Java (22 per cent), Python (16 per cent), C# (15 per cent) and ReactJS (9 per cent).

via Slashdot
Computer Science Degrees Aren’t Returning On Investment For Coders, Research Finds

Netflix’s ‘Punisher’ trailer shows us a haunted, murderous antihero

While the second season of Netflix’s Daredevil didn’t quite measure up to the first, Jon Bernthal’s take on antihero The Punisher was a standout addition. The streaming company wasted little time announcing the haunted criminal-killer would get a show of his own, but we’ve only really gotten teasers. Today, Netflix dropped The Punisher‘s first full trailer, giving fans a glimpse of a family-friendly Frank Castle before the deaths of his wife and child set him on his criminal-slaughtering path.

At the beginning of Daredevil‘s second season, viewers met a grizzled, world-weary Punisher eager to wipe crime off the streets with lethal force. Secretary-turned-journalist Karen Page bonded with the occasional antagonist, so it makes sense that she’ll appear in The Punisher. Otherwise, the series looks like it’s striking out on its own, departing from the tightly-woven Defenders mini-cinematic universe to tell Castle’s story.

The trailer portrays Castle tortured over the sins of his past, as his part in black ops CIA missions leads to the deaths of his wife and kid. With no street heroes in his way, it seems like The Punisher will kill his way to the truth. If you wanted a darker take on the antihero with a body count to match, this looks up your alley. Naturally, we still don’t have a solid release date, though we know it’ll be sometime in 2017, riling up speculation to whether Netflix will drop it early in October or wait til just before Thanksgiving.

Source: Punisher trailer (YouTube)

via Engadget
Netflix’s ‘Punisher’ trailer shows us a haunted, murderous antihero

Working From Home: Is it Worth it?

We’ve all fantasized about trading in our demanding office hours, gossiping coworkers, and overbearing bosses for a work from home gig. But, how do we get past the anxieties that come with the transition?

Nip those fears in the bud and get ready to pursue the career of your dreams with some of the information below.

Why is Working from Home So Great?

work at home

Working from home has several benefits besides the ability to make a living in your pajamas. You’ll find that trading in your traditional work can yield great benefits such as:

  • You’ll save money from commuting to work. You can reinvest the $50 you throw in your tank each week into something that you love. You can even use it to buy an equipment for your new home office.
  • Working from home can cut out your lunch expenses as well as a few inches off of your waistline. You’re more likely to prepare and eat healthy lunches if you aren’t heading to the food trucks parked across the street from your office.
  • You can say goodbye to the guilt that comes with having to reschedule outings with friends or missing your kid’s recital because you set your own hours. You’re able to start work whenever you like and put it away just in time to catch a yoga class and a chance to focus on you.

Sounds Perfect, Right?

Not so fast.

There are a lot of great things about working from home, but if you’re seriously considering making the switch, then you need to prepare for its drawbacks.

Check them out:

Discipline

Were you the first to quit a new instrument, dance class or sport after just a couple of days? Do you still allow your gym to take $20 out of your bank account each month despite the fact that you haven’t stepped inside of a gym since the last year?

Discipline is a key factor to successfully working from home.

Work/Life Balance

While working from home can definitely benefit those that seek control over how much work dominates their life, managing a solid work/life balance can be tough for true workaholics.

If you don’t have a dedicated and closed off workspace, you’ll be constantly reminded of how there’s always work to be done. This could easily lead to burnout if you fail to set boundaries between work and your personal life.

See Also: Keep Calm and Don’t Stress: Recognizing and Preventing Job Burnout

Financial Instability

Unless you’re working for a larger company, most self-employed individuals or freelancers that work from home have to acknowledge that their funds will fluctuate. There could be times when you go an entire month without receiving a check and you’ll have to find a way to keep yourself afloat financially in the meantime.

What’s Right For Me?

work from home

It’ll take a lot of self-reflection to figure out if working from home might be ideal for you. Check to see if any of the situations below affect you.

You might flourish with working from home if:

  • You’re self-motivated and you don’t need a boss to stand over your shoulder to ensure that work is done.
  • You have six months’ worth of living expenses in your bank account, just in case you come upon hard times.
  • You don’t mind doing self-employment taxes or advertising.
  • You’re not dependent on a healthcare plan provided by your traditional employer.

You might fail at working from home if:

  • You’re not self-motivated. If you need a kick in the rear to help you get started on a project, you might be better off with a more traditional setup.
  • It would put you or your family in financial trouble.
  • You’re not very good at managing stress. It would only make you more stressed to have the extra responsibility on your plate.
  • You prefer structure set by an outside source.
  • You enjoy being able to wheel your chair over to the next cubicle to chat with your coworkers.

Tips for Making the Change

If you’re determined to work from home, you’re going to need help to manage the transition. Here are a few tips to keep you from giving up on your dream to work from home:

  • Make an effort to get out of the house and see your friends or loved ones 2-3 times a week. When you first start working from home, it can be tempting to just throw yourself into your work 24/7, so that you can make your dream come true. Unfortunately, working all the time can and will lead to burnout.
  • Stick to a morning schedule. You’ll be far more successful if you can create your own structure that you can amend at any time.
  • Take inventory of your pantry and fill it up with non-perishable goods in case you run into some financial trouble. Having five or six boxes of stovetop macaroni and cheese can be a lifesaver if you’re running low on cash.
  • Most importantly, perform extensive research on what you’d like to do! If you want to be a freelance writer, you’ll need to read up on all of the different niches and decide what best fits your skill level and financial needs. There’s also plenty of successful individuals that do freelance graphic design, data entry work, virtual assisting or call center work for a company that doesn’t mind if you work from home.

See Also: How to increase productivity while doing ‘Work from Home’?

Get Started!

If you think that you’re cut out for the challenges that come with working from home, start thinking of when and how you’ll begin your transition. If you plan well, you’ll be able to enjoy the rewards of working from home in no time!

The post Working From Home: Is it Worth it? appeared first on Dumb Little Man.


via Dumb Little Man – Tips for Life
Working From Home: Is it Worth it?

It’s now tougher (and more expensive) to find big ideas

Big ideas are getting harder and harder to find, and innovations have become increasingly massive and costly endeavors, according to new research.

As a result, tremendous continual increases in research and development will be needed to sustain even today’s low rate of economic growth.

This means modern-day inventors—even those in the league of Steve Jobs—will have a tough time measuring up to the productivity of the Thomas Edisons of the past.

“The only way we’ve been able to roughly maintain growth is to throw more and more scientists at it.”

Nicholas Bloom, senior fellow at the Stanford Institute for Economic Policy Research and coauthor of a paper released this week by the National Bureau of Economic Research, contends that so many game-changing inventions have appeared since World War II that it’s become increasingly difficult to come up with the next big idea.

“The thought now of somebody inventing something as revolutionary as the locomotive on their own is inconceivable,” Bloom says.

“It’s certainly true if you go back one or two hundred years, like when Edison invented the light bulb,” he says. “It’s a massive piece of technology and one guy basically invented it. But while we think of Steve Jobs and the iPhone, it was a team of dozens of people who created the iPhone.”

To better understand the nation’s sluggish economic growth, Bloom and his three coauthors—SIEPR senior fellow Chad Jones, Stanford doctoral candidate Michael Webb, and MIT professor John Van Reenen—examined research productivity at an aggregate national level as well as within three swaths of industry: technology, medical research, and agriculture. For another measure, they also analyzed research efforts at publicly traded firms.

Their paper follows a common economic concept that economic growth comes from people creating ideas. In other words, when you have more researchers producing more ideas, you get more economic growth.

But Bloom and his team find a not-so-rosy imbalance. While research efforts are rising substantially, research productivity—or the ideas being produced per researcher—is declining sharply.

“The economy has to double its research efforts every 13 years just to maintain the same overall rate of economic growth.”

So the reason the US economy has even grown at all is because steep increases in research and development have more than offset the decline in research productivity, the study finds.

Specifically, the number of Americans engaged in R&D has jumped by more than twentyfold since 1930 while their collective productivity has dropped by a factor of 41.

“It’s getting harder and harder to make new ideas, and the economy is more or less compensating for that,” Bloom says. “The only way we’ve been able to roughly maintain growth is to throw more and more scientists at it.”

The paper spelled it out bluntly in numbers: “The economy has to double its research efforts every 13 years just to maintain the same overall rate of economic growth.”

Less optimism

Bloom initiated this research a year ago, inspired to dig deeper after speaking on a panel at the SIEPR economic summit that discussed “Is the Productivity Slowdown for Real?” He admits the paper—and its somewhat pessimistic analysis—has dampened his previous, more optimistic stance.

“I’ve changed my mind,” Bloom says. “Pretty much all mainstream economists have become rather depressed about productivity growth.”

At the 2016 SIEPR Summit, Bloom was more positive about the nation’s productivity, saying its declining rate was only a temporary effect of the financial crisis of 2008. He even caricatured ways of looking at US productivity levels and contended the up-and-down swings between 1950 and 2010 did not necessarily signal a long-running trend of slow productivity growth.

A year ago, Bloom recalls, “I thought we were recovering from a huge global recession and we’re about to turn around.”

Now, his perspective takes into account new insights that research productivity—one of the underlying components of economic growth—has been clearly dropping for decades.

“This paper says productivity growth is slowing down because ideas are getting harder to find,” Bloom says.

These innovative countries outperform their peers

While the study builds on the earlier work of Jones and others on R&D, the new paper also weaves a tight connection between empirical data on what’s happening in the real world and growth models.

The robust finding of declining idea productivity has implications for future economic research, the paper concludes. The standard assumption in growth models has historically been a constant rate of productivity, and “we believe the empirical work we’ve presented speaks clearly against this assumption,” it states.

Moore’s Law

Everywhere they looked, the researchers say they found clear evidence of how exponential investments in R&D have masked the decline in productivity. The tech industry’s signature guidepost, Moore’s Law, which marked its 52nd year in April, is a prime example.

Introduced in 1965 by Gordon Moore, the co-founder of computer chip giant Intel, the theorem postulates that the density of transistors on an integrated circuit would double roughly every two years, doubling computing power.

Moore’s Law has certainly played out—the computing power on a chip today is remarkable compared to even a decade ago—but the study found that the research effort behind the chip innovations rose by a factor of 78 since 1971.

To spur innovation, teach A.I. to find analogies

Put another way, the number of researchers required today to maintain that innovative pace is more than 75 times larger than the number that was required in the early 1970s.

“The constant exponential growth implied by Moore’s Law has been achieved only by a staggering increase in the amount of resources devoted to pushing the frontier forward,” the paper states.

Other industries also exhibited falloffs in idea productivity.

For instance, to measure productivity in agriculture, the study’s coauthors used crop yields of corn, soybeans, wheat, and cotton and compared them against research expenditures directed at improving yields, including cross-breeding, bioengineering, crop protection, and maintenance.

The average yields across all four crops roughly doubled between 1960 and 2015. But to achieve those gains, the amount of research expended during that period rose “tremendously”—anywhere from a threefold to a more-than-25-fold increase, depending on the crop and specific research measure.

On average, research productivity in agriculture fell by about 4 to 6 percent per year, the study finds.

A similar pattern of greater input but less output followed in medical research. The study’s authors analyzed R&D spending on new, federally approved drugs against life expectancy rates as a gauge of productivity. They also examined decreases in mortality rates of cancer patients against medical research publications and clinical trials.

The empirical findings on breast and heart cancer suggest that at least in some areas, “it may get easier to find new ideas at first before getting harder,” the paper states.

Turning its focus to publicly traded companies, the study found a fraction of firms where research productivity—as measured by growth in sales, market capitalization, employment, and revenue-per-worker productivity—grew decade-over-decade since 1980. But overall, more than 85 percent of the firms showed steady, rapid declines in productivity while their spending in R&D rose.

The analysis found research productivity for firms fell, on average, about 10 percent per year. It would take 15 times more researchers today than it did 30 years ago to produce the same rate of economic growth.

Source: May Wong for Stanford University

The post It’s now tougher (and more expensive) to find big ideas appeared first on Futurity.

via Futurity.org
It’s now tougher (and more expensive) to find big ideas

How to Prepare to Work From Home

Photo by Alexas_Fotos

The day before you work from home, remember to transfer any important files, as Fast Company points out in their guide to working from home. If you’re using a different computer, sync everything over with Dropbox, email, or a USB drive. Even if you’re using the same computer, or if you mostly rely on cloud services, remember to also prepare for any two-factor logins, and anything that won’t work on your corporate VPN. And bring any physical documents home.

FC also recommends prepping your workspace the night before: Clear away distracting “home stuff” and replicate your work environment as much as possible. It’s hard enough to get into your usual workday headspace when you’re sitting at home. You don’t want to waste the morning on making adjustments.

Advertisement

Set up as many of your usual office comforts as possible—you’d be surprised how distracting it can be to not have your favorite coffee mug or headphones. And clear away your home clutter. The idea is to replicate your usual workspace for a day.

If you’re using your personal computer for the day, turn that into “work mode” too: Close your usual home tabs like your personal email, turn off any notifications you wouldn’t have on your work computer, and maybe even create a different Chrome account.

For more prep, check out Lifehacker’s massive archive of work-from-home advice, from convincing your boss to let you do it, to changing clothes at the end of your day.

Advertisement

The Ultimate Work-From-Home Checklist For People Who Are Always In The Office | Fast Company


via Lifehacker
How to Prepare to Work From Home