Cutelyst v4 – 10 years ðŸŽ‰

Cutelyst the Qt web framework is now at v4.0.0 just a bit later for it’s 10th anniversary.

With 2.5k commits it has been steadly improving, and in production for many high traffic applications. With this release we say good bye to our old Qt5 friend, also dropped uWSGI support, clearsilver and Grantlee were also removed, many methods now take a QStringView and Cutelyst::Header class was heavly refactored to allow usage of QByteArrayView, and stopped storing QStrings internally in a QHash, they are QByteArray inside a vector.

Before, all headers were uppercased and dashes replaced with underscores, this was quite some work, so that when searching the string had to be converted to this format to be searcheable, this had the advantage of allowing the use of QHash and in templates you could c.request.header.CONTENT_TYPE. Turns out both cases aren’t so important, speed is more important for the wider use cases.

With these changes Cutelyst managed to get 10 – 15% faster on TechEmpower benchmarks, which is great as we are still well positioned as a full stack framework there.

https://github.com/cutelyst/cutelyst/releases/tag/v4.0.0

Have fun, Merry Christmas and Happy New Year!

Cutelyst v4 – 10 years ðŸŽ‰

Cutelyst v3.5 relicensed as BSD-3-Clause

Cutelyst the Qt Web framework just got a new license, the more permissive BSD-3-Clause. Back in 2013 when I started the project the LGPL was a perfectly fine license as software on servers can be closed as long they are not AGPL, thus it was permissive enough for the web and REST backends use-cases I had in mind.

Fast-forward almost 10 years and I have used for a few of projects where it was embedded into another application, and I realized that there might be users with commercial Qt license that would like to use it but can’t due the current license.

Hesitate no more! It’s amazing how much nicer it is to implement client-server applications using HTTP/REST APIs all with Qt/C++, and when real time is needed WebSockets is also there to the rescue.

Since Ubuntu 22.04 has Qt 5.15 and 6.2 releases, for the next releases 5.15.2 will be the new minimum as I want to increase the QStringView usage eventually doing a major version update.

*UPDATE: This release includes a QtWidgets example application showing how to use Cutelyst::Server embedded into a GUI application.

https://github.com/cutelyst/cutelyst/releases/tag/v3.5.0

Cutelyst v3.5 relicensed as BSD-3-Clause

Cutelyst 3.2 and ASql 0.50 are out!

Cutelyst the Qt Web Framework got a new release, Yes, I fotgot to make a post about Cutelyst 3.1, so to sum up:

  • Support for SSl::Ec
  • Faster parsing of application/x-www-form-urlencoded body
  • Cutelee v6 support
  • Fix server usage without –reuse-port (added SO_REUSEADDR)
  • Documentation fixes
  • Increased usage of std::shared_ptr

ASql the async Qt SQL library also got an update, it’s API is rather stable now, main changes were:

  • Fix memory leak on ACache
  • Proper std::shared_ptr usage
  • Postgres driver is now a separate library ASql::Pg
  • Paved the way to have multiple drivers (yes MySQL is planned)

As always have fun and a happy new year!

Cutelyst 3.2 and ASql 0.50 are out!

Cutelee 6 released

Cutelee is templating engine forked from Grantlee. This major release was created to support both Qt5 and Qt6, it was not an easy port due Qt6 changes to QVariant, we got some patches for this port, and I finished the remaining issues.

It differs from Grantlee in which it already has support for more Django template tags, a few performance optimizations, and most importantly to me is the ability to extend without the hassled of creating a plugin and have it installed in some magical place. You can just register it with the engine and be done with it.

Enjoy https://github.com/cutelyst/cutelee/releases/tag/v6.0.0

Cutelee 6 released

Cutelyst 3 is out!

Cutelyst, the C++/Qt web framework just got a new major release.

Under the hood it now has both Qt5 and Qt6 support, but because of this a few things had to be changed, the most important one was QMap usage as a multi-key container had to be changed to QMultiMap, if you used ParamsMultiMap types or auto when assigning there’s probably little to do, one major exception is that if you still use Grantlee it might not work well, but Cutelee is there with fixes and is almost ported to Qt6.

Another API changes were on the authentication classes that have some friendly methods for QString passwords, WSGI module is now called Cutelyst::Server, it allows you to embed Cutelyst on other applications or have it as a stand alone executable, allowing for better LTO as you can get all stuff compiled as static libraries.

For the future I’m leaning towards increasing minimum version to Qt 5.12 (sadly means LGPLv2 for Qt5.6 will be gone) to start using QStringView where possible.

https://github.com/cutelyst/cutelyst/releases/tag/v3.0.0

Cutelyst 3 is out!

Simple-Mail Qt library 2.3 released

SimpleMail is a small Qt library for sending mails, this release makes sure it compiles fine with Qt6, and has some small issues fixed.

I thought this would give me a bit of work but was mostly changing CMakeLists.txt and including one header.

This week I’ll start working for KDAB 🙂 and my first task will be porting one app to Qt6, so I decided to do a little of homework and port my own stuff first as you might have noticed (Cutelyst and ASql).

https://github.com/cutelyst/simple-mail/releases/tag/v2.3.0

Simple-Mail Qt library 2.3 released

Cutelyst 2.14.2 and ASql 0.27 released!

Cutelyst a Qt Web Framework and ASql an asyncronous SQL library for Qt got new releases.

The Cutelyst version 2.14.0 was made in December but was a silent one, I had some issues in production but weren’t related to Cutelyst, the .1 release included some contributions by Adriaan de Groot, I also did some changes for Qt 5.15 and Qt6 but for Qt6 a new major version is needed.

Besides a bunch of fixes, a major regression on the plaintext benchmarks got fixed, unfourtunately not in time for round 20, but thanks to ASql you will Cutelyst got a better scoring on SQL related benchmarks

ASql also got a bunch of bug fixes, but most importantly it’s now Qt6 ready.

And speaking of Qt6 Cutelyst port is also completed now, after I port most of my own apps I’ll do a v3 release which is compatible with both Qt5 and 6.

Have fun!

https://github.com/cutelyst/asql/releases/tag/v0.27.0

https://github.com/cutelyst/cutelyst/releases/tag/v2.14.2

Cutelyst 2.14.2 and ASql 0.27 released!

Cutelyst 2.13 and ASql 0.19 released

Cutelyst the C++/Qt Web Framework and ASql the ASync SQL library for Qt applications got new versions.

Thanks to the work on ASql Cutelyst got some significant performance improvements on async requests, as well as a new class called ASync, which automatically detaches the current request from the processing chain, and attaches later on when it goes out of scope.

With the ASync class you capture it on your ASql lambda and once the query result arrives and the lambda is freed and the ASync object gets out of scope and continues the processing action chain.

KDAB’s fix on a 10 year old bug raised my attention back to a note on QTcpSocket documentation:

Note: TCP sockets cannot be opened in QIODevice::Unbuffered mode.

Which is actually wrong, according to the source code, Cutelyst has been using buffered mode since always due that, so hopefully this new version will be a bit faster and consume less memory, it’s important to notice that once the Kernel tells it’s going to block QTcpSocket writes get buffered anyway.

Now talking about ASql you might notice the jump on release versions, this is because I’ve been experimenting some changes and didn’t want to write a post at each new feature.

ASql is now at the closest API I’d like it to be, unfortunately one of my goals that would be to be able to handle it’s AResult object to Grantlee/Cutelee and be able to iterate over it’s records just once, but the call QVariant::canConvert with QVariantList must succeed and the class be able to be casted to QAssociativeIterable or QSequentialIterable, which I didn’t managed to get it working in a way I like.

But AResult has hash() and hashes() methods that convert the data to a format that can be used in templating.

On the plus side I added iterators (if you have experience with iterators please review my code as this was the first time I wrote this kind of code) that also work on for ranged loops, and they also have faster type conversion methods, instead converting the data to a QVariant type, and them using QVariant to get the data out of it, one can just call toInt() which will get the int straight from the result set without checking each time if it’s an int.

Added AMigrations which is an awesome database maintenance class that is both simple and helpful to maintain database schemas.

  • ACache class to cache special queries
  • Support for data inside QJsonValue
  • Single Row mode (the lambda get’s called once per result)
  • Prepared Queries
  • Scoped Transaction class
  • Notifications – this is my favorite PostgreSQL feature, it’s hard to image some other big databases lack such an useful feature.

Oh, and Cutelyst results on TechEmpower already got better thanks to ASql, hoping to see even better results when I update the tests to 2.13 that has Unbuffered and faster async handlying.

https://github.com/cutelyst/asql/releases/tag/v0.19.0

https://github.com/cutelyst/cutelyst/releases/tag/v2.13.0

Cutelyst 2.13 and ASql 0.19 released

Cutelyst 2.12 released

Cutelyst a Qt web framework got a new version, this version has one important fix for async apps using FastCGI or HTTP2, also fixes for SO_REUSEPORT, and as a new feature is has support for listen queue backlog on UNIX, sadly QTcpServer doesn’t support both of these (I need to find time to write some patches…).

Cutelyst is available for many Linux distributions but doesn’t for Debian/Kubuntu, so I’m also adding the CPack deb built will all but uWSGI support for 20.04 amd64.

Have fun https://github.com/cutelyst/cutelyst/releases/tag/v2.12.0

Cutelyst 2.12 released

Announcing ASql – async Sql for Qt

When developing Qt applications be it Desktop, Mobile or Web that need to talk directly with a database the use of QtSql is usually the best choice, it has many database drivers, comes ready on their installer, but has a blocking API, which means a query will block you GUI thread.

My Cutelyst Web projects also used QtSql, and for low traffic this isn’t a big issue because you are not freezing users GUI, but you are freezing the request queue instead.

One of the Cutelyst apps I developed this year has a very high traffic, and a side effect of blocking came in play, I’ve about 3k TVs connected via websockets, once a TV connects it does an authentication query, it takes ~17ms, now when there is an event PostgreSQL notifies the application which does some 20 other queries a little more expensive (~30ms) and send them to the TVs, this event also blocks the Cutelyst process.

Every TV does a websocket ping each 15 seconds to check if the connection is stalled, when that event happens plus some latency added 15s timeout and the TV disconnect, this of course happens with lots of TVs, so 1k TVs reconnecting will take around 17 seconds, this means new TVs disconnecting and the snow ball is done, system only recovers if I increase the DB hardware on AWS.

How can async fix this, you might be wondering, well the problem is that the 15s timeout happened to do a DOS on my own system, I can increase the value but when there are 10k TVs this will still be a problem, there are of course other ways to deal with this, but if the SQL query doesn’t block the Cutelyst process it will be able to timely reply the Websocket’s pongs.

ASql only supports PostgreSQL at time (PR are welcome), and depends on QtCore and libpq (PostgreSQL library), it can be used on Desktop apps and is 100% async from connection to queries, there’s even a class to help with DB versioning and migration.

Check it out: https://github.com/cutelyst/asql

Announcing ASql – async Sql for Qt