pe

The ‘elites’ will be fine, the merely competent will suffer

We sometimes speak of the American university, as if it is all one thing, where you’ll attend and be pampered for four years and pop out at graduation to a job and a well-paid career. Corey Robin exposes the inequities of the university system by comparing City University of New York, a massive public university, […]




pe

Can we petition to have everyone who says the word “god” punished?

Like Minneapolis, the city of Mississauga is allowing mosques to broadcast the call to prayer during Ramadan, which seems reasonable, since 12% of the population is Muslim. The only problem is that some people are objecting, for bogus reasons. An open letter attached to three petitions, two of them hosted on Change.org, calls on Mississauga […]



  • Religion and Government

pe

If the virus were the size of dinosaurs, maybe people would appreciate the danger

This story is a bit on the nose. Hello, Peter Ludlow here, CEO of InGen, the company behind the wildly successful dinosaur-themed amusement park, Jurassic Park. As you’re all aware, after an unprecedented storm hit the park, we lost power and the velociraptors escaped their enclosure and killed hundreds of park visitors, prompting a two-month […]




pe

This image has been photoshopped

Currently making the rounds: I was suspicious, though. It’s too good to be true. So I snooped about, and found the original on the ADL website. OK, now, really — who thought they needed to edit the original sign to make it less evil and more obviously stupid? That was a waste of effort. Just […]




pe

Friday Polynews Roundup — Polyamory in the time of coronavirus, 'Trigonometry' and 'Open' begin on TV, research on ethics in the poly community, and more




pe

Friday Polynews Roundup — Polyfolks cope with coronavirus, LDRing across town, 'Trigonometry' and other TV, and a happy quad is spotlighted



  • Friday Polynews Roundup
  • polyamory on TV
  • TV

pe

Friday Polynews Roundup — When this isolation ends, good long-distance sex, how to open a relationship, and more.







pe

Comparing HTTP/3 to HTTP/2 performance-wise

#262 — April 15, 2020

Read on the Web

StatusCode Weekly
Covering the week's news in software development, ops, platforms, and tooling.

GitHub Shakes Up Pricing, Makes Most Core Features Free — One of the good consequences of Microsoft acquiring GitHub seems to be that they want to open it up to everyone without any barriers, so now you can use GitHub for private development with unlimited collaborators for free, and even the enterprise features are cheaper now.

Nat Friedman (GitHub)

Comparing HTTP/3 vs. HTTP/2 Performance — HTTP/3 is still in a draft status spec-wise, but it’s already being supported here and there, including on Cloudflare. This post covers where HTTP/3 is right now, why it matters, and some basic benchmarks.

Sreeni Tellakula (Cloudflare)

We Now Offer Remote Go, Docker or Kubernetes Training — We offer live-streaming remote training as well as video training for engineers and companies that want to learn Go, Docker and/or Kubernetes. Having trained over 5,000 engineers, we have carefully crafted these classes for students to get as much value as possible.

Ardan Labs sponsor

Ask HN: How to Rediscover the Joy of Programming? — A popular Hacker News discussion from this week about how to make programming really click for you, rather than being merely a daily slog.

Hacker News

How Deploys Work at Slack — When you’re running a service that’s used at the heart of so many companies, like Slack, deploys require a careful balance of speed and reliability. This is a very high level look at what Slack does.

Slack Engineering

Quick bytes:

???? Jobs

Full-Stack Developer (Skien, Norway) — We are looking for a full-stack dev with a solid track record to help us adapt to tomorrow's security requirements.

OKAY

Find a Job Through Vettery — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

???? Stories and Opinions

The Death of Hype: What's Next for Scala — Most languages go through a ‘hype cycle’ and Scala’s initial peak was quite a few years ago now but what’s the long term outlook like?

Haoyi

The Case for Human-Centric Observability

Lightstep sponsor

Clocking a 6502 to 15GHz — Via emulation, of course :-)

Chris Evans

The Malleable Systems Manifesto — An attempt to explore the idea of software being easy to change, reusable, sharable, and thoughtfully crafted.

Malleable Systems Collective

What Outranks Thread Priority? — When reawakening his laptop because to take longer and longer, Bruce set out to find the cause..

Bruce Dawson

Why NextDNS Is My New Favourite DNS Service — Note: This is about using a third party DNS service as a client rather than for serving records.

Stanislas Lange

???? Tutorials

How to Monitor Your Web Page's Total Memory Usage with performance.measureMemory() — Learn how to measure memory usage of your web page in production to detect regressions. (Chrome only, for now.)

Ulan Degenbaev

How Anti-Cheat Systems Detect System Emulation — Not an area I’m involved in but this is fascinating. These folks really know their stuff.

Daax, iPower, ajkhoury, and Drew

▶  Easy And Correct High Availability Postgres with Kubernetes — A 50 minute talk from PostgresOpen 2019 that goes all the way ‘from containers up’ until actually doing stuff with Postgres.

Steven Pousty

Some GitHub Pro-Tips Direct from GitHub — Lee Reilly is a developer and marketer at GitHub and has a whole bunch of genuinely useful GitHub power user tips here.

Lee Reilly (GitHub)

Untangling Microservices, or Balancing Complexity in Distributed Systems“The microservices honeymoon period is over.” Vladik looks at why, as well as at common design issues that turn microservices into ‘distributed big balls of mud’.

Vladik Khononov

▶  Explore Your Microservices Architecture with Graph Theory and Network Science — Can we improve microservice architectures using graph theory? Apparently yes.

Nicki Watt

Continuous Deployments for WordPress Using GitHub Actions — Shipping code to a production server often requires paid services. With GitHub Actions, Continuous Deployment is free for everyone. Read how to set that up.

Steffen Bewersdorff

The DevSecOps Security Checklist — The checklist brings security, operations & engineering together to up-level security without impacting velocity.

Sqreen sponsor

A Beginners Guide to Basic Indexing in Postgres

James Bannister

???? Code and Tools

The Desmos Graphing Calculator — One of those long-standing tools I lean on every now and then that I think everyone should know about. Ideal for graphing functions, doing approximations, etc.. and you don’t have to sign in or anything ????

Desmos

All 200+ Google Cloud Products Described in 4 Words or Less — This is a neat poster. We need AWS and Azure versions of this as well.

Greg Wilson

IntelliJ IDEA 2020.1 Released — Now supports Java 14 and its new features.

JetBrains

Portray: A Python3 Documentation Generation Tool — I’m only a Pythonista on rare occasion, but this looks really neat.

Timothy Crosley

mv.sh: Rename Files with mv Without Typing The Name Twice

Přemek Vyhnal

regex2fat: Turn Your Favorite Regex into FAT32 — This is an absolutely terrible idea (but in a fun, entertaining way ????)

8051Enthusiast

The Simpsons in CSS — Just a bit of fun, but neat to see what you can whip up with (a lot of) CSS.

Chris Pattle




pe

The reason why some people get very sick with the coronavirus, and others do not, could be hidden in their genes

Experts still aren't sure why some coronavirus cases are so much worse than others, but the answer may lie in patients' genetic differences.





pe

Idaho governor appeals to Supreme Court to stop trans inmate's surgery

A lower court had ruled that the prisoner’s gender-affirming surgery is a medical necessity, and denying it constituted a violation of the Eighth Amendment.





pe

Russia is fast becoming a coronavirus epicenter, with health workers still reporting PPE shortages. Putin is already thinking about reopening.

On Thursday, the country reported its largest one-day increase in new cases of 11,231 — yet President Putin already has his eyes on reopening.





pe

20,000 migrants have been expelled along border under coronavirus order

More than 90% of the families, children and single adults that Border Patrol encountered in April were swiftly expelled under a public health order.





pe

Bangladesh quarantines hundreds of Rohingya boat people on island: officials




pe

No warning, no escape as deadly gas swept through an Indian village

When gas began leaking from a nearby chemical factory and drifting towards his house in southern India, there were no warnings and no alarms, welder Elamanchili Venkatesh said. Venkatesh, who staggered outside blindly, said he coughed up blood before losing consciousness.





pe

James Clapper Said He ‘Never Saw Direct Empirical Evidence’ of Trump-Russia Collusion in FBI Interview

Former director of national intelligence James Clapper in 2018 said that he hadn't seen evidence that the Trump presidential campaign colluded with Russia to win the 2016 general election.Clapper was responding to a query from then-representative Tom Rooney, a Florida Republican, during an interview before the House Intelligence Committee. The transcript of the interview was released on Thursday."I never saw any direct empirical evidence that the Trump campaign or someone in it was plotting [or] conspiring with the Russians to meddle with the election," Clapper said."That's not to say that there weren't concerns about the evidence we were seeing, anecdotal evidence…[redacted]," Clapper added. "But I do not recall any instance when I had direct evidence of the content of these meetings. It's just the frequency and prevalence of them was of concern."Rooney then asked Clapper, "At what time is collusion collusion, and at what time is it just people that may have an affiliation with the campaign meeting or talking with… the Russian ambassador or somebody that's of Russian origin, and when should that be taken as something that rises to the level of an Intelligence Community concern?""I really can't answer it other than the sort of visceral reaction to why all these meetings with the Russians," Clapper responded. Clapper admitted that it would be "legitimate" for incoming Trump administration officials to meet with representatives of Russia, "but I think there is a line…between that and violating the principle that in this country we traditionally have one President and one administration at a time."The interview was part of a set of 53 transcripts of interviews held by the House Intelligence Committee as part of the Russia investigation. Current committee chairman Adam Schiff had called for the release of the transcripts in 2018.However, after 43 transcripts had been reviewed and redacted by intelligence agencies as of June 2019, Schiff refused to relase the completed transcripts to the public. Current acting DNI head Richard Grenell informed Schiff on Wednesday that all the transcripts were ready for publication.





pe

Report says cellphone data suggests October shutdown at Wuhan lab, but experts are skeptical

U.S. and U.K. intel agencies are reviewing the private report, but intel analysts examined and couldn't confirm a similar theory previously.





pe

'Never Seen Anything Like This': Experts Question Dropping of Flynn Prosecution

WASHINGTON -- The Justice Department's decision to drop the criminal case against Michael Flynn, President Donald Trump's former national security adviser, even though he had twice pleaded guilty to lying to investigators, was extraordinary and had no obvious precedent, a range of criminal law specialists said Thursday."I've been practicing for more time than I care to admit and I've never seen anything like this," said Julie O'Sullivan, a former federal prosecutor who now teaches criminal law at Georgetown University.The move is the latest in a series that the department, under Attorney General William Barr, has taken to undermine and dismantle the work of the investigators and prosecutors who scrutinized Russia's 2016 election interference operation and its links to people associated with the Trump campaign.The case against Flynn for lying to the FBI about his conversations with the Russian ambassador was brought by the office of the former special counsel, Robert Mueller. It had become a political cause for Trump and his supporters, and the president had signaled that he was considering a pardon once Flynn was sentenced. But Barr instead abruptly short-circuited the case.On Thursday, Timothy Shea, the interim U.S. attorney in the District of Columbia, told the judge overseeing the case, Emmet G. Sullivan, that prosecutors were withdrawing the case. They were doing so, he said, because the department could not prove to a jury that Flynn's admitted lies to the FBI about his conversations with the ambassador were "material" ones.The move essentially erases Flynn's guilty pleas. Because he was never sentenced and the government is unwilling to pursue the matter further, the prosecution is virtually certain to end, although the judge must still decide whether to grant the department's request to dismiss it "with prejudice," meaning it could not be refiled in the future.A range of former prosecutors struggled to point to any previous instance in which the Justice Department had abandoned its own case after obtaining a guilty plea. They portrayed the justification Shea pointed to -- that it would be difficult to prove to a jury beyond a reasonable doubt that the lies were material -- as dubious."A pardon would have been a lot more honest," said Samuel Buell, a former federal prosecutor who now teaches criminal law at Duke University.The law regarding what counts as "material" is extremely forgiving to the government, Buell added. The idea is that law enforcement is permitted to pursue possible theories of criminality and to interview people without having firmly established that there was a crime first.James G. McGovern, a defense lawyer at Hogan Lovells and a former federal prosecutor, said juries rarely bought a defendant's argument that a lie did not involve a material fact."If you are arguing 'materiality,' you usually lose, because there is a tacit admission that what you said was untrue, so you lose the jury," he said.No career prosecutors signed the motion. Shea is a former close aide to Barr. In January, Barr installed him as the top prosecutor in the district that encompasses the nation's capital after maneuvering out the Senate-confirmed former top prosecutor in that office, Jessie K. Liu.Soon after, in an extraordinary move, four prosecutors in the office abruptly quit the case against Trump's longtime friend Roger Stone. They did so after senior Justice Department officials intervened to recommend a more lenient prison term than standard sentencing guidelines called for in the crimes Stone was convicted of committing -- including witness intimidation and perjury -- to conceal Trump campaign interactions with WikiLeaks.It soon emerged that Barr had also appointed an outside prosecutor, Jeff Jensen, the U.S. attorney in St. Louis, to review the Flynn case files. The department then began turning over FBI documents showing internal deliberations about questioning Flynn, like what warnings to give -- even though such files are usually not provided to the defense.Flynn's defense team has mined such files for ammunition to portray the FBI as running amok in its decision to question Flynn in the first place. The questioning focused on his conversations during the transition after the 2016 election with the Russian ambassador about the Obama administration's imposition of sanctions on Russia for its interference in the American election.The FBI had already concluded that there was no evidence that Flynn, a former Trump campaign adviser, had personally conspired with Russia about the election, and it had decided to close out the counterintelligence investigation into him. Then questions arose about whether and why Flynn had lied to administration colleagues like Vice President Mike Pence about his conversations with the ambassador.Because the counterintelligence investigation was still open, the bureau used it as a basis to question Flynn about the conversations and decided not to warn him at its onset that it would be a crime to lie. Notes from Bill Priestap, then the head of the FBI's counterintelligence division, show that he wrote at one point about the planned interview: "What's our goal? Truth/admission or to get him to lie, so we can prosecute him or get him fired?"Barr has also appointed another outside prosecutor, John H. Durham, the U.S. attorney in Connecticut, to reinvestigate the Russia investigators even though the department's independent inspector general was already scrutinizing them.And his department has intervened in a range of other ways, from seeking more comfortable prison accommodations last year for Paul Manafort, Trump's former campaign chairman, to abruptly dropping charges in March against two Russian shell companies that were about to go to trial for financing schemes to interfere in the 2016 election using social media.Barr has let it be known that he does not think the FBI ever had an adequate legal basis to open its Russia investigation in the first place, contrary to the judgment of the Justice Department's inspector general.In an interview on CBS News on Thursday, Barr defended the dropping of the charges against Flynn on the grounds that the FBI "did not have a basis for a counterintelligence investigation against Flynn at that stage."Anne Milgram, a former federal prosecutor and former New Jersey attorney general who teaches criminal law at New York University, defended the FBI's decision to question Flynn in January 2017. She said that much was still a mystery about the Russian election interference operation at the time and that Flynn's lying to the vice president about his postelection interactions with a high-ranking Russian raised new questions.But, she argued, the more important frame for assessing the dropping of the case was to recognize how it fit into the larger pattern of the Barr-era department "undercutting the law enforcement officials and prosecutors who investigated the 2016 election and its aftermath," which she likened to "eating the Justice Department from the inside out."This article originally appeared in The New York Times.(C) 2020 The New York Times Company





pe

Google employees are told to expect to work from home for the rest of the year, but a select few will be allowed to return to offices as soon as June

Google CEO Sundar Pichai has told employees to expect to work from home for the remainder of 2020, but will open offices for certain exceptions.





pe

Katie Miller, Pence spokeswoman, tests positive for coronavirus

The diagnosis brings the threat of infection into the president's inner circle.





pe

Plastic shields in place, Dutch schools to reopen amid coronavirus

At the Springplank school in the Dutch city of Den Bosch, staff have installed plastic shields around students' desks and disinfectant gel dispensers at the doorways as part of preparations to reopen amid the country's coronavirus outbreak. New infections in the Netherlands have been declining for weeks, and the government on Wednesday announced a schedule to relax some of its lockdown measures, with elementary schools to reopen on May 11. "Our teachers are not worried," said Rascha van der Sluijs, the school's technical coordinator.





pe

Off-duty officer body slams Walmart shopper irate over face mask rule

The officer used a “takedown measure” to gain control of the woman because of “other threat factors in the store,” a police official said.





pe

Coronavirus: Are dentists open for emergency care? And other questions

Are dentists open for emergency care, and other questions answered by BBC experts.




pe

VE Day: People celebrate with bunting and bonfires

People celebrate VE Day across Britain, following Germany's surrender in 1945.




pe

Labour Party: Starmer moves to rein in shadow cabinet spending plans

Leaked letter from shadow minister reveals attempt to impose discipline on top team, writes Iain Watson.




pe

Coronavirus: UK death toll passes Italy to be highest in Europe

The figure of 29,427 deaths is "a massive tragedy", the foreign secretary says, but steers clear of comparisons.




pe

Anti-abortion campaigner loses Stella Creasy poster ban appeal

A judge dismisses Christian Hacking's bid to overturn a ban on posters put up around Waltham Forest.




pe

Coronavirus: UK becomes first country in Europe to pass 30,000 deaths

The UK records a further 649 deaths, taking the total number of coronavirus deaths to 30,076.




pe

Coronavirus: MP Nadia Whittome 'sacked' as carer after 'speaking out' about PPE

Nadia Whittome claims she was "sacked" but the care employer says she was no longer needed.




pe

Bank of England warns of sharpest recession on record

Bank head Andrew Bailey tells the BBC there will be no quick return to normality after the hit to jobs and income.




pe

Winston Churchill's inspiring wartime speeches in Parliament

As his great grandson launches a competition to "inspire like Churchill", we look at the PM's wartime words.




pe

Why are MPs keen for garden centres to re-open?

From boosting the economy through to health benefits, Westminster has been talking up the measure.




pe

Coronavirus lockdown: UK 'should not expect big changes'

The PM will set out a "cautious" road map for the UK in his speech on Sunday, a cabinet minister says.




pe

US shopping centres re-open: 'This is the best day ever'

In states like Texas, malls can operate at a 25% capacity and for some, it's a reason to get out of the house.




pe

Supermoon lights up night skies around the world

Known as the Flower Moon, this is the last of three supermoons to take place during this year.




pe

US Vice-President Mike Pence's aide tests positive for coronavirus

The diagnosis comes one day after Trump's personal valet tested positive for the virus.




pe

Coronavirus: 'Phone apps helped me spend time with my dying mum'

Andrew's mother was dying in hospital under lockdown, so he used technology to spend time with her.




pe

Coronavirus contact-tracing: World split between two types of app

The UK is testing its own design but a Google-Apple initiative is winning over many other nations.




pe

Things that more developers should know about databases

#301 — April 24, 2020

Read on the Web

Database Weekly

'Things I Wished More Developers Knew About Databases' — A Google engineer (whose name may be familiar to those Go developers amongst you) shares 17 insights about databases she’s picked up over the years. I strongly recommend this piece and I identify with lots of the points myself..

Jaana B. Dogan

Lambda Store: A New 'Serverless Redis' Service — This seems a neat idea. Claiming to not be just another Redis cloud service, Lambda Store applies a serverless-style pricing model which opens up a variety of neat use cases for the popular data structure server (serverless caching, for starters). The underlying system appears to be a custom clone of Redis rather than the real deal, however.

Sven Anderson

???? AWS, GCP, & Azure Punch Back at the 2020 Cloud Report — AWS, GCP, & Azure each responded to the Cockroach Labs 2020 Cloud Report with instructions on how to tune their respective clouds for optimal performance.

Cockroach Labs sponsor

How io_uring and eBPF Will Revolutionize Programming in Linux — Even more exciting times are coming for development on Linux thanks to these technologies. A good overview from an engineer at ScyllaDB.

Glauber Costa

kvrocks: An Open Source, RocksDB-based, Redis-compatible Database — You know Redis’s API is good when so many projects continue to implement it for themselves. kvrocks brings the Redis API (with pretty good support) together with the RocksDB persistent key-value store. Written in C++.

Bit Leak

Mireo SpaceTime: An Absurdly Fast Spatiotemporal Database? — The SpaceTime database provides unprecedented analytical tools speed, sometimes outperforming other state-of-the-art solutions by three orders of magnitude.

Miljen Mikić

Cloud GPUs Aimed at Data Scientists — Core Scientific, an AI and cloud infrastructure vendor, is teaming with GPU-accelerated analytics specialist SQream Technologies to deliver a “GPU Cloud for Data Scientists.”

Datanami

An Easy Postgres 12 and pgAdmin 4 Setup with Docker — Docker provides an easy and loosely coupled way to get things set up in a development environment.

Jonathan S. Katz

Why We Index Everything — Tired of constantly managing indexes to speed up queries? Learn about how Rockset automatically indexes every field in a row-based store, column-based store, and search index.

Rockset sponsor

Redis Labs Moving RedisJSON to a New Codebase Written in RustRedisJSON provides a JSON data type to Redis and it’s been ported from C to Rust for better safety and developer experience.

Gavrie Philipson (Redis Labs)

Replicate Multiple Postgres Servers to a Single MongoDB Server using Logical Decoding Output Plugin

David Zhang

xsv: A Fast CSV Command Line Toolkit Written in Rust — Another ‘Swiss Army knife’ for your slightly structured data.

Andrew Gallant

???? Jobs

DevOps Engineer at X-Team (Remote) — Join the most energizing community for developers. Work from anywhere with the world's leading brands.

X-Team

Data Engineer (Remote - USA Only) — Help us architect and design “big data” systems which require queries returning within sub-second response times.

Social Chorus




pe

Coronavirus: Schools in Wales not reopening on 1 June

The situation for schools in Wales will not change on 1 June, the education minister says.




pe

Coronavirus: Key safeguards needed for schools to reopen - unions

Education unions say they want scientific evidence it is safe for teachers and pupils to return.




pe

Coronavirus: When might Hollywood reopen for business?

Cast and crews might have to quarantine together in the future when filming begins again.




pe

ICYMI: Penguin chicks and new dining ideas

Some of the stories from around the world that you may have missed this week.




pe

Norfolk Island morepork owls: Major breakthrough for rare species

Two fledglings may have safeguarded the future of the Norfolk Island morepork owl.




pe

Building Great User Experiences with Concurrent Mode and Suspense

At React Conf 2019 we announced an experimental release of React that supports Concurrent Mode and Suspense. In this post we’ll introduce best practices for using them that we’ve identified through the process of building the new facebook.com.

This post will be most relevant to people working on data fetching libraries for React.

It shows how to best integrate them with Concurrent Mode and Suspense. The patterns introduced here are based on Relay — our library for building data-driven UIs with GraphQL. However, the ideas in this post apply to other GraphQL clients as well as libraries using REST or other approaches.

This post is aimed at library authors. If you’re primarily an application developer, you might still find some interesting ideas here, but don’t feel like you have to read it in its entirety.

Talk Videos

If you prefer to watch videos, some of the ideas from this blog post have been referenced in several React Conf 2019 presentations:

This post presents a deeper dive on implementing a data fetching library with Suspense.

Putting User Experience First

The React team and community has long placed a deserved emphasis on developer experience: ensuring that React has good error messages, focusing on components as a way to reason locally about app behavior, crafting APIs that are predictable and encourage correct usage by design, etc. But we haven’t provided enough guidance on the best ways to achieve a great user experience in large apps.

For example, the React team has focused on framework performance and providing tools for developers to debug and tune application performance (e.g. React.memo). But we haven’t been as opinionated about the high-level patterns that make the difference between fast, fluid apps and slow, janky ones. We always want to ensure that React remains approachable to new users and supports a variety of use-cases — not every app has to be “blazing” fast. But as a community we can and should aim high. We should make it as easy as possible to build apps that start fast and stay fast, even as they grow in complexity, for users on varying devices and networks around the world.

Concurrent Mode and Suspense are experimental features that can help developers achieve this goal. We first introduced them at JSConf Iceland in 2018, intentionally sharing details very early to give the community time to digest the new concepts and to set the stage for subsequent changes. Since then we’ve completed related work, such as the new Context API and the introduction of Hooks, which are designed in part to help developers naturally write code that is more compatible with Concurrent Mode. But we didn’t want to implement these features and release them without validating that they work. So over the past year, the React, Relay, web infrastructure, and product teams at Facebook have all collaborated closely to build a new version of facebook.com that deeply integrates Concurrent Mode and Suspense to create an experience with a more fluid and app-like feel.

Thanks to this project, we’re more confident than ever that Concurrent Mode and Suspense can make it easier to deliver great, fast user experiences. But doing so requires rethinking how we approach loading code and data for our apps. Effectively all of the data-fetching on the new facebook.com is powered by Relay Hooks — new Hooks-based Relay APIs that integrate with Concurrent Mode and Suspense out of the box.

Relay Hooks — and GraphQL — won’t be for everyone, and that’s ok! Through our work on these APIs we’ve identified a set of more general patterns for using Suspense. Even if Relay isn’t the right fit for you, we think the key patterns we’ve introduced with Relay Hooks can be adapted to other frameworks.

Best Practices for Suspense

It’s tempting to focus only on the total startup time for an app — but it turns out that users’ perception of performance is determined by more than the absolute loading time. For example, when comparing two apps with the same absolute startup time, our research shows that users will generally perceive the one with fewer intermediate loading states and fewer layout changes as having loaded faster. Suspense is a powerful tool for carefully orchestrating an elegant loading sequence with a few, well-defined states that progressively reveal content. But improving perceived performance only goes so far — our apps still shouldn’t take forever to fetch all of their code, data, images, and other assets.

The traditional approach to loading data in React apps involves what we refer to as “fetch-on-render”. First we render a component with a spinner, then fetch data on mount (componentDidMount or useEffect), and finally update to render the resulting data. It’s certainly possible to use this pattern with Suspense: instead of initially rendering a placeholder itself, a component can “suspend” — indicate to React that it isn’t ready yet. This will tell React to find the nearest ancestor <Suspense fallback={<Placeholder/>}>, and render its fallback instead. If you watched earlier Suspense demos this example may feel familiar — it’s how we originally imagined using Suspense for data-fetching.

It turns out that this approach has some limitations. Consider a page that shows a social media post by a user, along with comments on that post. That might be structured as a <Post> component that renders both the post body and a <CommentList> to show the comments. Using the fetch-on-render approach described above to implement this could cause sequential round trips (sometimes referred to as a “waterfall”). First the data for the <Post> component would be fetched and then the data for <CommentList> would be fetched, increasing the time it takes to show the full page.

There’s also another often-overlooked downside to this approach. If <Post> eagerly requires (or imports) the <CommentList> component, our app will have to wait to show the post body while the code for the comments is downloading. We could lazily load <CommentList>, but then that would delay fetching comments data and increase the time to show the full page. How do we resolve this problem without compromising on the user experience?

Render As You Fetch

The fetch-on-render approach is widely used by React apps today and can certainly be used to create great apps. But can we do even better? Let’s step back and consider our goal.

In the above <Post> example, we’d ideally show the more important content — the post body — as early as possible, without negatively impacting the time to show the full page (including comments). Let’s consider the key constraints on any solution and look at how we can achieve them:

  • Showing the more important content (the post body) as early as possible means that we need to load the code and data for the view incrementally. We don’t want to block showing the post body on the code for <CommentList> being downloaded, for example.
  • At the same time we don’t want to increase the time to show the full page including comments. So we need to start loading the code and data for the comments as soon as possible, ideally in parallel with loading the post body.

This might sound difficult to achieve — but these constraints are actually incredibly helpful. They rule out a large number of approaches and spell out a solution for us. This brings us to the key patterns we’ve implemented in Relay Hooks, and that can be adapted to other data-fetching libraries. We’ll look at each one in turn and then see how they add up to achieve our goal of fast, delightful loading experiences:

  1. Parallel data and view trees
  2. Fetch in event handlers
  3. Load data incrementally
  4. Treat code like data

Parallel Data and View Trees

One of the most appealing things about the fetch-on-render pattern is that it colocates what data a component needs with how to render that data. This colocation is great — an example of how it makes sense to group code by concerns and not by technologies. All the issues we saw above were due to when we fetch data in this approach: upon rendering. We need to be able to fetch data before we’ve rendered the component. The only way to achieve that is by extracting the data dependencies into parallel data and view trees.

Here’s how that works in Relay Hooks. Continuing our example of a social media post with body and comments, here’s how we might define it with Relay Hooks:

// Post.js
function Post(props) {
  // Given a reference to some post - `props.post` - *what* data
  // do we need about that post?
  const postData = useFragment(graphql`
    fragment PostData on Post @refetchable(queryName: "PostQuery") {
      author
      title
      # ...  more fields ...
    }
  `, props.post);

  // Now that we have the data, how do we render it?
  return (
    <div>
      <h1>{postData.title}</h1>
      <h2>by {postData.author}</h2>
      {/* more fields  */}
    </div>
  );
}

Although the GraphQL is written within the component, Relay has a build step (Relay Compiler) that extracts these data-dependencies into separate files and aggregates the GraphQL for each view into a single query. So we get the benefit of colocating concerns, while at runtime having parallel data and view trees. Other frameworks could achieve a similar effect by allowing developers to define data-fetching logic in a sibling file (maybe Post.data.js), or perhaps integrate with a bundler to allow defining data dependencies with UI code and automatically extracting it, similar to Relay Compiler.

The key is that regardless of the technology we’re using to load our data — GraphQL, REST, etc — we can separate what data to load from how and when to actually load it. But once we do that, how and when do we fetch our data?

Fetch in Event Handlers

Imagine that we’re about to navigate from a list of a user’s posts to the page for a specific post. We’ll need to download the code for that page — Post.js — and also fetch its data.

Waiting until we render the component has problems as we saw above. The key is to start fetching code and data for a new view in the same event handler that triggers showing that view. We can either fetch the data within our router — if our router supports preloading data for routes — or in the click event on the link that triggered the navigation. It turns out that the React Router folks are already hard at work on building APIs to support preloading data for routes. But other routing frameworks can implement this idea too.

Conceptually, we want every route definition to include two things: what component to render and what data to preload, as a function of the route/url params. Here’s what such a route definition might look like. This example is loosely inspired by React Router’s route definitions and is primarily intended to demonstrate the concept, not a specific API:

// PostRoute.js (GraphQL version)

// Relay generated query for loading Post data
import PostQuery from './__generated__/PostQuery.graphql';

const PostRoute = {
  // a matching expression for which paths to handle
  path: '/post/:id',

  // what component to render for this route
  component: React.lazy(() => import('./Post')),

  // data to load for this route, as function of the route
  // parameters
  prepare: routeParams => {
    // Relay extracts queries from components, allowing us to reference
    // the data dependencies -- data tree -- from outside.
    const postData = preloadQuery(PostQuery, {
      postId: routeParams.id,
    });

    return { postData };
  },
};

export default PostRoute;

Given such a definition, a router can:

  • Match a URL to a route definition.
  • Call the prepare() function to start loading that route’s data. Note that prepare() is synchronous — we don’t wait for the data to be ready, since we want to start rendering more important parts of the view (like the post body) as quickly as possible.
  • Pass the preloaded data to the component. If the component is ready — the React.lazy dynamic import has completed — the component will render and try to access its data. If not, React.lazy will suspend until the code is ready.

This approach can be generalized to other data-fetching solutions. An app that uses REST might define a route like this:

// PostRoute.js (REST version)

// Manually written logic for loading the data for the component
import PostData from './Post.data';

const PostRoute = {
  // a matching expression for which paths to handle
  path: '/post/:id',

  // what component to render for this route
  component: React.lazy(() => import('./Post')),

  // data to load for this route, as function of the route
  // parameters
  prepare: routeParams => {
    const postData = preloadRestEndpoint(
      PostData.endpointUrl, 
      {
        postId: routeParams.id,
      },
    );
    return { postData };
  },
};

export default PostRoute;

This same approach can be employed not just for routing, but in other places where we show content lazily or based on user interaction. For example, a tab component could eagerly load the first tab’s code and data, and then use the same pattern as above to load the code and data for other tabs in the tab-change event handler. A component that displays a modal could preload the code and data for the modal in the click handler that triggers opening the modal, and so on.

Once we’ve implemented the ability to start loading code and data for a view independently, we have the option to go one step further. Consider a <Link to={path} /> component that links to a route. If the user hovers over that link, there’s a reasonable chance they’ll click it. And if they press the mouse down, there’s an even better chance that they’ll complete the click. If we can load code and data for a view after the user clicks, we can also start that work before they click, getting a head start on preparing the view.

Best of all, we can centralize that logic in a few key places — a router or core UI components — and get any performance benefits automatically throughout our app. Of course preloading isn’t always beneficial. It’s something an application would tune based on the user’s device or network speed to avoid eating up user’s data plans. But the pattern here makes it easier to centralize the implementation of preloading and the decision of whether to enable it or not.

Load Data Incrementally

The above patterns — parallel data/view trees and fetching in event handlers — let us start loading all the data for a view earlier. But we still want to be able to show more important parts of the view without waiting for all of our data. At Facebook we’ve implemented support for this in GraphQL and Relay in the form of some new GraphQL directives (annotations that affect how/when data is delivered, but not what data). These new directives, called @defer and @stream, allow us to retrieve data incrementally. For example, consider our <Post> component from above. We want to show the body without waiting for the comments to be ready. We can achieve this with @defer and <Suspense>:

// Post.js
function Post(props) {
  const postData = useFragment(graphql`
    fragment PostData on Post {
      author
      title

      # fetch data for the comments, but don't block on it being ready
      ...CommentList @defer
    }
  `, props.post);

  return (
    <div>
      <h1>{postData.title}</h1>
      <h2>by {postData.author}</h2>
      {/* @defer pairs naturally with <Suspense> to make the UI non-blocking too */}
      <Suspense fallback={<Spinner/>}>
        <CommentList post={postData} />
      </Suspense>
    </div>
  );
}

Here, our GraphQL server will stream back the results, first returning the author and title fields and then returning the comment data when it’s ready. We wrap <CommentList> in a <Suspense> boundary so that we can render the post body before <CommentList> and its data are ready. This same pattern can be applied to other frameworks as well. For example, apps that call a REST API might make parallel requests to fetch the body and comments data for a post to avoid blocking on all the data being ready.

Treat Code Like Data

But there’s one thing that’s still missing. We’ve shown how to preload data for a route — but what about code? The example above cheated a bit and used React.lazy. However, React.lazy is, as the name implies, lazy. It won’t start downloading code until the lazy component is actually rendered — it’s “fetch-on-render” for code!

To solve this, the React team is considering APIs that would allow bundle splitting and eager preloading for code as well. That would allow a user to pass some form of lazy component to a router, and for the router to trigger loading the code alongside its data as early as possible.

Putting It All Together

To recap, achieving a great loading experience means that we need to start loading code and data as early as possible, but without waiting for all of it to be ready. Parallel data and view trees allow us to load the data for a view in parallel with loading the view (code) itself. Fetching in an event handler means we can start loading data as early as possible, and even optimistically preload a view when we have enough confidence that a user will navigate to it. Loading data incrementally allows us to load important data earlier without delaying the fetching of less important data. And treating code as data — and preloading it with similar APIs — allows us to load it earlier too.

Using These Patterns

These patterns aren’t just ideas — we’ve implemented them in Relay Hooks and are using them in production throughout the new facebook.com (which is currently in beta testing). If you’re interested in using or learning more about these patterns, here are some resources:

  • The React Concurrent docs explore how to use Concurrent Mode and Suspense and go into more detail about many of these patterns. It’s a great resource to learn more about the APIs and use-cases they support.
  • The experimental release of Relay Hooks implements the patterns described here.
  • We’ve implemented two similar example apps that demonstrate these concepts:

    • The Relay Hooks example app uses GitHub’s public GraphQL API to implement a simple issue tracker app. It includes nested route support with code and data preloading. The code is fully commented — we encourage cloning the repo, running the app locally, and exploring how it works.
    • We also have a non-GraphQL version of the app that demonstrates how these concepts can be applied to other data-fetching libraries.

While the APIs around Concurrent Mode and Suspense are still experimental, we’re confident that the ideas in this post are proven by practice. However, we understand that Relay and GraphQL aren’t the right fit for everyone. That’s ok! We’re actively exploring how to generalize these patterns to approaches such as REST, and are exploring ideas for a more generic (ie non-GraphQL) API for composing a tree of data dependencies. In the meantime, we’re excited to see what new libraries will emerge that implement the patterns described in this post to make it easier to build great, fast user experiences.




pe

An interview with Ruby ETL expert Thibaut Barrère

#499 — April 30, 2020

Read on the Web

???? Occasionally we run interviews in Ruby Weekly and we're back with another one.. with long time Rubyist and Kiba maintainer, Thibaut Barrère. Be sure to check out the bottom of this issue to read it, especially if you ever run ETL jobs with Ruby! ????

Ruby Weekly

▶  Let's Build a Twitter Clone in 10 Minutes with Rails, CableReady, and StimulusReflex — You know that cloning Twitter in 10 minutes is impossible, but what about the core mechanism of the idea? After a slow first minute, this video does a pretty good job of showing off some techniques you might not have used before.

Nate Hopkins

discuss.rubyonrails: The Rails Project Discussion Forum — Basically a Web version of the Rails mailing lists and a worthwhile place to head if you want to suggest features, ask questions, etc.

Ruby on Rails Discussions

Easy Rails Deployments — Deploy your Ruby, Rails, Sinatra, and Rack application to any cloud or server. Cloud 66 offers a scalable Heroku alternative that doesn't lock you in. Try it free and get extra $66 free credits with the code: 'Ruby-Weekly'.

Cloud 66 sponsor

sequel-activerecord-adapter: Allows Sequel to Reuse an ActiveRecord Connection — If you want to use more Sequel or migrate in that direction, this makes it easy.

Janko Marohnić

Ruby Adds Experimental Support for 'End-Less' Method Definitions — We’ve touched on this in a previous issue, but if you fancy a proper blog post with examples, this is more accessible than digging through feature tracker discussions. I’m not a fan of this syntax myself yet, but Prateek does a good job of selling it.

Prateek Choudhary

CableReady: Trigger Client-Side DOM Changes from Server-Side Ruby — If you skipped the video above because it’s a video (and I know many of you do ????) CableReady is still worth checking out. It aims to “complete the ActionCable story” by providing a way to directly interact with clients over ActionCable WebSockets. The docs will help you get the idea.

Hopsoft

???? Jobs

Find a Job Through Vettery — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

Security Engineer (Remote) — Are you an engineer with experience in Rails and/or Go? Join our team and help secure our apps and cloud infrastructure.

Shogun

ℹ️ Interested in running a job listing in Ruby Weekly? There's more info here.

???? Articles & Tutorials

A Practical Use for PStorePStore is one of the older parts of Ruby’s stdlib and lets you persist (and restore) a Ruby hash to disk. I haven’t seen it in Ruby code for years but Arkency have found a neat, modern use case.

Paweł Pacana

▶  Drag and Drop Sortable Lists with Rails and Stimulus JS — How to wire up drag and drop lists with a Rails app using Sortable, Stimulus and acts_as_list.

Go Rails

Setting Up Multi-Factor Authentication for RubyGems.org — If you’re a registered user of the official Ruby Gems repository, you should have had an email this week about securing your account using 2FA. This is just my own reminder that this is a good idea especially if you publicly publish widely used gems! :-)

Rubygems.org

Let’s Explore Big-O Notation With Ruby ???? — Learn to use Big-O to look at an algorithm and easily discern its efficiency, without having to run a profiling tool.

Honeybadger sponsor

▶  Discussing Docker and Kubernetes with Kelsey Hightower — A worthwhile show to listen to if Kubernetes and Docker intimidate you but you want to know a little more. Kelsey is good at breaking these things down into understandable pieces.

Rails with Jason Podcast podcast

Rails System Tests in Docker — We’re seeing an uptick in articles about system tests in Rails. Here’s how to integrate them into your development Docker setup.

Hint.io

The Difference Between System Specs and Feature Specs — If you’ve felt the difference between RSpec’s “feature specs” and “system specs” is quite subtle, this explanation will help.

Jason Swett

Why Rubyists Should Consider Learning Go — If you want compilation and a type system, Crystal is probably a better fit for Rubyists, but Go is undoubtedly a neat language and ecosystem (and if you do end up in the Go world, check out our Go weekly! ????)

Ayooluwa Isaiah

Building a Ruby CLI with Thor

Daniel Gómez

???? Code and Tools

git curate: Peruse and Delete git Branches Ergonomically — Got a repo cluttered with branches here and there? git curate aims to cure the pains of getting those branches back under control.

Matt Harvey

MessageBus: A Reliable and Robust Messaging Bus for Ruby and Rack

Sam Saffron

Are You Spending Too Much on Heroku?

Rails Autoscale sponsor

bootstrap_form: A Rails Form Builder for Bootstrap v4-Style Forms

Bootstrap Ruby

ActiveModelAttributes: The Active Record Attributes API, but for Active Model — Brings some of the goodies of the Rails 5 Active Record attributes API to ActiveModel too. 1.6.0 just dropped.

Karol Galanciak

???? A Q&A with…
Thibaut Barrère
Creator of Kiba ETL

Thibaut Barrère is a long-time Rubyist and data engineer who built and maintains the popular Extract, Transform, and Load (ETL) framework Kiba. We asked him some questions about his work:

What inspired you to create Kiba?

A lot of my work since ~2005 has been focused on data integration (making systems speak together), data aggregation etc. I sometimes used GUI-based tools like Microsoft SSIS which, while powerful, are quite far from the coding experience.

I was already using Ruby at that time, and was happy to discover activewarehouse-etl (maintained by Anthony Eden, who runs DNSimple now) providing a Ruby DSL to declare data pipelines. I used it for a while with very good success to implement data extractions and business intelligence ETL, and ultimately took over the maintenance.

In the long run, though (as I explained in a recent Paris.rb talk), the balance between the the cost of OSS maintenance and the usability for my billable and non-billable use-cases proved to be not good enough, which made me decide to stop the maintenance, sadly.

I still wanted to use Ruby to write data pipelines, but I needed to cover more use-cases and reduce the OSS maintenance burden at the same time. This ultimately led me to write and share (in 2015) Kiba ETL, a focused DSL for declarative processing, matching those criterias.

Do you find yourself adding more features while in quarantine?

Before the quarantine, I directed my Kiba bandwith and focus on finalizing Kiba v3 and rewriting the documentation from scratch, to properly encourage best practices I’ve been discovering. I also created experimental branches for Ruby 2.7/2.8 keywords.

During the quarantine, I've reduced client work and OSS work too, to focus on shipping Kiba Pro v2 (which I’ll announce shortly officially). I’ve extracted and generalized (from real-life projects) very useful components, such as a “batch SQL lookup” (useful when replacing relationships keys during data migrations and datawarehouses sync code, in batch rather than row by row), a “file lock” to ensure a single job runs at once, and a “parallel transform” to achieve easy concurrency for things like HTTP queries.

What's the wildest ETL that you've encountered?

Getting the data out of a system which is actively not acting in that direction is always a bit wild.. One can see all types of fancy stuff on the field. For instance, it is not uncommon to have an ETL process start a headless browser, jump through pages, just to get to the CSV/PDF/Excel file that you will then use as your data source!

You can also end up having to figure out ways to read or write very old file formats at times. Recently I wrote a Kiba component to generate a COBOL delimited file, for instance. In large companies, a very widely used I/O is good old SFTP, far away from modern APIs and formats.

Can you tell us how to say your last name? ????

I had to deploy a page to my blog to answer that question properly ????. You’ll find out how to say my name here.

Merci Thibaut!

You can read some of Thibaut's posts on his blog and find out more about Kiba ETL here.




pe

BBC News - Special reports




pe

The 2019 Go developer survey results are available

#309 — April 24, 2020

Unsubscribe  :  Read on the Web

Golang Weekly

Go Developer Survey 2019 Results — The annual survey results are here but calculated differently than in previous years. See how the community feels, what tools we use, and what we’re really using Go for.

The Go Blog

Fiber: An Express.js Inspired Web Framework for Go — If you know Express (from the Node world) than Fiber will look very familiar. It supports middleware, WebSockets, and various template engines, all while boasting a low memory footprint. Built on top of FastHTTP.

Fiber

We Now Offer Remote Go, Docker or Kubernetes Training — We offer live-streaming remote training as well as video training for engineers and companies that want to learn Go, Docker and/or Kubernetes. Having trained over 5,000 engineers, we have carefully crafted these classes for students to get as much value as possible.

Ardan Labs sponsor

A Comparison of Three Programming Languages for Bioinformatics — This is quite an academic piece but basically Go, Java and C++ were put head to head in an intensive bioinformatics task. The good news? Go won on memory usage and beat the C++17 approach (which was admittedly less than ideal) in performance. The team in question chose Go going forward.

BMC Bioinformatics

Go for Cloud — A Few Reflections for FaaS with AWS Lambda — A response to a this article about Go’s pros and cons in the cloud. You should read both.

Filip Lubniewski

???? Jobs

Enjoy Building Scalable Infrastructure in Go? Stream Is Hiring — Like coding in Go? We do too. Stream is hiring in Amsterdam. Apply now.

Stream

Golang Developer at X-Team (Remote) — Join the most energizing community for developers. Work from anywhere with the world's leading brands.

X-Team

Find a Job Through Vettery — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

???? Articles & Tutorials

An Introduction to Debugging with Delve — If you’re in the “I don’t really use a debugger..” camp, Paschalis’s story and brief tutorial might help you dip a toe into the water.

Paschalis Tsilias

Object Ordering in Go — This is all about object comparison and the types of comparisons that are allowed in Go. Reading this post > Not reading this post.

Eyal Posener

How to Manage Database Timeouts and Cancellations in Go — How to cancel database queries from your app and what quirks and edge cases you need to be aware of.

Alex Edwards

The Go Security Checklist — From code to infrastructure, learn how to improve the security of your Go applications with the Go security checklist.

Sqreen sponsor

Data Logging with Go: How to Store Customer Details Securely — Specifically, this looks at using custom protobuf FieldOptions to mark fields as OK to log and reflection to check those options.

Vadzim Zapolski-Dounar

How to Install Go in FreeBSD in 5 Minutes — You can use a package manager, but this way has advantages and it’s easy.

Jeremy Morgan

???? Code & Tools

Fynedesk: A Fyne-Powered Full Desktop Environment for Linux/Unix — Previously we’ve linked to Fyne, a Go-based cross-platform GUI framework, but now it’s been used to create an entire Linux desktop environment!

Fyne.io

Lockgate: A Cross-Platform Locking Library — Has support for distributed locks using Kubernetes and OS file locks support.

Flant

Pomerium: An Identity-Aware Secure Access Proxy — An identity aware access-proxy modeled after Google’s BeyondCorp. Think VPN access benefits but without the VPN. Built in Go, naturally.

Pomerium

Beta Launch: Code Performance Profiling - Find & Fix Bottlenecks

Blackfire sponsor

Apex Log: A Structured Logging Package for Go — Inspired by Logrus.

Apex

mediary: Add Interceptors to the Go HTTP Client — This opens up a few options: tracing, request dumping, statistics collection, etc.

Here Mobility SDK

iso9660: A Go Library for Reading and Creating ISO9660 Images — The use cases for this will be a bit niche. The author created it to dynamically generate ISOs to be mounted in vSphere VMs.

Kamil Domański

pxy: A Go Livestream Proxy from WebSockets to External RTMP Endpoints

Chua Bing Quan