Run MongoDB compatible apps on Firestore (Zero code changes)
Key Takeaways
The video demonstrates how to run MongoDB compatible applications on Firestore with zero code changes by simply changing the connection string, leveraging Firestore's MongoDB compatible interface and serverless architecture.
Full Transcript
I have heard that you can now easily swap between MongoDB compatible databases and fire store. >> Yes, you can. Let me show you how. >> Welcome to the show, Patrick. What do you do here at Google? >> I lead the engineering team for cloud fire store. I originally joined the team 12 years ago when data store was only an integrated database for Google App Engine. >> Oh, I remember using App Engine with a built-in data store back in the day. So your team Patrick, you guys broke out App Engine's integrated data store and made it a standalone product and the result is Fire Store. >> Yep, that's pretty much the origin story. The App Engine data store was great, but it was tightly coupled to App Engine. People wanted to use a high-erformance and scalable NoSQL database like that from lots of other places. So we modernized it and made it available everywhere. And that became Fire Store back in 2017. >> Oh, 2017. How time flies. I still remember the announcement. >> I I hear you. Now we see Fire Store used all over the place. Folks are using it for mobile and web apps for things like collaborative productivity tools, game backends, and even LLM context stores. Fire store supports direct connections from mobile and web using our real-time SDKs or from serverside code running on something like cloud run or kubernetes engine which talk to fire store to handle all the data. >> Now, how is it even possible to switch to fire store? I've always been told that the database is the hardest and most expensive part to switch in any app. >> Well, in the Fire Store team, we built a MongoDB compatible interface from the ground up directly into Fire Store. We recently released it to Google Cloud and Firebase customers as part of our new enterprise edition. >> Okay. Uh, that sounds good in theory. Uh, how would it work in practice, Patrick? Here is a simple e-commerce application symbol direct. Let me place an order. The application uses Cloud Run and a MongoDB compatible database. Here is the order I placed in the database. >> Okay, so far so good. >> Let's say I want to try out Fire Store. I've prepared a Fire Store database ahead of time. I'll copy the fire store connection string from here into my application's environment variables here. Then I'll deploy a new version of my app that uses this new environment variable. Now I'll place another order. Here we can see my new order in Fire Store. That's cool. I shot a video a few years ago about switching between MongoDB and Fire Store. And in that video, we had to modify code to make it happen. But now you don't have to do that anymore. >> That's right. Now all you have to do is change a connection string. >> I liked your demo, Patrick, but I have so many questions. >> Go ahead, Martin. >> So why would I choose to use Fire Store? >> Well, many developers love serverless for its simplicity and pay-per-use model. It's why Cloud Run is so popular. But you need a database that works the same way. [snorts] >> And that's Fire Store. >> Yes, that's Fire Store. It's a serverless database that works well for one query per day or a 100,000 queries per second without you ever having to provision capacity, patch servers, or worry about sharding. It just works. You only pay for the reads and writes you actually use, not for idle time. And since it's fully integrated with Google Cloud, your AM networking and security are all in one place. Paired together, Cloud Run and Fire Store create a powerful, simple, and scalable stack for your application. >> Okay. Uh scalability. Uh let's talk about that. How does Fire Store handle performance under heavy load? >> Such a great question. Remember that online shoe store I showed you earlier where we placed those couple of orders? >> Uh yeah. Uh, symbol direct, right? >> Exactly. Well, I actually ran a pretty intense load test on it earlier today. You might think Fire Store can only handle an order every few minutes. >> That would be a pretty relaxed shoe store, >> right? But it can do so much more. Let me pull up the dashboard for that store. If you look at the top left graph here at the start of the test, we're seeing a few hundred orders per second. Then, as the load tester ramps up, we hit a peak of about 40,000 orders per second. >> Whoa, that's a lot of online purchases. I wish I had an online store that popular. >> Me, too. And if you look at the top right graph, as those orders surge, so do the Fire Store inserts. We see a direct correlation hitting 40,000 Fire Store inserts per second, which is what we'd expect. >> So, the database is keeping up with the incoming orders >> precisely. Now while fire store is handling the data the application itself runs on cloud run. Take a look at the lower right graph. You can see Google automatically scaled up the number of cloudr run instances from five to 100 to gracefully handle that massive load. >> And how did you configure that? >> I didn't. I deployed my cloud run service and Google took care of the autoscaling. No pre-provisioning, no manual intervention needed to handle 40,000 orders per second. It just worked. Very nice. Uh, but what if someone wanted to control costs and prevent Cloud Run from scaling up like that? >> Very valid concern. You can set a maximum number of instances for Cloud Run for this particular test. I didn't because I wouldn't want to turn away paying customers from my shoe store. And finally, to ensure our customers had a good experience, the lower left graph shows that the median latency for end users stayed around a snappy 18 milliseconds, even at peak order volume. >> 18 milliseconds. Not bad. Now, if I want to start using Fire Store, I'd have to move my existing data over. How would I do that? >> You would use data stream, Google's serverless replication service. It handles the initial copy of all your existing data and then uses change data capture to stream any new changes from your old database to fire store in real time. That way you can migrate with minimal downtime for your application. >> Great. Does this new uh compatibility support all my existing MongoDB queries? >> It supports over 200 of the most commonly used features and we keep adding support for more. Check the doc for details. >> Excellent. That was my last question. Uh, this was a lot of good info, maybe more than I can remember. Uh, what are the main takeaways here, Patrick? >> First, flexibility is good. Now, it's easier to switch between MongoDB and Fire Store in both directions. That's good for developers. Second, serverless is good. Fire store scales up and down with your needs with no need to provision ahead of time. And third, a single pane of glass is good. If you are using Google Cloud and Fire Store, you can manage your app and your database in one place. >> Good takeaways. Thanks for joining me, Patrick. >> Thank you so much for having me, Martin. >> And thank you everyone for watching. If you have any questions for Patrick or me, please add them in the comments. Also, let me know what you thought of this episode. I love hearing from you and I read every single comment. Can't wait to see what you build.
Original Description
Firestore with MongoDB compatibility overview → https://goo.gle/4rHxW5L
Did you know you can point a MongoDB application at Firestore just by changing a connection string? Patrick Costello, Firestore Engineering Lead, joins Martin Omander to show exactly how the new interface works under the hood, without changing any code.
Watch along as the duo switch an application from a MongoDB compatible database to Firestore, and then we put it to the test. Patrick ramps the load up to 40,000 orders per second, showing how Firestore handles the massive influx of writes while Cloud Run automatically scales the application instances to match.
Key takeaways:
1️⃣ Flexibility: Easier switching between MongoDB compatible databases and Firestore (in both directions) using drivers and tools you already know.
2️⃣ True serverless: No sharding or provisioning capacity ahead of time. It scales to zero and handles spikes automatically.
3️⃣ Unified Ops: Manage your database, IAM, and networking in a "single pane of glass" alongside the rest of the Google Cloud resources.
Chapters:
0:00 - Intro
1:01 - What is Firestore?
1:40 - Is it realistic to switch databases?
2:10 - Demo
3:18 - Why use Firestore?
4:14 - Scalability
6:26 - Database migration
7:15 - Takeaways
7:49 - Wrap up
Watch more Serverless Expeditions → https://goo.gle/ServerlessExpeditions
🔔 Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech
#GoogleCloud
Speakers: Martin Omander, Patrick Costello
Products Mentioned: MongoDB, Firestore, Cloud Run
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Google Cloud Tech · Google Cloud Tech · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
I’m going for it #GoogleCloudCertified
Google Cloud Tech
I had to get #GoogleCloudCertified
Google Cloud Tech
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
Introduction to Generative AI Studio
Google Cloud Tech
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
Introduction to Responsible AI
Google Cloud Tech
Networking updates and CDMC-certified architecture
Google Cloud Tech
Create and use a Cloud Storage bucket
Google Cloud Tech
How to digitize text from documents
Google Cloud Tech
Faster analytical queries with AlloyDB
Google Cloud Tech
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
Introduction to Assured Open Source Software
Google Cloud Tech
BigQuery Cost Optimization: Storage
Google Cloud Tech
BigQuery Cost Optimization: Compute
Google Cloud Tech
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
Vector Support on our radar #GenAI
Google Cloud Tech
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
Kubernetes and multitasking updates!
Google Cloud Tech
GKE: Using Kubernetes Events
Google Cloud Tech
How to configure firewall rules for Cloud Composer
Google Cloud Tech
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
Ensuring requests are set in Kubernetes
Google Cloud Tech
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
How to run #MySQL in Google Cloud
Google Cloud Tech
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
GKE Load Balancing: Overview
Google Cloud Tech
GKE Load Balancing: Best Practices
Google Cloud Tech
Disaster Recovery in GKE
Google Cloud Tech
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
Enable and use GKE Control plane logs
Google Cloud Tech
Compliance in Australia with Assured Workloads
Google Cloud Tech
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
What's Next for Google Cloud?
Google Cloud Tech
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
What is fleet team management in GKE?
Google Cloud Tech
Troubleshoot VPC Network Peering
Google Cloud Tech
Introduction to DocAI and Contact Center AI
Google Cloud Tech
Cloud Run Direct VPC egress explained
Google Cloud Tech
Database deployment options in GKE
Google Cloud Tech
Analyze cloud billing data with #BigQuery
Google Cloud Tech
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
Accelerating model deployment with MLOps
Google Cloud Tech
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
Pricing API on our #Radar
Google Cloud Tech
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
Troubleshooting: Node Not Ready Status
Google Cloud Tech
One weekend until Cloud Next 2023!
Google Cloud Tech
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
#GoogleCloudNext will be demand!
Google Cloud Tech
More on: Systems Design Basics
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Common Next.js Errors (and How I Solved Them)
Dev.to · gary killen
Applying Scalability in Backend (CodeBuddy)
Medium · LLM
Why Every Backend Developer Should Learn Nginx Before Going to Production
Medium · DevOps
Connecting Frontend to Backend: A Backend Engineer’s Reality Check
Medium · Programming
Chapters (9)
Intro
1:01
What is Firestore?
1:40
Is it realistic to switch databases?
2:10
Demo
3:18
Why use Firestore?
4:14
Scalability
6:26
Database migration
7:15
Takeaways
7:49
Wrap up
🎓
Tutor Explanation
DeepCamp AI