MyBB 2.0?

MyBB 2.0 based on Yii?

Full post: http://blog.mybb.com/2011/06/07/developing-the-future/

Yes it is.

It is always nice to see new sites that are using Yii, especially if they are opensource!!

Wow - that’s really awesome! :lol:

I used myBB I think back in 2004. It’s so cool they are using Yii!

–iM

We’re finding it really easy to work with - and the results are looking good! None of the developers working on 2.0 have used Yii before and I’m sure they’ll agree it’s been the easiest framework to learn and create with.

We have a few concerns though. Trying to keep memory down to a minimum is hard - using even the most basic of models adds quite a bit of usage and Twig is just the same. It’s easy to say “enable APC” or another method but the majority of our users will simply be confused by that. We’ve already had to change the code design so it is as lightweight as possible.

:)

@Tomm: Thank you for choosing Yii to build MyBB 2.0. We feel very honored about this.

You mentioned you have a few concerns about Yii. Could you please elaborate them? We will see what we can do on our side.

Regarding the memory footprint, would it be possible for you to do some profiling to see where the bottleneck is?

If you are using AR, some extra memory is needed to store the schema information about the tables being used.

However, that won’t consume too much memory.

It’s very strange and I’m sure I’m just missing something stupidly simple. I haven’t spent that much time looking into it, but I can provide some examples.

I’m not sure if other viewRenderer extensions are similar, but Twig adds lots of memory. Even with it’s cache setting.

  • Memory Usage with Twig: 4.65mb

  • Memory Usage without Twig: 3.8mb

With a forum software, I don’t really want to give free reign on a templates system. We’ve had a really bad security vulnerability with them and I don’t want to repeat that - that’s why we’ve chosen to use Twig.

I added the most basic of models too and even that adds 0.25mb of memory for each one you add. That might not sound a lot but when you start adding 3 or 4 models to a page (especially for a forum software) that adds up. I’m sure the footprint will increase too.

It worries me because we haven’t even started the main forum software yet - we only have the bare bones of it in terms of users, settings, database, languages etc and it already tops our current version. MyBB 1.6, on average, uses 3.5mb of memory - and that’s with everything loaded.

I have no doubt Yii is the best choice - it’s simple, fast and extremely easy, even for people new to the MVC world. If there is something stupidly simple I’m missing, please point it out! :)

I did some profiling. On average, an AR object has about 600 byte overhead when compared with an array representing the same data. That means if you have 1000 AR objects during a request (most of the time, you need much less than this), there will be 600KB overhead.

Note, however, that in addition to the above overhead, there is also overhead per DB table when using AR because AR needs to know the table schema information. Assume each table schema uses 10KB data and you use 10 tables during a request, it means 100KB overhead.

I’m not sure what DB driver MyBB 1.6 is using. If it uses native mysql driver instead of PDO, you also need to count in the memory difference between the two drivers.

Anyway, in order to do proper profiling, you should try to lo create 100+ models to see where the limit is and see if it scales.

There is also another new forum based on Yii:

http://mybbdemo.co.cc/yiiforo/index.php?r=forum/index

It’s not really another new forum - it’s the mybb Yii demo. ;)

http://mybbhacks.zingaburga.com/showthread.php?tid=748&page=1

Not much to see yet:

http://mybbdemo.co.cc/index.php

It looks like many BB systems are switching from a custom class library to a 3rd-party framework.

MyBB -> Yii (?)

phpBB -> Symfony

FluxBB -> Laravel

They were quite close to switch to Yii, too ::)

Good news :)

Well, it’s still unsure if MyBB is going to use Yii.

A short digression about bulletin boards…

Until 5-6 years ago, websites had online communities that were built around forums… then we had the "blogs era"… then we had the "social networks era", the "wikis" era… actually, I find the concept of these bulletin board systems (category -> forum -> thread -> replies) to be pretty obsolete.

I’d argue that blogs aren’t that different from bulletin boards. Also keep in mind that blogs, wikis and social media pages all serve different purposes, they are not easily interchangeable.

I think that some concepts from bulletin boards, blogs, social newtorks, wikis etc. could be merged into a new generation product. I don’t mean a bb+blog+wiki bundle, I mean a new product which inherits their benefit into a new structure.

So that would be … a hierarchical CMS with social media integration?

I find hierarchical systems to be old-fashioned too… I’d prefer a tag-based system, something like Vanilla http://vanillaforums.org/discussions, but Vanilla is just a simple bulletin board… I can think at things like collaborative discussions (i.e. with a fork system to fork discussions just like you fork code on GitHub), a “discussions showcase” instead of a blog etc. etc.