7 ms·
Drogon – C++14/17-based rapid HTTP and web application framework
- hu3 6y agoI knew that name was familiar. Drogon scores nicely in Techempower's benchmarks: https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext https://www.techempower.com/benchmarks/#section=data-r19&hw=...
- sorokod 6y agoUp to number one in composite score from number nine in the previous round.
- dragonsh 6y agoYes indeed it is one of the top performers. But I feel need more real-life examples of companies and systems using it. Hope it generates some interest among programming community to also look at modern C++ as viable web development platform.
- saberience 6y agoThe problem isn't performance, the problem is developer productivity. C++ isn't known for building things quickly. Why would anyone use this over DotNet Core, which is also highly performance but significantly easier to understand. Also building anything in a complex language like C++ means more bugs and errors.
- CyberDildonics 6y agoI don't find this to be true at all with modern C++. Doing the same things ends being more straightforward in my experience. Setting up compilation is often more painful and sooner or later I run into some snags with const and map iteration, though those don't end up being long term time sinks.
- hellofunk 6y agoDoesn’t make any sense at all to go with dot net if the rest of your app is in C++ and something easy like this exists.
- otabdeveloper4 6y ago> C++ isn't known for building things quickly. What language is? If only sticking to deadlines was as easy as changing your programming language! Alas.
- zinclozenge 6y agoDoes anybody know why it does so well on the multiple updates test?
- dragonsh 6y agoTake a look at features on the page: 1. Support non-blocking I/O based asynchronously reading and writing database (PostgreSQL and MySQL(MariaDB) database); 2. Support asynchronously reading and writing sqlite3 database based on thread pool;
- zinclozenge 6y agoSure but actix does the same via tokio-Postgres and is beaten by almost 2x.
- dragonsh 6y agoNot sure of the exact reason may be because it is directly using the postgresql C client library. Check the implementation of DB client: https://github.com/an-tao/drogon/blob/master/orm_lib/src/DbClientImpl.cc https://github.com/an-tao/drogon/blob/master/orm_lib/src/DbC...
- cheez 6y agoAlways glad to see another contender! The documentation is very thorough and gives a good overview. Every library should be like this. That being said, I have written a lot of HTTP servers and clients in C++ so I have some opinions on the design of this library. Modern C++ really tries to avoid preprocessor macros for the reason that it's really hard to know what is going on. Macros can do anything. So I would suggest you get rid of the code generation including dragon_ctl. Write a library that doesn't need code generation. C++17 has all the tools needed to do this.
- billconan 6y agoI have a question. I have also implemented my C++ web framework. I found it is difficult to conform to http spec. There doesn't seem to be a Conformance test? How do people do it?
- cheez 6y agoIf you're writing one for general consumption, I wish you luck.
- smartmic 6y agoSome more contenders: https://github.com/guteksan/REST-CPP-benchmark https://github.com/guteksan/REST-CPP-benchmark Personally, I use cpp-httplib to set up a web service for some old but highly relevant Fortran libraries. I am quite happy with this framework but it is always good to get to know other players in this league.
- scott_s 6y agoedit: I am wrong, see comment below. Since this project was submitted by project creator, it deserves "Show HN" status (https://news.ycombinator.com/showhn.html https://news.ycombinator.com/showhn.html).
- dragonsh 6y agoI am not the creator, just stumbled on it looking for examples in modern C++, was especially looking for C++ 20. Found it interesting and try to share on HN.
- brighton36 6y agoI'm not sure if this is interesting to anyone. But, I wanted something a bit more lightweight, so, I'm writing my own kinda/sorta Drogon thing. It's using git and cmake to (hopefully) serve as a better library management system. Here's the 'app' I'm devoloping: https://github.com/brighton36/vuecrudd https://github.com/brighton36/vuecrudd and here's the project itself: https://github.com/brighton36/prails https://github.com/brighton36/prails
- rankam 6y agoWhat is the use case for a C++ web framework? Would higher level languages/frameworks make use of this to do some of the heavy lifting? Would a company migrate to something like this once at scale? Or, are there just some people/companies who prefer to use C++?
- 0xffff2 6y agoI currently have an architecture where I have a whole bunch of C++ code doing computational stuff. Later (years after writing the core computational library in C++) I was asked to expose the library via a REST API. At the time I was pretty young (didn't and still don't have the necessary experience to write a web framework myself) and none of the existing C++ web frameworks seemed to work very well. So, I now have a complex architecture with a Java Spring front end that communicates to a C++ backend. Would have been a whole lot simpler all around if I could have easily used C++ for the whole thing.
- mywittyname 6y agoWriting wrappers to interface c++ libraries with most common scripting languages is (usually) pretty easy. Probably much more so than trying to roll an entire HTTP server in C++.
- 0xffff2 6y agoIf you have to roll your own, of course it is, hence why I didn't try... but if there was a mature, easy to integrate HTTP server library I would prefer to keep everything in C++ (or better yet rewrite it all in Rust, but that's a whole other can of worms).
- Q6T46nT668w6i3m 6y agoprovide a web api for existing C++ applications and libraries
- echelon 6y agoThis is going to become more and more common for media intensive applications. https://vo.codes https://vo.codes uses a Rust HTTP web framework. It's not C++, but it's the exact same use case. High performance compute. It's not unheard of for ordinary CRUD websites, either. IIRC, the first version of OkCupid was written in C++.
- _wldu 6y agoSince you are shooting for modern C++, why not use Botan rather than OpenSSL? https://botan.randombit.net/ https://botan.randombit.net/
- jason0597 6y agoI was looking for a C++ HTTP framework a couple of months ago for a hobby project of mine. However, the whole debacle with WinGet and AppGet really left a very horrible taste in my mouth, that I did not want anything to do with a framework built by Microsoft. So I opted for Boost::Beast
- DrBazza 6y agoUnless I missed something, it says it can auto generate code, but I don't see anything regarding Swagger/OpenAPI
- hermanradtke 6y agoI think it means code generation using drogon_ctl.
- rolodato 6y agoDrogon is similar to "drogón" in Spanish, which means "junkie" or someone who takes a lot of drugs.
- aaomidi 6y agoI guess if we're doing random tidbits. And "junkie" is a very harmful term to use and implies a moral failing of the drug user.
- sardar0 6y agoDeveloping a trust accounting application for law firms in Drogon. It's an excellent framework written in Modern C++. Very easy to work with. Check out the Source code on git, it is beautifully written. If you are proficient in Modern C++, then this is the framework to use for speedy development. Just as an aside, I migrated the project from Go to C++.
- continuations 6y ago> I migrated the project from Go to C++ Any particular reasons why?