3 ms·
@tomdale, I think you're conceptually correct (server-rendered apps don't replace your API/data server); however, it's just as misleading to say that a server-
by bsimpson 12y ago
@tomdale,
I think you're conceptually correct (server-rendered apps don't replace your API/data server); however, it's just as misleading to say that a server-rendered app replaces your CDN.
Instead, server-rendered apps add a new tier (if you were serving your app from S3 before) or replace an existing tier (your old app server). The kinds of people who needed a CDN before will still need one, and your API layer should not be tightly coupled to your app, esp. if you eventually want to support a native app or a developer ecosystem. So you end up with:
- Data layer/API server: exposes your data to a client in a RESTful way
- Browser: a client (one of potentially many) that presents data from your API in an interactive way
- App server: a node/io.js server that renders your app to HTML and sends it to the browser. It optimizes for search and slow devices without duplicating your app logic. This role was previously filled by Flask/Django/Rails/PHP, though sometimes conflated with the data layer.
- CDN: makes your media that doesn't change often highly available and lower latency. If you needed on of these before you added an app server, you probably still need one.
- tomdale 12y agoYes, I totally agree. Sorry if that was confusing—I was trying to simplify the diagrams and perhaps oversimplified. You would of course still use a CDN for any static assets. Only the HTML that changes would be served by FastBoot, and of course you probably want to cache certain responses from that as well.