Comparative Study of NoSQL Data Storage Solutions for a social Recent Activity Feed

Florian Dejonckheere
Persbericht

Grote gegevens en denderende data: hoe slaan websites hun data op?

De laatste jaren zijn grootschalige sociale mediaplatformen zoals Twitten en Facebook sterk opgekomen. Door het toenemende gebruik ervan is de digitale voetafdruk van de gemiddelde internetgebruiker ook massief gestegen. Deze websites hebben dan ook te maken met een zondvloed van gegevens die opgeslagen moeten worden, klaar om ze snel naar de gebruiker te sturen. Maar hoe worden die gegevens precies opgeslagen? We bekijken het voorbeeld van Open Webslides.

Open Webslides

Open Webslides is een online collaboratieplatform voor leerkrachten en leerlingen. Hierbij wordt er door beide partijen aan dezelfde cursus gesleuteld, zodat studenten deze beter kunnen leren en leerkrachten gemakkelijk feedback kunnen verwerken.
Het deel van Open Webslides waar we geïnteresseerd in zijn, is de feed van de recente activiteit. Deze feed ziet er een beetje uit zoals de feed op Facebook of Twitter. De meest recentste berichten staan bovenaan, de minder recentere berichten gaan eronder.
Natuurlijk gaat het hier niet over foto's en evenementen, maar wel over wie iets veranderd heeft op de cursus, en wat precies. Zo kan je in een oogopslag zien wanneer de leerkracht een hoofdstuk heeft toegevoegd, of dat een van je medestudenten een vraag heeft gesteld bij een onduidelijke zin.

recente activiteits-feed

Maar hoe slaan we deze gegevens precies op? Bij elk item hoort een cursus, een auteur en de actie die uitgevoerd werd. En natuurlijk ook het tijdstip van de actie, waarop we ook moeten sorteren vooraleer de lijst naar de gebruiker te sturen.

Databanken

Er kan gekozen worden uit de vele, al bestaande databanktoepassingen. Maar eerst moeten we kiezen welk type databank het best past: een relationele, een document- of een graafdatabank. Bij een relationele databank worden de gegevens opgeslaan in tabellen: elke tabel heeft kolommen, en elk item heeft een waarde voor deze kolommen. Dit is de traditionele manier van gegevens opslaan. Het laat ons toe om gemakkelijk te zoeken in alle gegevens, en deze te sorteren. Dat komt goed van pas als we alle items willen sorteren op tijdstip. Het combineren van gegevens in verschillende tabellen - bijvoorbeeld een tabel voor auteur, en een andere tabel voor cursussen - gaat zeer snel in een relationele databank.

Een document-databank daarentegen, slaat alle gegevens op als een document: een ondoorzichtig stuk data waar er niet in gezocht kan worden. Om dit te omzeilen, steken we alle gegevens die nodig zijn in eenzelfde document. In ons geval wil dit dus zeggen dat de auteur, cursus en acties in hetzelfde document zitten. Document-databanken zijn typisch zeer goed in het afhandelen van massieve datastromen. Dat kan in ons voordeel spelen als we een systeem overwegen met duizenden gebruikers.

Ten laatste kunnen we ook kiezen voor een graafdatabank. Een graaf is een verzameling van punten of objecten, en die verbonden zijn door lijnen. Het doorkruisen van lijnen van object tot object is een zeer snelle actie. Dat komt goed uit voor de gelinkte datastructuur van Open Webslides.

Aangezien relationele databanken niet de focus zijn van het onderzoek, moet er uiteindelijk gekozen worden tussen een document- en een graafdatabank. Hiervoor hebben we een schema opgesteld, dat in elke databank getest wordt. We doornamen ook een aantal realistische scenarios om deze databank te gebruiken. Aan de hand van deze twee elementen hebben we getest welke databank het beste ophoudt aan de (gesimuleerde) stress van duizenden gebruikers.
Het verdict: de graafdatabank is 10 tot maar liefst 40 keer trager dan de document-databank. Een duidelijke overwinning voor document-databanken dus!

Conclusie

Het is dus duidelijk voor het Open Webslides project: document-databanken bieden dus de meest efficiënte oplossing.

We hebben nu een kijkje genomen achter de schermen in de wereld van data-opslag op grote schaal. We zagen hoe bedrijven zoals Facebook en Twitter de massieve vloed aan data opslaan. Het verschil tussen de databanktoepassingen is nu ook duidelijk: relationele, document- en graafdatabanken.
Mensen staan zelden stil bij de technologie die achter social media websites zitten, en welke hordes de ontwikkelaar heeft moeten nemen om deze technologieën naar een groot publiek te brengen. Denk daar maar eens over na, bij de volgende gedachteloze scroll van je Facebook feed!

Bibliografie

Abadi, D. J. [Daniel J.], Madden, S. R., & Hachem, N. (2008). Column-stores vs. Row-
stores: How Different Are They Really? In Proceedings of the 2008 ACM SIGMOD
International Conference on Management of Data (pp. 967–980).
Abadi, D. J. [Daniel J], Boncz, P. A., & Harizopoulos, S. (2009). Column-oriented Database
Systems. Proceedings of the VLDB Endowment, 2(2), 1664–1665.
Abramova, V., Bernardino, J., & Furtado, P. (2014). Which NoSQL Database? A Perfor-
mance Overview. Open Journal of Databases, 1(2).
Anderson et al. (2011). CouchRest Model. Retrieved from https://github.com/couchrest/
couchrest_model
Apache Software Foundation. (2005a). Consistent Hashing. Retrieved from http://guide.
couchdb.org/draft/clustering.html#hashing
Apache Software Foundation. (2005b). CouchDB. Retrieved from https://couchdb.apache.
org/
Apache Software Foundation. (2005c). CouchDB. Retrieved from https://couchdb.apache.
org/
Apache Software Foundation. (2005d). Neo4j. Retrieved from https://hbase.apache.org/
Apache Software Foundation. (2017). Hive. Retrieved from https://hive.apache.org/
Atzeni, P., Bugiotti, F., Cabibbo, L., & Torlone, R. (2016). Data Modeling in the NoSQL
World. Computer Standards & Interfaces.
Barahmand, S. & Ghandeharizadeh. (2013). BG: A Benchmark to Evaluate Interactive
Social Networking Actions. University of Southern California.
Barahmand, S., Ghandeharizadeh, S., & Li, J. (2015). On Scalability of Two NoSQL Data
Stores for Processing Interactive Social Networking Actions. University of Southern
California.
Barrigas, H., Barrigas, D., Barata, M., Bernardino, J., & Furtado, P. (2015). Scalabil-
ity of Facebook Architecture. In New Contributions in Information Systems and
Technologies (pp. 763–772). Springer International Publishing.
Bernstein, P., Hadzilacos, V., & Goodman, N. (1987). Concurrency control and recovery in
database systems.
Brewer, E. (2000). Towards Robust Distributed Systems.
Bugiotti, F., Cabibbo, L., Atzeni, P., & Torlone, R. (2014). Database Design for NoSQL
Systems. In International Conference on Conceptual Modeling (pp. 223–231).
Buneman, P., Fernandez, M., & Suciu, D. (2000). UnQL: a query language and algebra for
semistructured data based on structural recursion. The VLDB Journal, 9(1), 76–110.
Cattell, R. (2010). Scalable SQL and NoSQL Data Stores. SIGMOD Rec. 39(4), 12–27.
Chelimsky et al. (2005). RSpec. Retrieved from http://rspec.info/
Co-created Courses through Open Source initiatives. (2018).
Codd, E. F. (1970). A Relational Model of Data for Large Shared Data Banks. Commun.
ACM, 13(6), 377–387.
Codd, E. F. (1985). Is Your DBMS Really Relational? Computerworld, 19(41), 1–2.
Cooper, B. F., Silberstein, A., Tam, E., Ramakrishnan, R., & Sears, R. (2010). Benchmark-
ing Cloud Serving Systems with YCSB. In Proceedings of the 1st ACM Symposium
on Cloud Computing (pp. 143–154). ACM.
Cottenier, S., Verstraete, A., Verborgh, R., Brysbaert, M., De Loof, E., & Janssens, C.
(2016). Aanvraag onderwijsinnovatieproject COCOON.
Couchbase, Inc. (2010). Couchbase. Retrieved from https://www.couchbase.com/
Couchbase, Inc. (2018). Couchbase and Apache CouchDB compared. Retrieved from
https://www.couchbase.com/couchbase-vs-couchdb/
Dayley, B. (2014). Node.js, MongoDB, and AngularJS web development. Addison-Wesley
Professional.
Dayne Hammes, H. M. & Mitchell, H. (2014). Comparison of NoSQL and SQL Databases
in the Cloud. Southern Association for Information Systems.
Dean, J. & Ghemawat, S. (2008). MapReduce: Simplified Data Processing on Large
Clusters. Commun. ACM.
Free Software Foundation. (1985). Free Software Foundation. Retrieved from https://www.
fsf.org/
Gartner, Inc. (2018a). 2018 Magic Quadrant for Operations Support Systems.
Gartner, Inc. (2018b). Magic Quadrant Methodology. Retrieved from https://www.gartner.
com/technology/research/methodologies/research_mq.jsp
Gilbert, S. & Lynch, N. (2002a). Brewer’s conjecture and the feasibility of consistent,
available, partition-tolerant web services. ACM SIGACT News, 33, 51–59.
Gilbert, S. & Lynch, N. (2002b). Brewer’s conjecture and the feasibility of consistent,
available, partition-tolerant web services. ACM SIGACT News, 33, 51–59.
Grolinger, K., Higashino, W. A., Tiwari, A., & Capretz, M. A. (2013). Data Management
in Cloud Environments: NoSQL and NewSQL Data Stores. Journal of Cloud Com-
puting: Advances, Systems and Applications, 2(1), 22. doi:10.1186/2192-113X-2-22
Härder, T. & Reuter, A. (1983). Principles of Transaction-oriented Database Recovery.
ACM Comput. Surv. 15(4), 287–317.
Hecht, R. & Jablonski, S. (2011). NoSQL Evaluation: A Use Case Oriented Survey. In
2011 International Conference on Cloud and Service Computing (pp. 336–341).
Inc., M. (2009). MongoDB. Retrieved from https://www.mongodb.com/
Kaur, K. & Rani, R. (2013). Modeling and Querying Data in NoSQL Databases. In 2013
IEEE International Conference on Big Data (pp. 1–7).
Kolomičenko, V., Svoboda, M., & Mlýnková, I. H. (2013). Experimental Comparison
of Graph Databases. In Proceedings of International Conference on Information
Integration and Web-based Applications & Services (pp. 115–124). ACM.
Leavitt, N. (2010). Will NoSQL Databases Live Up to Their Promise? IEEE.
Malda, R. & Bates, J. (1997). Slashdot. Retrieved from https://www.slashdot.org/
Maroo, T. (2013). Handling with Dynamic, Large Data Sets - NoSQL a Buzzword or
Savior? JECRC Foundation.
Microsoft Corporation. (2002). LinkedIn. Retrieved from https://www.linkedin.com/
Miller, J. J. (2013). Graph Database Applications and Concepts with Neo4j. In Proceedings
of the Southern Association for Information Systems Conference, Atlanta, GA, USA.
Mohamed, M. A. & Ismail, M. O. (2014). Relational vs. NoSQL Databases: A Survey.
International Journal of Computer and Information Technology, 3(3).
Mohan, C. (2013). History Repeats Itself: Sensible and NonsenSQL Aspects of the NoSQL
Hoopla. In Proceedings of the 16th International Conference on Extending Database
Technology.
MongoDB Inc. (2009a). MongoDB. Retrieved from https://www.mongodb.com/
MongoDB Inc. (2009b). MongoDB Sharding. Retrieved from https://docs.mongodb.com/
manual/sharding/
MongoDB Inc. (2009c). Mongoid. Retrieved from https://docs.mongodb.com/mongoid/
master/
Moniruzzaman, A. B. M. & Hossain, S. A. (2013). NoSQL Database: New Era of Databases
for Big data Analytics - Classification, Characteristics and Comparison. International
Journal of Database Theory and Application, 6(4).
Nayak, A., Poriya, A., & Poojary, D. (2013a). Type of NOSQL Databases and its Com-
parison with Relational Databases. International Journal of Applied Information
Systems, 5(4).
Nayak, A., Poriya, A., & Poojary, D. (2013b, March). Type of NoSQL Databases and its
Comparison with Relational Databases. International Journal of Applied Information
Systems (IJAIS), 5(4).
Neo Technology. (2007a). Neo4j. Retrieved from https://boltprotocol.org/
Neo Technology. (2007b). Neo4j. Retrieved from https://neo4j.com/
Open Webslides. (2017a, March). Open Webslides. Retrieved from http://openwebslides.
github.io/
Open Webslides. (2017b). Open Webslides. Retrieved from http://openwebslides.github.io/
OrientDB Ltd. (2010). OrientDB. Retrieved from https://orientdb.com/
Paivio, A. (1969). Mental Imagery in Associative Learning and Memory. Psychological
Review, 76, 241–263.
Rohloff, K., Dean, M., Emmons, I., Ryder, D., & Sumner, J. (2007). An evaluation of
triple-store technologies for large data stores. In OTM Confederated International
Conferences "On the Move to Meaningful Internet Systems".
RubyGems. (2003). RubyGems. Retrieved from https://rubygems.org/
Sadalage, P. J. & Fowler, M. (2012). NoSQL Distilled: A Brief Guide to the Emerging
World of Polyglot Persistence. Pearson Education.
Sanfilippo, S. (2009). Redis. Retrieved from https://redis.io/
Schmid, S., Galicz, E., & Reinhardt, W. (2015). Performance Investigation of Selected
SQL and NoSQL Databases. In AGILE 2015.
Singh, G. (1996). Leader Election in the Presence of Link Failures. IEEE Transactions on
Parallel and Distributed Systems, 7(3), 231–236.
Solid IT. (2018). DB-Engine Ranking. Retrieved from https://db-engines.com/en/ranking
Technology, N. (2007). Neo4j. Retrieved from https://neo4j.com
The NoSQL Archive. (2018, April). The NoSQL Archive. Retrieved from http://nosql-
database.org/
Underwood, B. (2010). Neo4j.rb. Retrieved from http://neo4jrb.io/
Upwork Global Inc. (2015). Upwork. Retrieved from https://www.upwork.com/
Weinberger, C. (2012). Is UNQL Dead? Retrieved from https://www.arangodb.com/2012/
04/is_unql_dead/
Weinberger, C. (2016). Index Free Adjacency or Hybrid Indexes for Graph Databases.
Retrieved from https://www.arangodb.com/2016/04/index-free-adjacency-hybrid-
indexes-graph-databases/
West, D. B. et al. (2001). Introduction to Graph Theory. Prentice hall Upper Saddle River.
Zhao, Y. (2015). Event Based Transient Notification Architecture and NoSQL Solution for
Astronomical Data Management (Doctoral dissertation, Massey University).
Zhou, L., He, K., Sheng, X., & Wang, B. (2013). A Survey of Data Management System
for Cloud Computing: Models and Searching Methods. Research Journal of Applied
Sciences, Engineering and Technology, 6(2), 244–248.

Universiteit of Hogeschool
Toegepaste Informatica
Publicatiejaar
2018
Promotor(en)
Chantal Teerlinck
Kernwoorden
Share this on: