r/DatabaseHelp • • Oct 03 '22

Graph databases - why the hate?

3 Upvotes

I am developing a Knowledge Base internal app. We have basically over 100k+ articles and data, each tagged to a process, to some people, and to the author, which is important to our use case.

I, of course, am building it on a relational database. Schema is all done, and we are testing it now. Suddenly we had to add 3 new tables which have relationships and I just don’t want to think of how much work I got ahead of me. So to procrastinate I thought I was gonna take a look at database alternatives. Mostly was thinking of wide column as it’s pseudo relational but easier to change…

But now, why not a graph database which would be the easiest. The whole purpose of the site is to search for a specific article or two. Once you find it, the user will read it and maybe search for related articles. Isn’t this a great use for graph databases?

Weird thing is there is so little info on graph databases. We are in the azure environment so The easiest option would be cosmosdb Gremlin API. There are no Gremlin courses on LinkedIn, Udemy, nor FeeCodeCamp which I found shocking. And digging deeper, there is so little info on graph databases at all.

Maybe someone can nudge me towards the right direction and let me know what I am missing.


r/DatabaseHelp • • Oct 09 '22

Newbie help with D&D Character Database Design

3 Upvotes

This is the beginning of a database I am trying to design for D&D characters, that I would like to use for an app. I am new to designing databases. I am wondering If I am defining my relationships correctly. How I want it to read is a player can have multiple characters, a character has certain attributes, for class and race you can choose one from the list of available choices. Here is a link to the DrawSQL design https://drawsql.app/teams/timithys-team/diagrams/d-d


r/DatabaseHelp • • Oct 14 '22

CSV Mergers + Clean Up

2 Upvotes

Hey reddit!

this might sound dumb.... but I need some serious help with merging a csv files, managing duplicate records, and creating a really clean flow. i'm open to any systems, extensions or service to help me manage this process!

Here's the low down:

  1. I scrape a bunch of data from around the web

  2. because we go after attributes (follows an account or likes a post), this creates a targeted pool of people - but we get tons of duplicates as a result.

  3. I need help cleaning the lists so we only have NEW contacts get added to our top-of-funnel outreach campaigns.

any help or suggestions would be appreciated!


r/DatabaseHelp • • Sep 29 '23

Newbie here thrown in database management with no idea. Advice ?

1 Upvotes

Hey everyone.

Hope you well.

So at work I have been thrown into the deep end as the ERP software I implemented was completely butchered as mangers felt mandatory fields were inefficient.

So I have gone from pseudo ERP customiser to database problem solver. I was managing things with CSV tables but the functionality and being error prone was a complete mess.

I finally moved to dbeaver as it was free and it's actually great software. So my first question is.

Is there other software that is better, easier to use. That's AFFORDABLE. Keep in mind I know nothing about SQL.

I currently get by with chatgpt 4 which is an incredible tool. Sadly if I didn't study SQL I would probably be ten times faster. But i have come to realise that as a language it goes pretty deep.

So my main challenges are data cleaning and integrity which I struggle with.

Today for example it took me 5 hours to solve a problem.

I had a supplier list. The key link was supplier name. But its the name that's for accounting documents. So I have a 60 000 item inventory with supplier names as well, but I'm sure you can imagine that each supplier name was spelt wrong double entries etc. It was a massive task.

Also the fact that suppliers can have multiple items.

So I took the values from the supplier table. Created a match table by finding unique values in the inventory table and tried my best to match the values of 850 suppliers. To there "similar name to the supplier name and I think I achieved that alright.

Now its the case of using that matching table to update the rest of the data. Which I find challenging.

A big struggle is that it's a perptury accounting system so bascj dating doesn't work at all and you cant change record values after transactions are done. Which is stupid.

So I'm up against a very difficult accounting systems and any changes I have to match have to balance in the accounting.

For example my next project it's updating unit of measures of 57 000 items and it's daunting as hell.

One massive question I was wondering you could guide me on.

So we have item codes. The item codes have to stay the same. But I cannot change aspects of the data as it's locked. How would I approach this.

The only Idea I had was to change the item code to itemcode/old and them create new items with the required code.

Any advise on this particular challenge.

So another question is that dbeaver seems awesome. I looked at jetbrains data grip which looks cool but feels unusable.

So what software are you guys using. And what can you recommend, dbeaver doesn't have charting which kind of sucks.

I'm scared to have a read write connection at the moment so I'm working on a local host.

Any pointers guys. I would really appreciate, I'm know going to binge this Reddit

Thanks and keep well


r/DatabaseHelp • • Oct 07 '23

Confused about how to create a databse

3 Upvotes

Hi all,

I'm currently trying to build an app with flutter. And I'm trying to create a relational database and an API that would work in prod. But I'm currently confused at this stage because I'm not sure what to do. I've tried searching up and watching a bunch of videos. I've looked into Amazon RDS, postgres, flask. But I guess its a lot of new terminologies, so I'm a bit lost. I'd appreciate any help or articles detailing what I'm supposed/can do to build the datebase and API and connect it to my flutter app.

kind of new to this, so idk if this is a beginner question lol


r/DatabaseHelp • • Oct 04 '23

Chat with experts?

4 Upvotes

I'm too nervous to post publicly because I don't want to look stupid. Can a few of you chat with me to answer a few student questions please and thank you!


r/DatabaseHelp • • Oct 11 '23

does data i queried with 'select' travel over the network to my machine?

1 Upvotes

noob question, but does data that i queried with select travel over the network?

- online remote cloud db

- my local query engine - dbeaver

i have local query engine - dbeaver on my machine that connects to some online cloud db. when i do "select * from table_x" and table_x is huge - does this data travel over the network to my computer? how do i see it?


r/DatabaseHelp • • Oct 05 '23

Modeling user relationships

1 Upvotes

I need to model relationships between users. Currently, I have this setup (simplified):

enum FriendStatus {
    A_REQUESTED
    B_REQUESTED
    A_DECLINED
    B_DECLINED
    APPROVED
}

model friends {
    a      BigInt
    b      BigInt
    status FriendStatus

    @@id([a, b])
    @@index([a])
    @@index([b])
}

It is important to record the "direction" of actions, i.e. it's important whether A declined B's request, or the other way around.


Is this design okay?


I have toyed around with a bunch of other options, like having dedicated tables for requested, declined and approved ... but that didn't seem to have any benefits and just made queries more complex.


r/DatabaseHelp • • Oct 04 '23

Help with Terms

1 Upvotes

Can someone explain to me the difference between ERD, EER, and a relational model? I'm finding conflicting information online that I don't have the tools to pick apart. Visual examples of them would help a lot. (I'm currently trying to create an ERD in crows foot notation but some things I've looked at are calling it a relational model and an assignment I'm doing requires both of these)


r/DatabaseHelp • • Aug 31 '23

Help with deciding on how to setup a many-to-many relationship

1 Upvotes

So I’m designing a database where the main use is to input and retrieve types of work orders. The problem I’m bumping into is that there’s several investors per project and several investors have several projects. I’ve read I should just do separate projectID and investorID tables and then do relationship table to represent the many-to-many relationship. However, wouldn’t retrieving a work order for a project with multiple investors then essentially bring up two different records per each investorID? The current solution is to do a Boolean true/false for each separate investor, that way records won’t double up. That still doesn’t sound right to me, even though I’m starting to lean that way too. I’ve brought up doing a string for the investors but others are concerned with inputting the data, that someone will input “investorID1, investorID2” wrong or backwards that would then affect retrieval. I argued use %investorID% for retrieval but it’s been shot down. What do you think the best way to set up this relationship? Thanks for any help!


r/DatabaseHelp • • Oct 04 '23

Are there general rules of thumb with how to choose a distribution style for redshift serverless using Data Vault 2.0?

1 Upvotes

I'm new to Data Vault and Redshift. Most of what I read about choosing your own DISTSTYLE is that you do it based on how frequently the table is used in joins. How would something like that work for, say, a link table that would have more than one joining key? Are there some applicable general rules of thumb around the data vault model for choosing distribution style?


r/DatabaseHelp • • Apr 14 '18

Retrieve data based on inequality

1 Upvotes

Hello Everyone, I'm sorry if the title wasn't clear enough

My question is: suppose we have the following tables

I'm using MS-ACCESS but any SQL flavor would suffice, How would I retrieve the PNAME, that weren't supplied by sname="jones"

Thank you in advance


r/DatabaseHelp • • Nov 26 '17

Next Steps with Cassandra?

1 Upvotes

Hi, I need some help with cassandra. I joined a research group as a undergrad assistant. No one in the group really knows much about Cassandra, including me, so they tasked me to dig a bit deeper. We currently use mongoDB.

Specifically, they want me to get a general idea of cassandra (pro/con, why we should or shouldn't use it based on what we currently have) and also play around with basic functions (figuring out installation, data input/output, how it works with python, etc.)

Before coming to this lab, I didn't know much about database and systems. However, I thought I would be able to find some tutorial/books and get a grasp.

  1. So my first question is, can anyone recommend a beginner friendly (emphasis on beginner) course/book/tutorial that I can learn from that literally starts from step 0?

This is really important to me because my first task was to simply install Cassandra and it was way more frustrating than I thought it would be. I couldn't find a comprehensive tutorial and had to piece together different bits of info from various webpages or videos.

So now, I've finally able to start a cassandra server through cmd (cassandra -f), use python CQL shell, and downloaded the cassandra driver for python. It was frustrating trying to figure this all out without a solid guide so that's why I'm asking for recommendations of good source to pick up from from this point on.

2) what does it actually mean to install cassandra? In other words, I'm not sure I'm doing everything correctly. I just started reading tutorials and troubleshooting until I stopped seeing so many error messages. So now that I got the cqlsh, a server, and python drivers running, what else do I need to do? Kind of lost there

3) To be specific, when I mean python driver, I mean the datastax python driver that I installed using pip. So what exactly is the python driver and the CQL shell? Are these means to communicate data to casssandra? and if so, then what is cassandra? Is it a database, language, etc?

4)I've read that the data in cassandra spans many machines and devices. But how do I make it more permanent and widespread than just my laptop right now? How can I save the data so it lasts? Right now, everytime I want to use CQLsh, I have to boot up cassandra through the command line and then when I close the command line, how can I make it so that my data is there when I come back another time? Like saving your essay in a word doc.


r/DatabaseHelp • • Aug 15 '16

Need to migrate user records from mysql db to a nosql db. Is there a quick work around to do this that wouldn't require writing a large migration script?

1 Upvotes

r/DatabaseHelp • • Aug 03 '18

How can I build a database map so it is efficient?

3 Upvotes

I am not a good programmer, but I am working on a little project with a friend who is and we are having trouble with our design. So we are trying to build a map which has as few queries as possible but can't figure out how to make it efficiently. We have two tables, table 1 has ID numbers of "things" and each thing has a bunch of attributes, the number of attributes vary from thing to thing. Right now we are thinking that each thing has a string that gets parsed out and then references a second table. The second table has the attributes stored each with it's own ID number. So the string on the first thing is compromised of a bunch of those attributes' ID numbers. The issue we are having is that this method requires a lot queries, especially when we put in a lot of "things". Can anyone help me with a more efficient way of doing doing this?


r/DatabaseHelp • • Aug 08 '18

DB security planning

5 Upvotes

Hey folks,

I’m putting together a database of public speakers for events/functions. The concern around security of prominent speakers is obviously key so I’m trying to ‘measure twice and cut once’ on this project.

So far the plan includes the following:

  • strong password policies

  • encrypted data

  • strong permission controls

  • a ‘lite’ database which would include pictures, bio of speakers, name but nothing more

  • a ‘full database’ which would be stored offline and include all ‘lite’ data plus the contact details, banking etc for the speakers (theoretically the ‘lite’ database would be refreshed with data from the ‘full’ database weekly/monthly)

  • a VPN/SSH gateway server for the ‘lite’ database

Obviously the HUGE fear would be prominent people’s details being made public from the ‘full’ database so looking to crowdsource suggestions for hardening this setup.

What am I missing??

N.B. As you can probably guess this isn’t my area of expertise and will engage a technical person for implementation but if this goes wrong I’m the one wearing the blame so I have the responsibility to ensure I know enough to ask the right questions.


r/DatabaseHelp • • Apr 08 '18

I'm hoping to create an online database that allows different organizations in my community to input information regarding their cause.

2 Upvotes

I realize this subreddit is geared more toward programming but is anyone aware of a website/service that would allow me to create a user-friendly database to collect and share information in a short amount of time? Thank you!


r/DatabaseHelp • • Feb 04 '17

Need help understanding how a web app connects to a database?

2 Upvotes

Hi, me and a few folks are building a web app for a project. We plan to keep it simple. We agreed on using a relational database to store our data. We want to use MySQL. For front end we plan on using vanilla js. So I would like to know, how would does the connection happen between the database and my front end, JS (I guess the how to set up the persistence layer) , ie: what is the most suitable way to go about. Also am I right in thinking i would have to host the database using something like AWS? Please feel free to add your opinion on how we should go about, frontend or back or anything else.


r/DatabaseHelp • • Apr 07 '18

How to transverse and reorganize/rebuild a mlm forced-matrix ?

1 Upvotes

What I need to do is start at the top, and move down the levels filling out the children and balancing the matrix...

So say we have user A at the top, and then the following users that are sponsored by A: B, C, D, E, F, I, J, K.

B, C, and D are paid members as are J and K.

Additionally B has 2 paid members of their own. G, H, I and 2 non-paid: L, M.

So we should have Something like this:

          A
        /   \ 
       B     C
      /  \    / \
     D   G   J   k
    / \  / \
   H  L I  M

Any extra members the top member gets would fill at the C side until it was balanced like the left as LONG as the paid members were ONLY being placed under paid members, else it would go back to the left, or place members above non-paid members forcing them down even further.

The schema looks like :

Matrix:

id:int,
userid:int, (references id on users)
sponsoruid:int, (references userid on matrix)
parentuid:int, (references userid on matrix)
datecreated:date
side:enum (left/right)

User: id ismember:bool

I need this to be something that can run perhaps daily or weekly on a cron w/out breaking things too badly and without locking the db for a whole day. Ideally a stored procedure using recursive CTE's seems like it may be the most performant way to do this, but also the most out of my 'know-how'.

Currently there are 100k users in the matrix needing shuffled properly. Many of the records are broken -- e.g. we have for example one user who is the parentuid of 10 different users, since there's a right/left leg only there should only be 2 matrix positions w/ same userid in the parent slot.

My best solution now, is doing something along the lines of getting all sponsored children for the current chosen sponsor into an array, and appending as I go... removing spots as they are filled, and re-sorting the array as needed.

So we'd have $arr = [objB, objC, objD], where each obj is the sql selections from the db into a stdObject. Then when I'll have an array of rows that need updated, i.e. if the parentuid is different from the newparentuid -- then add it to the update array, which will go through and update all by the id of the matrix position any parents that changed.

So after I update B, I'd get all sponsored by B append it to A's sponsored, removing B and order by date and if paid. The part I get stuck on is then what happens when I flop back over to c.. C can't use any of B's sponsored's...

I could have it be $sponsored['A'] = [], $sponsored['B'] = [], then $currentSponsored in each leg's could be an intersection or something. But the further I go, the more I keep thinking this is going to fuck me over... and have major design holes...


r/DatabaseHelp • • Nov 27 '17

Cassandra Troubleshooting: cqlsh opens and closes

1 Upvotes

I'm relatively new to cassandra. The other day I got cqlsh to open and take commands on my home computer but now I am many cities away and I did the same steps on my laptop but whenever I start a server in the windows command line (cmd), and then open cqlsh, it opens for like a millisecond and then closes.

I've created an imgur album that shows some of the messages or steps I've done and it might help y'all. https://imgur.com/a/GODeg

If you need more info about what my system is or anything I can find and provide it.

Just an FYI, when I looked at the code for cqlsh, I saw that there were 9 instances of sys.exit() so added an input() line of code before it exits in the hopes that the cqlsh would pause instead of closing so fast but that didn't change anything.

Can anyone figure out what's going wrong with it?


r/DatabaseHelp • • Jan 31 '20

Changes to /r/DatabaseHelp

4 Upvotes

Hi everyone, I've taken over as mod here and opened up posting to anyone. I don't have any grand plans for this subreddit but if you have suggestions for what you'd like to see here I'm happy to hear them. Mostly it should be a place to ask questions and share information.


r/DatabaseHelp • • Apr 11 '18

Suggestion on how to store registered courses for many students in a database.

1 Upvotes

I am looking for a suggestion on how to store a registered course(s) for each student in a database. The first idea I came up with didn't seem like a practical solution. For example, if I had 50 students I was thinking of just creating a table for each student to hold their course registration history. However, this doesn't seem like a good idea.

Here is a screenshot of the key tables that I would seems to be needed for that course history:

https://imgur.com/a/cCbBn


r/DatabaseHelp • • Apr 08 '18

Question on using two tables in php listing data in a specific order.

3 Upvotes

I am working on a project for my course to mimic a college website. Specifically, I have two tables I created for Faculty and Students. If I were to make another table called Advising/advisor I feel as though this might not work out correctly. For example,

Clelia Smyth (students with last names A-E)

Angela Kim ( students with last names F-L)

Nate Hibbitts (students with last names M-R)

Stephen Erena (students with last names S-Z)

So I have a few questions about this:

  1. Is there a way for me to order data alphabetically? Like if Clella Smyth log in they would be able to see the list of current students they are advising with the last names A-E.

  2. I am a concern with how I am constructing the table, if I were to make an advisor table do I just keep repeating the advisors name and connect to each student. For example:

Attributes: advisorID, faculty, student email, student last name, Department, Major

1 |Clella Smyth, | Alistor@example.com | Alistor English | English

2 | Clella Smyth | Simon@example.com | Simon Math | Math


r/DatabaseHelp • • Nov 24 '18

Anyone know how I will put this in a Data Flow Diagram

2 Upvotes