C++ and Databases: A Practical Guide
C++ and Databases: A Practical Guide
Summary:
The book "C++ and Databases: A Practical Guide" is a comprehensive resource for developers who want to master integrating C++ with relational and NoSQL databases. The author, Alexey Voronov, a senior developer with 12 years of experience, has compiled everything you need in one book: from basic SQL queries to building fault-tolerant clusters.
Who is this book for?
- Junior and Middle C++ developers who want to add database work to their portfolio
- Backend engineers transitioning from other languages to C++
- Technical students studying industrial programming
- System architects seeking efficient data storage solutions
What will you learn from the book?
- SQL Basics in C++: preparing queries, working with prepared statements, error handling
- Working with popular DBMS: SQLite (embedded database), MySQL (via the official Connector/C++), PostgreSQL (libpq and libpqxx), MongoDB (MongoDB C++ Driver)
- Advanced techniques: connection pools, transactions with savepoints, BLOB data, working with JSON fields
- Performance: optimizing bulk inserts, indexing, query profiling, result caching
- Security: protection against SQL injection, application-level data encryption, secure password storage
- Modern approaches: implementing a simple ORM in C++17, asynchronous database work via Boost.Asio, integration with Redis and ClickHouse
Edition features
- Over 50 ready-made code examples with comments
- Comparative performance analysis of different DBMS under C++
- Ready-made CMake scripts for building projects
- Analysis of real-world cases: from log parsing to a billing system
- Appendix with a checklist for choosing a DBMS for a specific task
The book is structured on the principle "from simple to complex": starting with library connections and ending with designing distributed systems. Each chapter contains practical assignments to reinforce the material. All examples have been tested on GCC 12, Clang 16, and MSVC 2022 on Windows, Linux, and macOS.
After reading, you will be able to confidently design data schemas, write efficient queries, choose the appropriate DBMS, and optimize C++ interaction with databases in a production environment. The book will become a desktop reference for any developer working with C++ and data.
Recommended level: basic knowledge of C++ (pointers, classes, STL) and a general understanding of SQL.