News for hackers. Stuff that matters.
Re:Introducing Ghost 2.0 by johnonolan on Tuesday August 21, 2018 @11:21AM (#17810382)
Heyo, John from Ghost here. Thanks for the kind words so far about 2.0 — it’s been a hectic few months! Earlier this year I talked about how we were shifting focus from simplicity to power - https://blog.ghost.org/5/ - and this is the first big release since that move. Whereas early versions were extremely opinionated and rigid, we’re now starting to bake in more flexibility and configurability to allow for a more diverse set of use-cases.

Some fun technical details from this release:

- New features require building a routing map for all possible URLs on boot, which is a dramatically heavy operation. We were eventually forced to forgo our traditional ORM layer entirely to get any degree of performance (insert: shock/awe)

- Related: It turns out SQLite3 has a query limit of 999 SQL variables, so we had to implement a recursive query strategy for SQLite only. Wild. Default is MySQL though, which was fine.

- Conquered a pretty spectacular memory leak when running in development as a result of trace-logging promises in Bluebird, which is “a full featured promise library with unmatched performance” — …unless you implicitly enable debug traces

Also: Let me be the first to say that I can’t believe there’s still no Postgres support, which is absolutely outrageous.

On a serious note, thanks for all the support and there are several of us hanging out in the comments if anyone has technical questions which they’re curious about.

Re:Introducing Ghost 2.0 by beaconstudios on Tuesday August 21, 2018 @11:33AM (#17810501)
> New features require building a routing map for all possible URLs on boot, which is a dramatically heavy operation. We were eventually forced to forgo our traditional ORM layer entirely to get any degree of performance (insert: shock/awe) - Related: It turns out SQLite3 has a query limit of 999 SQL variables, so we had to implement a recursive query strategy for SQLite only. Wild.

Out of pure technical curiosity, how did this come to be the chosen approach? A query with 999 variables strikes me as a serious code smell, but at the same time I don't doubt you guys seriously considered the alternatives before choosing this route.

Re:Introducing Ghost 2.0 by erisds on Tuesday August 21, 2018 @12:54PM (#17811332)
We're loading all public-facing resources - so posts, tags, authors and importantly the relations between them - in as few queries as possible, using fairly typical where...in queries in order to build the relations. SQLite uses variables for in queries, and so sites with a lot of content triggered the "more than 999 variables" error.

Solvable, of course, but quite an interesting limitation to discover!

Re:Introducing Ghost 2.0 by doh on Wednesday August 22, 2018 @01:32AM (#17816539)
I haven't check the code, but as few queries as possible is not always the best approach. I bet you guys spent a lot of time on the problem, but still very curious how you landed with this decision.

For the relation data, you should check out Hexastore [0] (essentially graph storage). It takes up much more space, but you can follow any paths of relationship and you can do it step by step instead of loading everything at once.

[0] http://www.vldb.org/pvldb/1/1453965.pdf

Re:Introducing Ghost 2.0 by phaas on Tuesday August 21, 2018 @10:00PM (#17815647)
I discovered a similar limit with postgresql, mainly due to the protocol sending the query length as a 16-bit number, limiting the total length to ~65k characters. In that case it was far better to create a temporary table and JOIN that rather than using an " IN (..)" clause anyway, so that's another option if SQLite supports it.
Re:Introducing Ghost 2.0 by anarazel on Wednesday August 22, 2018 @01:40AM (#17816580)
There's no 16bit number limiting query length in PG, the limit is 1GB and has been for a LONG time. But it's indeed often a good idea to use a temp table for some of such cases.
Re:Introducing Ghost 2.0 by themmes on Wednesday August 22, 2018 @12:56AM (#17816419)
This sounds like an interesting usecase for a graph database, is that something you have considered?
Re:Introducing Ghost 2.0 by lookingsideways on Wednesday August 22, 2018 @04:32AM (#17817238)
It's an interesting idea but Ghost is a primarily self-hosted application with a non-technical user base. The freedom to swap out or add core dependencies like database servers isn't really available in that environment.
Re:Introducing Ghost 2.0 by jmelloy on Tuesday August 21, 2018 @02:30PM (#17812365)
Oracle had this limitation, too, or at least it did a few years ago.
Re:Introducing Ghost 2.0 by nathcd on Tuesday August 21, 2018 @02:39PM (#17812475)
Hey John -- I recall seeing on your Mastodon account recently that you were interested in supporting ActivityPub for Ghost blogs. Any news on that front?
Re:Introducing Ghost 2.0 by johnonolan on Tuesday August 21, 2018 @03:09PM (#17812752)
Yeah! Very interested - we have a highly voted topic for it over on the forum with some ideas, too. It's not a primary focus of the core team right now, but it's the sort of thing we'd be very interested in open source contributions for.

One of the main motivations for people using Medium is the network effect. I think it would be really cool if that could be recreated in a platform-agnostic, decentralised way :)

Re:Introducing Ghost 2.0 by sachinag on Tuesday August 21, 2018 @05:36PM (#17814061)
I'm not sure how you could improve on blogrolls here, but I'm curious to see what you try.
Re:Introducing Ghost 2.0 by alexktz on Tuesday August 21, 2018 @05:55PM (#17814201)
I host several self-hosted blogs using Ghost 1.0 in Docker. When can we expect 2.0 released via Docker please?
Re:Introducing Ghost 2.0 by dewey on Wednesday August 22, 2018 @02:37AM (#17816803)
The first place to look is the Ghost Docker repository and there’s already an open issue for it:

https://github.com/docker-library/ghost/issues/142

Re:Introducing Ghost 2.0 by cyberferret on Tuesday August 21, 2018 @08:14PM (#17815032)
Question: Has the (Electron) Ghost app been updated to work with Ghost 2.0 as well? i.e., am I going to break things if I update my server to Ghost 2.0 then try to publish new posts using the app?
Re:Introducing Ghost 2.0 by vikaspotluri123 on Tuesday August 21, 2018 @08:18PM (#17815061)
Ghost Desktop has been updated to support the Koeing Editor (see https://github.com/TryGhost/Ghost-Desktop/releases/tag/v1.7....) - Just make sure you're on 1.7.0 ;)
Re:Introducing Ghost 2.0 by rglover on Tuesday August 21, 2018 @09:54PM (#17815620)
Hell yeah, John. I've absolutely loved watching you and your team grow over the years. Congrats and best of luck moving forward :) New stuff looks excellent.
[dead]
Re:Introducing Ghost 2.0 by sciurus on Tuesday August 21, 2018 @02:28PM (#17812353)
You're complaining that you can't tell what this HN submission is about from the top-voted comment alone, and you actually have to read the submission?

I've seen people complain about the submission for a product announcement being unclear before, but hearing that complaint leveled at the comments is a new one.

Re:Introducing Ghost 2.0 by Vinnl on Tuesday August 21, 2018 @03:08PM (#17812738)
I think it's not so much a complaint, as a suggestion to include a short recap of what the project is in the introduction of release announcements. I don't think OP was so much annoyed, as much as that they considered that it's a smart thing marketing-wise: those who don't know what the project is are unlikely to read on to the third paragraph.

See e.g. Rust, which does this really well: https://blog.rust-lang.org/2018/08/02/Rust-1.28.html

Re:Introducing Ghost 2.0 by johnonolan on Tuesday August 21, 2018 @03:14PM (#17812783)
Fair point, I probably could've included some useful context there - thanks for the tip!
Re:Introducing Ghost 2.0 by Vinnl on Wednesday August 22, 2018 @03:21AM (#17816972)
Thank dethswatch, it was their tip (although it's flagged right now) - I just interpreted it by assuming good intentions :)
Re:Introducing Ghost 2.0 by FlipperBucket on Tuesday August 21, 2018 @07:51PM (#17814927)
> You're complaining that you can't tell what this HN submission is about from the top-voted comment alone

Nope. johnonolan's post is top and it explains about as much as the site. Not much at all. There's an animated thing going on a page break down from the top, but the site is so jam-packed with marketspeak and vagary that it shouldn't be surprising. Also, I still don't know what it is. Compare that with Codesandbox (also on HN) which is straightforward.

Re:Introducing Ghost 2.0 by ddebernardy on Tuesday August 21, 2018 @03:20PM (#17812825)
John used to be a noteworthy contributor to WordPress. He went on to create a node.js based WordPress like software a decade or so ago, back when node.js was new and all the rage.
Re:Introducing Ghost 2.0 by ricardobeat on Tuesday August 21, 2018 @08:54PM (#17815274)
About five years ago, 2013.
Re:Introducing Ghost 2.0 by just_observing on Tuesday August 21, 2018 @12:06PM (#17810831)
"Also: Let me be the first to say that I can’t believe there’s still no Postgres support, which is absolutely outrageous."

Postgres is open source.

Why do they owe you?

If it matters, write the code.

Re:Introducing Ghost 2.0 by Vinnl on Tuesday August 21, 2018 @02:49PM (#17812564)
It's a joke, the context of which is that they removed Postgres support from Ghost a while ago, and people keep complaining about it.

See: https://blog.ghost.org/dropping-support-for-postgresql/

Re:Introducing Ghost 2.0 by fusiongyro on Tuesday August 21, 2018 @06:12PM (#17814294)
I have to give him credit, I was here to complain about it.
Re:Introducing Ghost 2.0 by deburo on Tuesday August 21, 2018 @12:26PM (#17811019)
That's not how he meant it, because it makes no sense.

He meant that he still hasn't taken the time to get some people in his team to support Postgres officially, I guess.