[Open Source] FirebaseService

Can you tell me what the difference is- and which Firebase wants you to use over the other?

this “Firebase Service” library is a wrapper for the realtime database. you can’t use it with cloud firestore, which is the newer one

image
So this is what I have right now, how would I get that 351 from it?
I’ve set the token from a service account from a legacy key gen.

Sorry but I can’t seem to find a list of Pros and Cons of using your module over Roblox provided Datasore Service, if you don’t mind would you do that for us?

1 Like

I’m not the OP but Firebase generally offers a better read/write speed (time for response), read/write rate (amount of times you call the database every second), a very sleek and easy to use interface for everyday administration (such as reimbursing items, fixing corrupted data, etc.) and usually less down-time (though that can be argued lately because of frequent Google Cloud downtimes). Obviously, Firebase also comes with an arguably better data saving structure (JSON, which allows you to save tables within tables as example) for what the usual Roblox game needs.

However, while Firebase has a “pay what you use” plan, it may start to become relatively costly if your game is very active, though that won’t be noticeable if you’re running a game with less than 300 players or so. Also, you obviously don’t have Roblox’s support in case of datastore issues in-case of platform-wide issues, but Google appears to have a good support service on that front.

2 Likes

So you don’t recommend using this for a Front page game?

1 Like

No, but yes, it depends on if you are dependent on the speed or want to do off-site leaderboards, etc.

1 Like

If you have a front-page game, you’ll probably have to pay something like $1000 USD every month (just a guess, judging by the firebase price calculator). But your game’s revenue makes this look almost insignificant if it’s on the front-page anyway, so it’s up to you.

2 Likes

In an Extreme case like Adopt me that recently has 150k players peek but an average of 80k how much would that cost?

In common case for 20k -10k players you would say it cost about $1000 a month?

That’s not bad, is FireBase also used for Mobile games made by other engines?



I am fairly interested but I haven’t done much research on how this stuff works yet.

I think at 10k players you’d be spending a bit over $1000 every month, but again that’s a lot of game revenue. I can’t say exact numbers for sure since I haven’t tested the request rates on a very active game.

1 Like

It is very interesting to use since it can do much more than Roblox’s Datastore, it could be used as a Backup for DataStore, used for collecting Data or other sorts of things that is less intensive read/write frequency.

Thank you for the insight!

1 Like

I’ve been using Firebase in my Roblox games for about a year or so now and along the way I’ve picked up some (what I think are) useful tips for anyone new to Firebase.

Firebase’s Realtime Database is very easy to use but is no where near as good as their newer “Cloud Firestore.” Heres why:

  1. Firestore is cheaper, and I mean way cheaper. If your game is small then don’t worry about this as Firebase services are free for small projects that don’t exceed their limits. However, for bigger games, you need to keep this in mind as doing constant writes and reads to Realtime Databases will cost a lot of money. Firestore offers a much cheaper service as data is structured differently (Read more on their website). If you want some actual statistics, I was being charged around $100 USD (with about 1000 concurrent players) a month for my Realtime Database but after migrating to Firestore and learning how to better manage the data in documents and collections, I was only paying $10 USD on high game traffic months. (Granted, I did also do some major optimizations on the Roblox side of things as well)

  2. Firestore is more organized (and in my opinion, more scalable). Realtime Databases are great if you’re starting out and just want to store some global data but if you want to store user data, things get messy really quick. Unlike SQL (which neither of them are), Realtime Databases are simply a mega JSON table with no uniformed keys and values. In short: some peoples data might look different to others if you make an error when writing user data. While this can still happen in Firestore, it’s much more forgiving as all data is stored in previously mentioned documents and collections. Read more about it on their website if my explanation was bad.

Firebase also offers an amazing Cloud Functions service, which if you’re into NodeJS, you must try out. I won’t go into detail but when paired with Cloud Firestore (or Realtime Databases) you can make some really cool stuff.

NOTE:
While this is well and cool, I have to say, Roblox’s Datastore Service is way more reliable and fast. Unless you are making cross game user data, just stick to what Roblox offers.

But, if you’re just trying it out, this module is actually amazing and I wish I had a resource like this when I first started trying Firebase.

6 Likes

I’m guessing this can’t be used for the Cloud Firestore, or can it?

1 Like

This is only for the Real-time Database.

Oof, looks like I need to start digging or the Cloud Firestore and how to do it

1 Like

I have been playing with this a little bit and realised I can’t add data only edit it, how do I add new data to a DataBase?

Is there any way to get an array of all the key names with this module?

Hello @MXKhronos,
I have recently ran into an issue when I do an action such as database:removeasync(path) the script goes right over it without an error but does not delete said object same happens for database:setasync(path,value). But database:getasync(works fine)

How secure is this? I assume if someone has the token they can do alot of bad things with it

That’s the case for most API authentication methods. It’s all about how secure you can keep the API key yourself. They are not insecure on their own.

Unfortunately, Roblox doesn’t provide any sort of secret vault solution so you have to resort to sub-par solutions like storing the keys in a datastores so it’s not plaintext.

1 Like