Updates from the Repl.it team about the product

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

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 (3462)

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

DSASimon (2)

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.

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 (0)

@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!

potatojs (804)

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!

EpicGamer007 (574)

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 (804)

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


kochman (27)

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

HarperframeInc (344)

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

kochman (27)

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

HarperframeInc (344)

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 (344)

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

CSharpIsGud (596)

Doesn't update when I call set() and it wipes the data once the program exits!
What kind of db is it if it cant even persist data.
now using a json file as a db is the quickest and simplest option

LeCodex (0)

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.

NeilScienceguy1 (0)

I have a 2 questions and feedback

1)Is there a way to update a key's value in the database?
2)I noticed that the storage for a key's value is only 100B could you please increase that?

iamcooliguess (16)

One feature I'd love to see is multiple databases- I really need an alternative to json and instead of having multiple json files, maybe we can have different variables for databases. Maybe something like:
from replit import db
db1 = db()
db2 = db()
I haven't done anything too complex with it, but I want to know how many key-value pairs I can store. I want to store a lot of key-value pairs, so I will be needing that extra space.

evie_codes (0)

Hello! Author of a couple database wrappers here. Got a few little things I'd love to be added to this database system.

  • count() or size() method to give us a number of entries recorded (without having to get db.list())
  • clear() or deleteAll() to remove all entries (perhaps with an optional prefix support)

And perhaps, as a future development option, the possibility to store json instead of just strings? Obviously a larger change than my other 2 suggestions, and I can't pretend to know how this DB is implemented in the back-end, but doing something like what the serialize-javascript module does (on npm) would be the most awesome thing from a JavaScript perspective!

SeamusDonahue (30)

I think you should be able to look at and manipulate keys without code so if you accidentally make keys you don't need you can delete them worrying about forgetting what the keys name was.

BenjaminOBrien (33)

The only key in the db.keys() value is KeysView(<Database db_url = "xxxxxxxx">) for me.

BenjaminOBrien (33)

correction: i think it might be my keys all start with gooble:// so its returning a 404

Fitzpasd (0)

Feedback: Seems like the Node.js client can also be used for Typescript Repls. Should it be there as the default option? The package has a typings file.

sumatra (0)

I want to make a simple visit counter for my "website" (it isn't a real website, just literally a go function


when I run it, everything is good but when I open in private browsing
REPLIT_DB_URL not set in environment

how do?

Terrav (0)

This feature is awesome, but it all comes crashing down when I add a value containing a semicolon. Now my database is completely useless!

AlvinSeville19 (2)

Hello! Please increase key/value field width slightly.

ClaudeDe (0)

Is there any support for a php web server?

kochman (27)

@ClaudeDe We don't have an official client, but you should be able to access the REPLIT_DB_URL environment variable and send requests to it from PHP or any language: https://repl.it/@kochman/Database-PHP

TnhodepressoDin (0)

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

SwaroopBappanad (40)

Why is it working for some people and not others?
also, I'm hyped!

Duvangamer3845 (117)

my code is this

from replit import db
db["person"] = []
while True:
 olo=input("you wanna create a new username(c) or you wanna use a existing(e) username, or see the usernames?(u)")

 if olo=="c":
   db["mainkr"]=input("enter a new username: ")
 elif olo=="u":
   exts=input('enter a existing username: ')
   if exts in olaxd:

but i dont know why fix the wrong:
'str' object has no attribute 'append'

how i ca fix this, thanks

SeamusDonahue (30)

you cant append strings, use += instead, if you second value isn't a string make it one using str( ) @Duvangamer3845

adl212 (127)

Awesome! Isn't there another module for replitdb in python though?