{"id":234,"date":"2018-04-09T16:16:46","date_gmt":"2018-04-09T15:16:46","guid":{"rendered":"http:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/?p=234"},"modified":"2018-04-09T16:18:08","modified_gmt":"2018-04-09T15:18:08","slug":"database-option-and-design","status":"publish","type":"post","link":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/2018\/04\/09\/database-option-and-design\/","title":{"rendered":"Database Option and Design"},"content":{"rendered":"<h4><\/h4>\n<h4>Firebase Database Design<\/h4>\n<p>&nbsp;<\/p>\n<p><em>Click the image to zoom<\/em><\/p>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1j6zY5RUrDebjqD1MuN0456Blh2phF7-0\/view?usp=sharing\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-240\" src=\"http:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-content\/uploads\/sites\/266\/2018\/04\/Untitled-Diagram-1.jpg\" alt=\"\" width=\"1857\" height=\"2355\" srcset=\"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-content\/uploads\/sites\/266\/2018\/04\/Untitled-Diagram-1.jpg 1857w, https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-content\/uploads\/sites\/266\/2018\/04\/Untitled-Diagram-1-237x300.jpg 237w, https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-content\/uploads\/sites\/266\/2018\/04\/Untitled-Diagram-1-768x974.jpg 768w, https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-content\/uploads\/sites\/266\/2018\/04\/Untitled-Diagram-1-1596x2024.jpg 1596w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<h4><\/h4>\n<p><i><span style=\"font-weight: 400\">*Notes:<\/span><\/i><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Timestamps are saved in milliseconds.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">All the ids are strings because they are unique combinations of alphanumeric characters generated by Firebase automatically when a new object is being created<\/span><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h4><strong>Database Option<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Based on the features, requirements, and size of the web application, we first decided what type of database was suitable for us. As the app did not need to establish many relationships between entities or to perform complex queries, we considered using a non-relational database.And since we wanted to add real-time synchronization and communication via the application, a notification system, we decided that using Firebase was the best option for us. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Since it was non-relational, document-type, some data was duplicated in these collections for a better accessibility.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> \u00a0Firebase is a cloud-hosted JSON database. It can synchronize data between the different clients immediately. Its schema-less structure and that Firebase Real-time Database can be characterized as a big JSON object that managed in real time allows flexible data modeling. Even if the user goes offline or lost his network connection, Firebase keeps an internal cache of the data and the app keeps working on that cache. <\/span><\/p>\n<p><span style=\"font-weight: 400\">One of the greatest features in Firebase is the series of powerful tools that simplify authentication system (email &amp; password authentication or third-party providers auth), files storing, real-time synchronization and notification system.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> But Firebase is not only a real-time cloud database. It offers a range of other services. We used Firebase Storage to store the files: product images, user profile images. The firebase storage is synchronized with Google Cloud Platform Storage. We, also, used the Firebase Authentication service for email and password based authentication. Because Firebase comes with cloud messaging and notification system, we made use of that when implementing notifications for the new activity of the followed supervisors and for the new messages in the conversations they are engaged into.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Even though it is a non-relational database and this might make the search operations more difficult, Firebase allows indexing and for more complex search operations, we will be using Elasticsearch. <\/span><span style=\"font-weight: 400\">Elasticsearch is a search engine based on Lucene a<\/span><span style=\"font-weight: 400\">nd it can be easily integrated with a Firebase-based app.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><i><span style=\"font-weight: 400\">Author: Emanuela Colta<\/span><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firebase Database Design &nbsp; Click the image to zoom *Notes: Timestamps are saved in milliseconds. All the ids are strings because they are unique combinations of alphanumeric characters generated by Firebase automatically when a new object is being created<\/p>\n","protected":false},"author":2964,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[23,21,22],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-tech-demo","tag-architecture","tag-database-design","tag-design"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/users\/2964"}],"replies":[{"embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/comments?post=234"}],"version-history":[{"count":16,"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/posts\/234\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/media?parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/categories?post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/meetingofminds\/wp-json\/wp\/v2\/tags?post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}