JENNY BROWN: Choosing the right database
can feel like a never ending series of questions.
Structured or unstructured data?
Scale or consistency?
Relational or nonrelational?
And wait-- what about reliability?
Stay tuned to see how Critter Junction narrows
the scope of their search to get some much needed answers.
[MUSIC PLAYING]
When it comes time to choose the right database
for your application needs, it's all about trade-offs.
Each database product you'll run into
has plenty of differentiators and features,
all designed to help you find the best
fit for your situation--
which on one side, is good, but can also
lead to analysis paralysis.
And this is where Critter Junction found themselves
when we met up with them.
They were looking for a database for a new web and mobile mini
game.
Fortunately, while looking at the cascade of database options
in Google Cloud, we helped them match up
each product to their potential business needs
by focusing heavily on vertical versus horizontal scaling.
Narrowing the scope of the search
was helpful for Critter Junction and let
them evaluate their options through the lens of scale.
First, we took a look at SQL, or more specifically, Cloud SQL--
a managed database offering for MySQL, PostgreSQL, and SQL
Server--
a modern offering for a tried and true classic.
Cloud SQL is a great fit for any application with loads
of structured data that's looking
for that sweet spot of convenience, configuration
options, and performance.
The familiarity alone could make this a helpful option
for Critter Junction.
But again, for this search, we're focusing on scaling.
The best part is that Cloud SQL gives you flexible control
over scaling and deployment.
It'll wait for you to decide when
and how to grow with high availability
and replication built in.
Whether you need vertical scaling
to instances with higher CPU and memory
or adding read replicas to achieve horizontal scaling,
it's all up to you.
But since Critter Junction's elite gamers
couldn't handle any downtime during resizing
and need to be able to fetch the latest updates from each read
replica, Cloud SQL wasn't the perfect choice.
And once you reach a certain database size or 4,000
concurrent connections, it might be
time to look at another option.
So let's turn things up a notch.
When you want the ability to go from small to massive scale,
Spanner is your answer.
As a fully managed relational database service,
it handles nearly unlimited horizontal scaling for you.
It's also got automatic data sharding and replication,
giving you that 99.999% uptime that your data admins
and users are so fond of.
And while Spanner is the backbone of billion user
services like Gmail and YouTube, it
might be a little too powerful for Critter Junction's
new minigame alone.
So let's reel it back in a bit to find a better match.
Cloud Firestore sits a little further
towards the opposite end of the spectrum.
It'll handle horizontal scaling for you,
but where Spanner focuses on global consistency,
availability, and volume, Firestore also
focuses on developer flexibility.
Specifically, Firestore can sync your data directly
with client applications through real-time listeners
and support your hierarchical data structures with real time
querying and offline support.
Firestore scales up automatically with no downtime.
This lets Firestore handle thousands
of requests per second, millions of concurrent connections,
automatic data replication, and strong consistency.
This means Firestore could offer the flexibility
that our Critter Junction game devs need,
while also giving them the scale for their application size.
Sounds like a win for Firestore.
While Firestore might be great to handle things
like configurations, friends lists, and game services,
it's a novice when it comes to big data.
And for Critter Junction's analytics team,
that's a big deal, as they need a separate database
system for their needs.
But that's something we'll talk about in the next episode, when
we dive deeper into their full architecture
and explore Spanner, Big Table, and Memorystore, as well.
Even though we've only scratched the surface,
Critter Junction already has a pretty solid starting point
with Firestore for their mini game
and is ready to start designing a larger
system to suit their needs.
Next time, we'll show you how they grew their architecture
and database solutions from here.
Check out the links below to learn more.
And remember, always be architecting.