The most familiar database solution is to set up a Structured Query Language (SQL) database, e.g., MySQL. In this example, I will be using a NoSQL, i.e., not SQL, database because it will be quick and easy. In particular, I will be using Firebase.
What is Firebase?
Firebase provides a realtime database and backend as a service. The service provides application developers an API that allows application data to be synchronized across clients and stored on Firebase's cloud.
Firebase - Wikipedia, the free encyclopedia
A particularly important feature of Firebase is that not only will it provide the database but it will also provide the server APIs too.
Getting Started with Firebase
- Create a free Firebase <http://www.firebase.com> account and follow the 5 minute tutorial.
- Read how to structure data in Firebase <https://www.firebase.com/docs/web/guide/structuring-data.html>. This article is particular important as it is not obvious how to create relationships (e.g., wineries and wines) in a NoSQL database.
Setup Database and Populate It
- Create a new empty Firebase app.
- Populate the Firebase app with sample data as shown below. By the way, the trick to creating a nested tree structure using the Firebase "data" screen is to change the browser's URL and load the page, e.g., to create a winery with the key "key1" use the URL: <https://YOURAPPNAME.firebaseio.com/wineries/key1>.
No comments:
Post a Comment