Paragraphs Got a Problem

YO Let's Solve It!

by Hawkeye Tenderwolf

$ whoami

Senior Developer at Lullabot

What is Paragraphs?

  • Powerful content creation tool

  • Chaos manager (DX-friendly)

  • Silly name

Paragraphs is a:

Why do we love Paragraphs?

Reasons to Paragraph:

  1. "Panels" pains

  2. Better than a WYSIWYG

  3. Components rock

  4. We like structured/semantic data (*even if it's an illusion)

  5. It's Drupally

How does Paragraphs work?

     Entity

  + Entity Reference

  + Revisions

  = ...

Entity Reference Revisions

The problems

  • Database bloat

  • Form save timeouts

  • Dependency tree hell

  • Migration woes

  • ...

A typical "landing page" using Paragraphs for layout and content

# per depth Total
Grid rows 10 10
Grid column 3 30
Content (e.g., Hero) 2 60
Nested content (e.g., Hero CTA) 2 120

Sum total: 10 + 30 + 60 + 120 = 220 paragraph entities

A typical "landing page" using Paragraphs for layout and content

Database Bloat

 

1000 landing pages
100 minor edits
5 languages enabled

1000 * 100 * 5 = 500,000 revisions

500,000 revisions * 220 paragraphs = 110,000,000 rows

Let's be fair.

 

  • Paragraphs is but the most prominent symptom.

  • Same thing can happen with other Entity types

  • Paragraphs is solving a real need.

So what are our options??

I'm so glad you asked!

Two main use-cases:

  1. Layout

  2. Complex Field Data (repeatable chunks / compound fields)

1. For Layout:

Layout Builder!

2. For complex field data:

 

Custom field definitions

CCK

  • Limited

  • Concise

Field API

  • Powerful

  • Crufty

Create Custom Compound Fields

Questions / Group Therapy

Rich Fields

By Hawkeye Tenderwolf