Comparative Benchmarking of PostgreSQL and MongoDB for Nested Document Workloads under High Concurrency
DOI:
https://doi.org/10.29408/edumatic.v10i3.37210Keywords:
database performance benchmarking, high concurrency, nested documents, p99 latency, postgresqlAbstract
Tail latency under high concurrency is a critical concern for applications that store nested JSON documents, yet comparisons of PostgreSQL and MongoDB rarely examine concurrent load, updates, or the application layer. This study compares PostgreSQL 17 (JSONB) and MongoDB 8.0 (BSON) at the system level to pinpoint where latency arises as concurrency increases. A quantitative experiment stored 150,346 nested documents from the Yelp Open Dataset in identically resourced Docker containers behind a FastAPI service. Grafana k6 applied nested reads and a mixed read-update workload from 5 to 512 virtual users, with each run repeated three times. Both systems performed equally under light load, but beyond saturation, PostgreSQL achieved lower P99 latency (1,683 versus 3,022 ms at 512 virtual users) and higher throughput. PostgreSQL nearly exhausted its CPU allocation and spent most of its latency waiting for pooled connections, whereas MongoDB used little CPU, spent most of its latency inside the driver call, and produced rare requests far beyond P99, consistent with an application-layer bottleneck. Reading tail latency, throughput, and resource use together helps locate bottlenecks, and such results describe complete stacks rather than the JSONB and BSON formats alone.
References
Aleksendrić, M., Borucki, A., Domingues, L., Abu Hammad, M., Hannouch, E., Nair, R., & Palmer, R. (2024). Mastering MongoDB 7.0: Achieve data excellence by unlocking the full potential of MongoDB (4th ed.). Packt Publishing.
Aryanto, R. P., Nilogiri, A., & Wardoyo, A. E. (2023). Optimasi pengurutan data bilangan dengan menggabungkan algoritma selection sort hybrid dan bucket sort. Edumatic: Jurnal Pendidikan Informatika, 7(1), 39–48. https://doi.org/10.29408/edumatic.v7i1.12358
Belloni, S., Ritter, D., Schröder, M., & Rörup, N. (2022). DeepBench: Benchmarking JSON document stores. Proceedings of the 9th International Workshop on Testing Database Systems (DBTest '22), 1–9. https://doi.org/10.1145/3531348.3532176
Carvalho, I., Sá, F., & Bernardino, J. (2023). Performance evaluation of NoSQL document databases: Couchbase, CouchDB, and MongoDB. Algorithms, 16(2), 78. https://doi.org/10.3390/a16020078
Dean, J., & Barroso, L. A. (2013). The tail at scale. Communications of the ACM, 56(2), 74–80. https://doi.org/10.1145/2408776.2408794
Fawwazie, M. H. H., Daud, N., Rabani, M. I., & Supriyanto, B. F. (2026). Hybrid human AI SDLC for rapid SaaS development: Evidence from a 60 days case study. Edumatic: Jurnal Pendidikan Informatika, 10(1), 290–299. https://doi.org/10.29408/edumatic.v10i1.34361
Hewasinghage, M., Nadal, S., & Abelló, A. (2020). On the performance impact of using JSON, beyond impedance mismatch. European Conference on Advances in Databases and Information Systems (pp. 73-83). Cham: Springer International Publishing. https://doi.org/10.1007/978-3-030-54623-6_7
Khan, W., Kumar, T., Zhang, C., Raj, K., Roy, A. M., & Luo, B. (2023). SQL and NoSQL database software architecture performance analysis and assessments—A systematic literature review. Big Data and Cognitive Computing, 7(2), 97. https://doi.org/10.3390/bdcc7020097
Kleppmann, M., & Riccomini, C. (2026). Designing data-intensive applications: The big ideas behind reliable, scalable, and maintainable systems (2nd ed.). O'Reilly Media.
Little, J. D. C. (1961). A proof for the queuing formula: L = λW. Operations Research, 9(3), 383–387. https://doi.org/10.1287/opre.9.3.383
Makris, A., Tserpes, K., Spiliopoulos, G., Zissis, D., & Anagnostopoulos, D. (2021). MongoDB vs PostgreSQL: A comparative study on performance aspects. GeoInformatica, 25(2), 243–268. https://doi.org/10.1007/s10707-020-00407-w
Olszak, J., & Skublewska-Paszkowska, M. (2025). The impact of relational and non-relational databases on application performance. Journal of Computer Sciences Institute, 35, 184–190. https://doi.org/10.35784/jcsi.7260
Pantelic, N., Matic, L., Jakovljevic, L., Eric, S., Eric, M., Stefanović, M., & Djordjevic, A. (2026). Benchmarking SQL and NoSQL persistence in microservices under variable workloads. Future Internet, 18(1), Article 53. https://doi.org/10.3390/fi18010053
Rogov, E. (2023). PostgreSQL 14 internals. Postgres Professional.
Schroeder, B., Wierman, A., & Harchol-Balter, M. (2006). Open versus closed: A cautionary tale. Proceedings of the 3rd Symposium on Networked Systems Design and Implementation (NSDI '06) (pp. 239–252). USENIX Association.
Taipalus, T. (2024). Database management system performance comparisons: A systematic literature review. Journal of Systems and Software, 208, Article 111872. https://doi.org/10.1016/j.jss.2023.111872
Tracz, P. M., & Plechawska-Wójcik, M. (2024). Comparative analysis of the performance of selected database management system. Journal of Computer Sciences Institute, 31, 89–96. https://doi.org/10.35784/jcsi.5927
Urnikienė, J., Steponavičienė, V., & Atanasov, S. (2026). Comparative read performance analysis of PostgreSQL and MongoDB in e-commerce: An empirical study of filtering and analytical queries. Big Data and Cognitive Computing, 10(2), 66. https://doi.org/10.3390/bdcc10020066
Yanto, R., Irfan, D., & Huda, A. (2022). Analisis quality of service jaringan wireless untuk teknologi streaming. Edumatic: Jurnal Pendidikan Informatika, 6(2), 167–175. https://doi.org/10.29408/edumatic.v6i2.5840
Yumarlin, M. Z., Bororing, J. E., Rahayu, S., & Ramadhani, T. A. (2022). Aplikasi dashboard visualisasi data calon mahasiswa baru menggunakan Metabase. Edumatic: Jurnal Pendidikan Informatika, 6(1), 116–125. https://doi.org/10.29408/edumatic.v6i1.5483
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Darren Pandiangan, Laura Mahendratta Tjahjono

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
All articles in this journal are the sole responsibility of the authors. Edumatic: Jurnal Pendidikan Informatika can be accessed free of charge, in accordance with the Creative Commons license used.

This work is licensed under a Lisensi a Creative Commons Attribution-ShareAlike 4.0 International License.


