What could be the best way of developing a C++ web application? The web app would be run on Apache HTTP server. How can you overcome challenges like sessions, persistence, context switching, multithreading etc with C++? How could one utilize C++ in best possible way to make it work like Servlets?
I'm saying this as a C++ developer...
I would probably consider using Java instead. Since Java is much more commonly used for this, you'll find way more existing libraries to leverage. If you ever want to hire more people, you'll have an easier time finding web-app Java developers than web-app C++ developers.
If you insist using C++, check out:
Use C++ web framework like CppCMS if you like web-like development, it is oriented for high performance and works with .
It provides:
- FastCGI, SCGI and CGI interfaces.
- Form processing and validation
- HTML Templates system
- Session management
- Cache system
- Transparent scale up to numerous servers.
You may give a try to Wt but it is much more like writing GUI using browser rather then traditional web development tool.
Take a look at Wt.
Wt (pronounced 'witty') is a C++ library and application server for developing and deploying web applications. It is not a 'framework', which enforces a way of programming, but a library.
The API is widget-centric, and inspired by existing C++ Graphical User Interface (GUI) APIs. To the developer, it offers complete abstraction of any web-specific implementation details, including event handling and graphics support.
It's not free for commercial use though.
You can use Qt framework, Boost & Poco libraries to do web development in C++. Qt & Poco have DB support for various RDBMS. You may look into Axis C++ if you need to develop web services in C++. ClearSilver has C library to handle CGI and you can use C++ on top of it. Plenty of choices for you!
How can you overcome challenges like sessions, persistence, context switching, multithreading etc with C++?
The answer is what you'd expect it to be: pick libraries that handle issues when possible (multithreading) and implement libraries where necessary (generating a session key and storing it somewhere like a database).
Take a look at the Snorkel Embedded Web Server SDK. Its easy to use and produces the fastest web application solutions. http://sites.google.com/site/snorkelembedded