Updates from the Repl.it team about the product

← Back to all posts
Repl.it Database feedback 💾
kochman (46)

Hey replers! We’re beginning to roll out Repl.it Database. We’d love to get your feedback on it so that we can continue making it better.

What is Database?

Database is an easy-to-use key-value store. You can store data in it and retrieve data from it, even after your repl restarts. It's great for building website or game backends, Discord bots, or any other type of app that needs to store some information.

Check out the repl in this post to see how easy it is to use. You can also take a look at the documentation here: https://docs.repl.it/misc/database

How do I use it?

If Database has been rolled out to you, you can look at some examples by opening up a repl and clicking on the Database icon toward the bottom of the sidebar. Database just works inside your repls, without any configuration.

What languages does it support?

We’re providing official clients for Python, Node.js, and Go. But Database is simple enough that you can use it from an HTTP client in any language.

We want to hear from you!

If there’s anything you’d like to see us change or add to Database, please leave a comment below. Thank you for your help!

If you don't have Database in your repls yet, please check back soon! We're rolling it out as you read this.

PYer (4015)

Nice an simple! I'm going to keep using MongoDB for certain applications, as I definitely like the structure. This is nice though!

bigboyyyyyyyy69 (5)

How should I go about doing a more advanced keys retrieve for my discord economy bot...

somthing like

if key does not exist:
do something

ruiwenge2 (1133)

@bigboyyyyyyyy69 like this:

if key not in db.keys():
  # do something here
bigboyyyyyyyy69 (5)

@ruiwenge2 thanks :D I've gotten slightly better with using the db

aGEEKdude (4)

I like this! However, when I click on the link that it provides so that I can see all of the keys, it takes me to a blank page with no content.

ssura (4)

@DSASimon This happens to me too! But when I check the database it says the number of items. But I can't physically see things when I click that link. :(

OneNose (13)

Please add the option to view your data base. It's really annoying.

potatojs (847)

i finely tried it and it is very cool!
but the only suggestion is to add the ability to view/edit the data base from a certain page
something like mongoDB atlas were you can delete document edit them anytime wich could be very helpful while developing!

rayne14 (2)

the db keeps resetting on its own and i lost everything i saved. why does it keep happening? there isn't even a way to just view and backup my data so it's horrible when it happens every couple of weeks or so

Jeffplays2005 (3)

@rayne14 Have the same problems😭

LeCodex (2)

My database got partially wiped just now. I am migrating to another service since the unreliability of this one defeats the whole purpose of a database.

rayne14 (2)

@LeCodex my db keeps getting fully wiped every few weeks. It's super annoying especially when there's no backup or versioning at all

triptych (5)

I love it! Some questions / requests

1) how do I keep the database from being wiped between runs?
For example: https://repl.it/@triptych/IroncladAshamedRobot#index.js
2) need a way to upload / download the database data - like say to/from a json file?
3) when I download the repl to a zip, would be great to get a copy of the database too!
4) do you have any examples of a simple node.js based app using this?

silverwolfceh (1)

@triptych I have the same issue that the database sometimes being wiped. If you find a solution, please kindly share with me. Thanks

JosephMaxwell (1)

@triptych Here's a simple Node/Express app I built with the Repl db: https://repl.it/@JosephMaxwell/NodeJsToDoList

Definitely not the cleanest, but it does work and has a front-end and back-end. I haven't noticed my db getting wiped at all, but I've only been working with it for a few hours.

triptych (5)

@JosephMaxwell Thank you for this! For some reason I though that when the Repl runs a second time that new database call ( const db = new database(); ) would clobber the old database but it seems to be smart enough to persist the database!

McLigma (1)

Bricked my repository twice because you can't delete keys with certain special characters in them (At least ? and /)

veasyveryesasy (1)

Can you add export / import ?

TnhodepressoDin (1)

por que o repl.it demora de carregar tem vezes que nem carrega pra mim editar meu bot ;(

EpicGamer007 (1751)

How do you get your client to be "official" or something, like IreTheKid and CodeMonkey got their python client on the repl.it docs.

potatojs (847)

wait can the free plan users also use the repl database?


kochman (46)

@potatojs Yes, it will be available to everyone, not only hackers.

HarperframeInc (456)

I really like the Repl DB. My only issue is key size limits.
Also, please add the ability to view the Database!

kochman (46)

@HarperframeInc We're open to increasing the limits! We set them conservatively to start with. What would you like to see?

HarperframeInc (456)

Let the owner view all the keys in the database, maybe search for keys?

triptych (5)

@HarperframeInc you could potentially get around this by spinning up a few more repls and shard your data.

HarperframeInc (456)

@triptych No- doing this is insecure, and but sharding- possibly.

NishyDev (0)

You should make/add 'db.add' please, that would extremely help!

FairOPShotgun (0)

How would we do something like this on java?

RizalWidyananda (0)

I think this feature is really handy. It's really simple and beneficial when you want to save simple data. What I don't like about replit db is when I use db.keys(), it returns set. if it return list, I think it will better

ryyo (0)

You literraly can't do anything with it, it says that I have one item stocked when I try to retrieve it I just can't.

PDDZ (0)

the database have to name "db" ?
like, i want to make 3 database, how...
also, are there any thing like "2-keys database", like db["10"]

(sorry if this comment were posted 2 times, but i was disconnected (my wifi bad) when i press "comment")

codingjlu (481)

Can it store JSON?

ch1ck3n (2350)


import json
my_json = {"baba": "booey"}

db["sucker"] = json.dumps(my_json)

Manoeuvres (1)

Hello, i have used the replit database and think it's a great idea but I tried to store a item stopped the program and ran it again and my item was not there more time should be put into this to make it work.

Topscientist (0)

Hi, I am coding in discord.py and am grabbing the discord servers id and storing it in the database in order to store config settings, however when I go to delete the key it brings up this error: TypeError: quote_from_bytes() expected bytes anyone got a fix for this?

Brakko (0)

@Topscientist discord servers id (and any discord id) are int, and the db keys should be str, try making a key using db[str(id)] = val.

MontyMango (0)

I have a suggestion. Can you guys please add an option to make the Replit database key's public or private? The database feature is great! I like it so far!

KevinCai3 (2)

Since this is a key-value store, you might as well use json because its also key-value store and can't really get wiped.
(imo json is easier to use)

dObbOb11 (20)

@KevinCai3 I used json and then I realized that when other replit users stop your repl, all the data saved to json is wiped.

KevinCai3 (2)

@dObbOb11 I use json and it never gets wiped even after stopping.

7ih (34)

It's impossible for me to undo a db function insert from the database tab, please fix that.

JosiahAwsome (0)

It does not set, even though I put the set script.
(P.S It is in a script with if)

Chillmonger (0)

Can you add a way to delete all keys?

ruiwenge2 (1133)

@Chillmonger like this:

for i in db.keys():
  del db[i]
TheKee2004 (0)

i would love it if we could see the database without having to run the program, just like you can view json or txt files on the sidebar

but its still great, take nothing away from that!