You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: getting-started-with-firebase-2019-edition/getting-started-with-firebase-2019-edition.md
+25-21
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,18 @@
1
-
# Getting Started with Firebase, 2019 Edition
1
+
# Firebase: 2019's Dominant Web App Platform
2
2
3
3
## tldr;
4
4
5
+
Google has invested heavily to make Firebase a full-featured application platform for web. It's dirt cheap to use. It's reliable. It saves up to 50% of your dev time.
6
+
7
+
Firebase is all you need... with a few exceptions. Firebase is still missing search functionality, but we can plug that hole with Algolia. Google Cloud Platform provides a few more ancillary services such as DNS, Cloud SQL for reporting data and Bigtable for graph data.
8
+
5
9
## A Quick History
6
10
7
11
Firebase was [birthed from a Y Combinator company](https://hackernoon.com/how-to-build-a-product-loved-by-millions-and-get-acquired-by-google-the-firebase-story-82dab4e3e80c) that was acquired by Google in 2014.
8
12
9
13
Firebase is a classic [disruptive company](http://claytonchristensen.com/key-concepts/). It started as a quick prototyping tool for developers who wanted to move quickly but didn't necessarily need much scale or sophistication.
10
14
11
-
They've spent the last eight years building capabilities from that original base of passionate freelancers and indie devs, and as a cornerstone of Google Cloud Platform's strategy, Firebase is poised to enter the larger corporate market.
15
+
They've spent the last eight years building capabilities from that original base of passionate freelancers and indie devs, and as a cornerstone of Google Cloud Platform's strategy, Firebase is fighting its way into the larger corporate market.
12
16
13
17
## What is Firebase?
14
18
@@ -50,15 +54,15 @@ Firebase and other NoSQL datastores optimize for reads, which are much more comm
50
54
51
55
## Firebase crushes other databases (for many use cases)
52
56
53
-
Let's say that I have new user sign up for a multi-player RPG. I want to show that user's email address on their profile, next to any messages that they chat to other users, and finally I'll need a list of all user emails for my admin dashboard.
57
+
Let's say that I have new user sign up for a multi-player RPG. I want to show that user's email address on their profile, next to any messages that they send to other users. Finally, I'll need a list of all user emails for my admin dashboard.
54
58
55
-
Firebase asks you to write that email address in three different places. "But Chris!" you ask. What if I need to change the email address??? Isn't that inefficient???
59
+
Firebase asks you to write that email address in three different places, one for each type of read operation. "But Chris!" you ask. What if I need to change the email address??? Isn't that inefficient???
56
60
57
61
Yep. It's inefficient. You'll have to update that email address in three places, and you'll have to be careful to track everywhere that you saved it.
58
62
59
-
But how often do you actually need to write an email address? What about the reads???
63
+
But how often do you actually need to **write** an email address? What about the reads???
60
64
61
-
The reality, and the reason that Firebase works so well, is that most apps read data **significantly more** than they write it.
65
+
The reality, and the reason that Firebase works so well, is that most apps **read data significantly more** than they write it.
62
66
63
67
So get over your SQL-induced anxiety and duplicate data throughout your Firebase data structure. Your database reads will dramatically outperform SQL reads at scale.
64
68
@@ -81,7 +85,7 @@ The [Iron Triangle of Project Management](https://en.wikipedia.org/wiki/Project_
81
85
82
86
Firebase is the lowest-cost and fastest development experience of which I'm aware.
83
87
84
-
I bootstrap projects on a regular basis. Most of my projects are solo projects. I'm the developer, designer and marketer. I'm incredibly time-constrained, so I use Firebase to enable me to achieve greater scope.
88
+
I bootstrap projects on a regular basis. Most of my projects are solo projects. I'm the developer, designer and marketer. I'm incredibly time-constrained, so I use Firebase to enable me to achieve greater scope while keeping my time costs low.
85
89
86
90
I've built the following projects entirely on my own with Firebase:
87
91
@@ -94,7 +98,7 @@ Calligraphy.org powers my wife's business. It took me four months to write it in
94
98
95
99
The other projects took between 75 and 200 hours each. Again, I finished them in my spare time while relying heavily on Firebase.
96
100
97
-
Firebase has spoiled me. I haven't spun up a new production server in two years. And these aren't just rapid prototypes. They're fully-functional, scalable and used by thousands of customers.
101
+
Firebase has spoiled me. I've used Firebase instead of SQL since 2013. And these aren't just rapid prototypes. They're fully-functional, scalable and used by thousands of customers.
98
102
99
103
## Firebase includes _nearly_ everything I need to build small- to medium-sized apps
100
104
@@ -110,17 +114,17 @@ These five pillars can support an enormous range of apps.
110
114
111
115
Realistically, you'll need to "cheat" on Firebase a bit for larger apps. I use GCP for a few things that don't fit neatly within the Firebase offering. I also use [Algolia](https://www.algolia.com/) to power my search.
112
116
113
-
The funny thing is that Algolia is the most expensive part of my stack at \$35/month. The Firebase databases are optimized for everything **except search**. This is an important caveat to recognize early. Searching Firestore collections or anything in the Realtime Database is extremely limited, and for strong architectural reasons. I don't expect to ever see Firebase support search.
117
+
The funny thing is that Algolia is the most expensive part of my stack at $35/month. The Firebase databases are optimized for everything **except search**. This is an important caveat to recognize early. Searching Firestore collections or anything in the Realtime Database is extremely limited, and for strong architectural reasons. I don't expect to ever see Firebase support search.
114
118
115
-
I primarily use GCP to manage the DNS for my domains. But I've also run some Cloud Compute instances for build processes.
119
+
I primarily use GCP to manage the DNS for my domains. And I sometimes run Cloud Compute instances for small, custom tasks.
116
120
117
-
And I use [GitLab.com](https://gitlab.com/deltaepsilon) for CI/CD purposes... so I guess I step out on Firebase a couple of times on each project :)
121
+
I also use [GitLab.com](https://gitlab.com/deltaepsilon) for CI/CD purposes... so I guess I step out on Firebase a couple of times on each project :)
118
122
119
123
## Firebase scales effortlessly
120
124
121
125
Firebase does not allow slow operations. The database does not execute joins. It doesn't search.
122
126
123
-
I've never brought a Firebase app up to massive scale. I've heard that the Realtime Database can run into limits and require manual sharding; however, Firestore is architected much differently, and I wouldn't be surprised if it scales more like [Cloud Spanner](https://cloud.google.com/spanner/).
127
+
I haven't personally built a Firebase app up to massive scale. I've heard that the Realtime Database can run into limits and require manual sharding; however, Firestore is architected much differently, and I wouldn't be surprised if it scales more like [Cloud Spanner](https://cloud.google.com/spanner/).
124
128
125
129
Firestore has some awesome performance characteristics.
126
130
@@ -136,11 +140,11 @@ Firebase services are built on Google Cloud Platform (aka GCP) infrastructure, a
136
140
137
141
For instance, Firebase Cloud Storage uses GCP Storage buckets that you can access through the GCP SDKs.
138
142
139
-
GCP is an enterprise-focused suite of service. It's massive.
143
+
GCP is an enterprise-focused suite of services. It's massive.
140
144
141
-
Each Firebase project comes with its own GCP account, granting you access to the full power of GCP. So don't worry if Firebase doesn't fulfill your every need. GCP likely has it covered.
145
+
Each Firebase project comes with its own GCP account, granting you access to the full power of GCP. So don't worry if Firebase doesn't fulfill your every need. GCP has it covered.
142
146
143
-
For example, If you don't want to pay for Algolia, you can spin up an Elasticsearch cluster on GCP and roll your own search. It'll be just as expensive as Algolia... so I can't recommend it for small projects; however, those capabilities are all there if you need them.
147
+
For example, If you don't want to pay for Algolia, you can spin up an Elasticsearch cluster on GCP and roll your own search. It'll be just as expensive as Algolia... so I can't recommend it for small projects; however, those capabilities are all there.
144
148
145
149
## Common concerns with Firebase
146
150
@@ -157,11 +161,11 @@ Engineering is all about tradeoffs. Firebase trades a bunch of control and auton
157
161
158
162
## When to NOT use Firebase
159
163
160
-
**DO NOT** use Firebase if you have highly relational data.
164
+
**DO NOT** use Firebase for highly relational data.
161
165
162
-
**DO NOT** use Firebase if you have complex graph data.
166
+
**DO NOT** use Firebase for complex graph data.
163
167
164
-
**DO NOT** use Firebase if you have complex server needs.
168
+
**DO NOT** use Firebase for complex server needs.
165
169
166
170
I sometimes recommend hybrid architectures. Store your relational data in GCP's Cloud SQL or Cloud Spanner databases. Store your graph data in JanusGraph on top of Cloud Bigtable.
167
171
@@ -171,19 +175,19 @@ But these are all advanced use cases! Don't worry about them until you need them
171
175
172
176
Firebase's direct competition is dead. [Facebook killed off Parse](https://blog.parseplatform.org/announcements/a-parse-shutdown-reminder/) and [RethinkDB](https://rethinkdb.com/blog/rethinkdb-shutdown/) suffered a similar fate.
173
177
174
-
The most direct alternative to Firebase at this point is AWS or GCP. They're quite a bit more complicated and harder to use... but you could achieve similar architectures with other services.
178
+
The most direct alternative to Firebase at this point is AWS or GCP. They're much more complicated and harder to use... but you could achieve similar architectures with other services.
175
179
176
180
Or just use Postgres. Postgres is killer... as long as you have budget to write your own API on top of it.
177
181
178
182
That's about it. Use AWS, GCP or Postgres. Your dev velocity will suffer, but at least with Postgres you can run everything locally!
179
183
180
-
I've spent a lot of time with Postgres running in a local Docker container, and it's slick. I didn't write that API myself. It was expensive to maintain, and I could have duplicated it in Firebase at a much lower cost. But the business I was working with wasn't a fan of managed services. What could I do :)
184
+
I've worked in a corporate setting with Postgres running in a local Docker container, and it's slick. I didn't write that API myself. It was expensive to maintain, and I could have duplicated it in Firebase at a much lower cost. But the business I was working with wasn't a fan of managed services. What could I do :)
181
185
182
186
## Conclusion: Firebase is preferred for most front-end-focused apps
183
187
184
188
Firebase is a slam dunk for small- to medium-sized projects, especially if they're front-end focused.
185
189
186
-
You may need to re-architect if you hit massive scale... but you **always** have to re-architect for massive scale. Don't optimize for scale prematurely.
190
+
You may need to re-architect if you hit massive scale... but you **always** have to re-architect for massive scale. Don't prematurely optimize for scale.
187
191
188
192
Choose Firebase because it gets you to market faster. It helps you validate your ideas and get feedback.
0 commit comments