HACKER Q&A
📣 pplonski86

Databases with data for Testing?


Do you know any service with databases (different types) with generated data available for testing?


  👤 TheTank Accepted Answer ✓
Hey, generally users like to define datasets so it looks like the data they will eventually use for their application. As such they are all bespoke and I don't know of any "standard".

But generating bespoke random data quickly is easy. To generate such datasets, you can try QuestDB, which allows you to do it with SQL. You can define patterns (for example for timestamps) or constraints. Feel free to try and to slack us if you need help.

https://www.questdb.io/docs/functions#overview

As an example, if you were to work on say a trading application, you could try something like this to generate a trades table

SELECT rnd_str(2,2,0) instrument, rnd_str('B','S') side, rnd_int(1,10000,0) quantity, rnd_int(9900,1100,0) price from long_sequence(1000000);

and then download the results as csv. long_sequence(X) defines how many rows you would like to generate. You can set it in the billions if you want.


👤 sethammons
Can you be a lot more specific?

👤 highhedgehog
I used knex.js to generate fake data on my database schema. You create the seed files for your environment as you create the database tables. Works like a charm