- Developer 🥑
- Currently: Gatsby
- Formerly: IBM
- Portland, OR
You should use GraphQL for everything and serve your entire app as static assets
Development today isdifferent
The monolithic CMS is dying
The future is thecontent mesh
This is amazing
- Manage data using purpose-built tools
- Load data from anywhere using APIs
- Build custom UIs that combine multiple data sources
This is terrible
- Atrocious performance pitfalls
- Complex business logic to combine data sources
- UIs can become tightly coupled to back-ends
- State management leads to nightmarish complexity
Also: async is hard
How to tame the Content Mesh
- Centralize data access with GraphQL
- Serve only optimized static assets
Centralize data with GraphQL
- Better explorability
- Single source of truth
- More scalable & team-friendly
- Consistent, shareable dev workflow
Go Static for everything
- Blazing fast performance
- Simpler deployment flow
- Reduced DevOps overhead
How this works in Gatsby
- Node APIs to load any data source into GraphQL
- “Early bind” data at build time
- Generate static assets
- Automate performance tuning
- Deploy to a CDN (e.g. Netlify)
- Rehydrate to a React app in the browser
Make the Right Thingthe Easy Thing
Design your tools so the laziest, shortcuttiest,
under-the-gunniest decisions a developer can make
will still result in an excellent user experience.
But...
“Isn’t Gatsby a static site generator?
My app has dynamic data!”
static assets !== static apps
React apps are dynamicGatsby sites are React apps
Something something transitive property...Gatsby sites are dynamic
You should use GraphQL for everything and serve your entire app as static assets
Thanks!
Jason Lengstorf
Follow me on Twitter: @jlengstorf