Design: Fitting variable hierarchy of text files into a relational db
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have a large data corpus (several TB) made up of data gathered through customer support queries. I've been asked to set up a database to make this data more accessible, but as I'm kind of new to database design, I'm stuck on what may be a fairly trivial design decision.
One of the primary components of this data is a copy of the software configuration for each user's install. The configuration consists of N plain text files, in a fixed directory structure, but each directory can contain a number of different config files depending on how the user has configured their install.
Example hierarchy:
conf
|-- general.cfg
|-- instances
| |-- exchange_mediator.cfg
| |-- primary.cfg
| `-- sip.cfg
|-- settings.cfg
`-- users
|-- admin
| `-- admin_setup.cfg
|-- admin.cfg
|-- restricted_user.cfg
`-- terry.cfg
As mentioned above, different installs may have a different number of files in any given directory, and they may be named differently also. I'm not sure how to fit the contents of these files (just a simple text blob) into a relational database so that it's easy to search for certain strings in the contents of some or any of these files.
Example queries might be:
+Show me all config files in "instances" containing the string "restricted"
+Show me all support instances with a "user" config file named "admin.cfg"
Any advice would be much appreciated!
Note:
In terms of the specific database I'm using, I'm still researching that. I've looked at NoSQL db's such as elasticsearch and mongodb, as it seems like creating searchable JSON objects would be a great way of handling this. I'd rather avoid elasticsearch, as their documentation recommends keeping a separate database to store the data reliably (I'd rather avoid that). I've heard bad things about mongodb in terms of scalability, particularly if you have a large number of indexed keys.
For a more traditional-style SQL db, I'm looking at Amazon RDS or Redshift. Redshift seems to be easy to deploy, and quite capable of handling the amount of data I have, but as it doesn't support datatypes like arrays and structures, I'm not sure how my data could be transformed to fit into a series of tables.
Many thanks for having read this far!
Toby
database-design nosql
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have a large data corpus (several TB) made up of data gathered through customer support queries. I've been asked to set up a database to make this data more accessible, but as I'm kind of new to database design, I'm stuck on what may be a fairly trivial design decision.
One of the primary components of this data is a copy of the software configuration for each user's install. The configuration consists of N plain text files, in a fixed directory structure, but each directory can contain a number of different config files depending on how the user has configured their install.
Example hierarchy:
conf
|-- general.cfg
|-- instances
| |-- exchange_mediator.cfg
| |-- primary.cfg
| `-- sip.cfg
|-- settings.cfg
`-- users
|-- admin
| `-- admin_setup.cfg
|-- admin.cfg
|-- restricted_user.cfg
`-- terry.cfg
As mentioned above, different installs may have a different number of files in any given directory, and they may be named differently also. I'm not sure how to fit the contents of these files (just a simple text blob) into a relational database so that it's easy to search for certain strings in the contents of some or any of these files.
Example queries might be:
+Show me all config files in "instances" containing the string "restricted"
+Show me all support instances with a "user" config file named "admin.cfg"
Any advice would be much appreciated!
Note:
In terms of the specific database I'm using, I'm still researching that. I've looked at NoSQL db's such as elasticsearch and mongodb, as it seems like creating searchable JSON objects would be a great way of handling this. I'd rather avoid elasticsearch, as their documentation recommends keeping a separate database to store the data reliably (I'd rather avoid that). I've heard bad things about mongodb in terms of scalability, particularly if you have a large number of indexed keys.
For a more traditional-style SQL db, I'm looking at Amazon RDS or Redshift. Redshift seems to be easy to deploy, and quite capable of handling the amount of data I have, but as it doesn't support datatypes like arrays and structures, I'm not sure how my data could be transformed to fit into a series of tables.
Many thanks for having read this far!
Toby
database-design nosql
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have a large data corpus (several TB) made up of data gathered through customer support queries. I've been asked to set up a database to make this data more accessible, but as I'm kind of new to database design, I'm stuck on what may be a fairly trivial design decision.
One of the primary components of this data is a copy of the software configuration for each user's install. The configuration consists of N plain text files, in a fixed directory structure, but each directory can contain a number of different config files depending on how the user has configured their install.
Example hierarchy:
conf
|-- general.cfg
|-- instances
| |-- exchange_mediator.cfg
| |-- primary.cfg
| `-- sip.cfg
|-- settings.cfg
`-- users
|-- admin
| `-- admin_setup.cfg
|-- admin.cfg
|-- restricted_user.cfg
`-- terry.cfg
As mentioned above, different installs may have a different number of files in any given directory, and they may be named differently also. I'm not sure how to fit the contents of these files (just a simple text blob) into a relational database so that it's easy to search for certain strings in the contents of some or any of these files.
Example queries might be:
+Show me all config files in "instances" containing the string "restricted"
+Show me all support instances with a "user" config file named "admin.cfg"
Any advice would be much appreciated!
Note:
In terms of the specific database I'm using, I'm still researching that. I've looked at NoSQL db's such as elasticsearch and mongodb, as it seems like creating searchable JSON objects would be a great way of handling this. I'd rather avoid elasticsearch, as their documentation recommends keeping a separate database to store the data reliably (I'd rather avoid that). I've heard bad things about mongodb in terms of scalability, particularly if you have a large number of indexed keys.
For a more traditional-style SQL db, I'm looking at Amazon RDS or Redshift. Redshift seems to be easy to deploy, and quite capable of handling the amount of data I have, but as it doesn't support datatypes like arrays and structures, I'm not sure how my data could be transformed to fit into a series of tables.
Many thanks for having read this far!
Toby
database-design nosql
I have a large data corpus (several TB) made up of data gathered through customer support queries. I've been asked to set up a database to make this data more accessible, but as I'm kind of new to database design, I'm stuck on what may be a fairly trivial design decision.
One of the primary components of this data is a copy of the software configuration for each user's install. The configuration consists of N plain text files, in a fixed directory structure, but each directory can contain a number of different config files depending on how the user has configured their install.
Example hierarchy:
conf
|-- general.cfg
|-- instances
| |-- exchange_mediator.cfg
| |-- primary.cfg
| `-- sip.cfg
|-- settings.cfg
`-- users
|-- admin
| `-- admin_setup.cfg
|-- admin.cfg
|-- restricted_user.cfg
`-- terry.cfg
As mentioned above, different installs may have a different number of files in any given directory, and they may be named differently also. I'm not sure how to fit the contents of these files (just a simple text blob) into a relational database so that it's easy to search for certain strings in the contents of some or any of these files.
Example queries might be:
+Show me all config files in "instances" containing the string "restricted"
+Show me all support instances with a "user" config file named "admin.cfg"
Any advice would be much appreciated!
Note:
In terms of the specific database I'm using, I'm still researching that. I've looked at NoSQL db's such as elasticsearch and mongodb, as it seems like creating searchable JSON objects would be a great way of handling this. I'd rather avoid elasticsearch, as their documentation recommends keeping a separate database to store the data reliably (I'd rather avoid that). I've heard bad things about mongodb in terms of scalability, particularly if you have a large number of indexed keys.
For a more traditional-style SQL db, I'm looking at Amazon RDS or Redshift. Redshift seems to be easy to deploy, and quite capable of handling the amount of data I have, but as it doesn't support datatypes like arrays and structures, I'm not sure how my data could be transformed to fit into a series of tables.
Many thanks for having read this far!
Toby
database-design nosql
database-design nosql
asked Nov 11 '14 at 10:39
Toby DeriusToby Derius
1
1
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You could store the text file data in a table like this:
config_files
------------
ID (PK)
name
parent_dir_id (FK to config_dirs.id)
content
config_dirs
-----------
ID (PK)
name
original_user (key to the table that stores the original user data)
parent_dir_id (key to config_dirs.ID, needs to be nullable to indicate a root directory)
Populating this structure, you could do something like this:
config_dirs
-----------
ID | name | parent_dir_id | original_user
------+------------+---------------+--------------
1 | conf | (null) | Toby Derius
2 | users | 1 | Toby Derius
3 | admin | 2 | Toby Derius
4 | bob | 2 | Toby Derius
config_files
------------
ID | name | parent_dir_id | content
------+------------+-----------------+--------
1 |general.cfg | 1 | This is the general config...
2 |admin.cfg | 3 | admin's config...
This could allow you to query the directory structure and the file contents for specific users. Storing large amounts of plain text is not always a great idea, in terms of performance, so you might also want to consider storing the contents in a separate table file_contents
and then referencing the file_contents
from config_files
. Also look into fill-text search engines.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f82368%2fdesign-fitting-variable-hierarchy-of-text-files-into-a-relational-db%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could store the text file data in a table like this:
config_files
------------
ID (PK)
name
parent_dir_id (FK to config_dirs.id)
content
config_dirs
-----------
ID (PK)
name
original_user (key to the table that stores the original user data)
parent_dir_id (key to config_dirs.ID, needs to be nullable to indicate a root directory)
Populating this structure, you could do something like this:
config_dirs
-----------
ID | name | parent_dir_id | original_user
------+------------+---------------+--------------
1 | conf | (null) | Toby Derius
2 | users | 1 | Toby Derius
3 | admin | 2 | Toby Derius
4 | bob | 2 | Toby Derius
config_files
------------
ID | name | parent_dir_id | content
------+------------+-----------------+--------
1 |general.cfg | 1 | This is the general config...
2 |admin.cfg | 3 | admin's config...
This could allow you to query the directory structure and the file contents for specific users. Storing large amounts of plain text is not always a great idea, in terms of performance, so you might also want to consider storing the contents in a separate table file_contents
and then referencing the file_contents
from config_files
. Also look into fill-text search engines.
add a comment |
You could store the text file data in a table like this:
config_files
------------
ID (PK)
name
parent_dir_id (FK to config_dirs.id)
content
config_dirs
-----------
ID (PK)
name
original_user (key to the table that stores the original user data)
parent_dir_id (key to config_dirs.ID, needs to be nullable to indicate a root directory)
Populating this structure, you could do something like this:
config_dirs
-----------
ID | name | parent_dir_id | original_user
------+------------+---------------+--------------
1 | conf | (null) | Toby Derius
2 | users | 1 | Toby Derius
3 | admin | 2 | Toby Derius
4 | bob | 2 | Toby Derius
config_files
------------
ID | name | parent_dir_id | content
------+------------+-----------------+--------
1 |general.cfg | 1 | This is the general config...
2 |admin.cfg | 3 | admin's config...
This could allow you to query the directory structure and the file contents for specific users. Storing large amounts of plain text is not always a great idea, in terms of performance, so you might also want to consider storing the contents in a separate table file_contents
and then referencing the file_contents
from config_files
. Also look into fill-text search engines.
add a comment |
You could store the text file data in a table like this:
config_files
------------
ID (PK)
name
parent_dir_id (FK to config_dirs.id)
content
config_dirs
-----------
ID (PK)
name
original_user (key to the table that stores the original user data)
parent_dir_id (key to config_dirs.ID, needs to be nullable to indicate a root directory)
Populating this structure, you could do something like this:
config_dirs
-----------
ID | name | parent_dir_id | original_user
------+------------+---------------+--------------
1 | conf | (null) | Toby Derius
2 | users | 1 | Toby Derius
3 | admin | 2 | Toby Derius
4 | bob | 2 | Toby Derius
config_files
------------
ID | name | parent_dir_id | content
------+------------+-----------------+--------
1 |general.cfg | 1 | This is the general config...
2 |admin.cfg | 3 | admin's config...
This could allow you to query the directory structure and the file contents for specific users. Storing large amounts of plain text is not always a great idea, in terms of performance, so you might also want to consider storing the contents in a separate table file_contents
and then referencing the file_contents
from config_files
. Also look into fill-text search engines.
You could store the text file data in a table like this:
config_files
------------
ID (PK)
name
parent_dir_id (FK to config_dirs.id)
content
config_dirs
-----------
ID (PK)
name
original_user (key to the table that stores the original user data)
parent_dir_id (key to config_dirs.ID, needs to be nullable to indicate a root directory)
Populating this structure, you could do something like this:
config_dirs
-----------
ID | name | parent_dir_id | original_user
------+------------+---------------+--------------
1 | conf | (null) | Toby Derius
2 | users | 1 | Toby Derius
3 | admin | 2 | Toby Derius
4 | bob | 2 | Toby Derius
config_files
------------
ID | name | parent_dir_id | content
------+------------+-----------------+--------
1 |general.cfg | 1 | This is the general config...
2 |admin.cfg | 3 | admin's config...
This could allow you to query the directory structure and the file contents for specific users. Storing large amounts of plain text is not always a great idea, in terms of performance, so you might also want to consider storing the contents in a separate table file_contents
and then referencing the file_contents
from config_files
. Also look into fill-text search engines.
answered Nov 11 '14 at 16:44
FrustratedWithFormsDesignerFrustratedWithFormsDesigner
3,1321318
3,1321318
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f82368%2fdesign-fitting-variable-hierarchy-of-text-files-into-a-relational-db%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown