Skip to main content

News

Topic: JS-based online database scripting with Firebase (Read 6480 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
JS-based online database scripting with Firebase
I've been hearing good things about Firebase recently and while I signed up for the beta a while back and played around with it a bit I haven't been able to figure out a use for it related to the development that I do...UNTIL NOW.

So Firebase bills itself as "a scalable real-time backend for your app." What this means to us Sphere developers is that we theoretically can use pure JavaScript to interface with and update a real-time database. A high scores table? Done. Online multiplayer game that keeps track of everyone's everything? Easy. Chatroom? Real-time. Logging? Why not? Want to save arbitrary objects like an on-the-fly created spriteset? You can!

Maybe someone here more intrepid than myself can figure out a use for Firebase within their Sphere project that's not covered by the above short list. If someone here uses Firebase within a Sphere project let us know in this thread! It's free while in beta, has low rates after, AND apparently each month $20 in free credit is given.
  • Last Edit: August 22, 2013, 07:28:48 pm by N E O

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Possible JS-based online database scripting
Reply #1
Oh wow! That does look nice.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Possible JS-based online database scripting
Reply #2
A completely JavaScript alternate solution that's basically "JSON as a database" : TaffyDB

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Possible JS-based online database scripting
Reply #3
I modified TaffyDB to be usable in Sphere, I even had to implement my own localStorage object, which basically wraps the Sphere file API.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: Possible JS-based online database scripting
Reply #4
I'll have to keep that in mind for the future. I've generally kept a non-funded approach to my games to allow for more flexible schedules and allow for the ability to avoid the need to shut down my projects, but that's not that bad in terms of pricing.
"If you don't build your dreams, someone else will hire you to build theirs."

Challenging Apathy | Follow me on Twitter!

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Possible JS-based online database scripting
Reply #5
Your post completely confused me until I realized you were replying to the original post, not the last reply... :P

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: JS-based online database scripting with Firebase
Reply #6
Bump! Firebase is now officially out of beta and has a free tier in its pricing chart:


If you're an individual working on a side project or a business that is just getting started, you can use Firebase for free. A development Firebase is large enough for most individual projects and small business applications.

$0 / mo
5 GB Data Transfer
50 Max Connections
100 MB Data Storage


So! For $0, you can set up a Firebase account that you can theoretically hook into your Sphere project. This should take care of most of the basic uses for hooking up a server to a Sphere project, like a scoreboard, chat functionality, and basic online multiplayer (there used to be a multiplayer Asteroids example, now there's a multiplayer Tetris example).

If no one here comes up with a sample Sphere project implementing Firebase I'll port the Tetris example to Sphere and put it up on Sphere's GitHub (probably in sphere-projects). I've already registered the "sphere" Firebase which you can use if you meet simple conditions which I'll document later and copied the Tetris example to http://www.spheredev.org/fbt.html which you can play right now (it's not Sphere JS, though).