Tag Info

New answers tagged

1

I would create a table to represent the room, perhaps: Room ------------ RoomId (PK) RoomNumber Then a table to represent a reservation: Reservation ------------------ ReservationId (PK) RoomId (FK) StartTime EndTime For any given period, you just need to search for all reservations that are valid for that period, e.g to find how many reservations ...


1

I think that you already said it all. The only thing I can think of is not to use a one way hash filter like SHA1 to store the email addresses. Use some (reversible) public key encryption in your application and be sure that your private key is nowhere near to the database, so that they can't be "stolen" together. That way, you can still unencrypt the ...


2

Storing a salted hash of the email addresses could be on option if you keep those records just for account confirmation / authentication. In other cases, it seems to me that encrypting the emails would make the job of maintaining the database harder while gaining little in return. Probably securing the access of the database itself is a better choice: ...


0

I will be using at most 30 categories … I could just make a table "categories" Tags are easy to implement and serve your stated purposes. Trees are relatively more complicated to represent in core and irritating to move in and out of a database. YAGNI.


2

I would solve this with three tables: products, features, and product_features. Products id name description 1223 A abcdefg 1224 B hijklmnop 1225 C qrstuvwxyz features id name description 20 stages such-and-such 21 pipes 22 holder 23 orientation product_features PRIMARY ...


1

If you're asking does RavenDB (RavenHQ is just hosted RavenDB) work as persistent storage for any data system, including an API you write, of course it does. It's a document database. That's its job. I'm not exactly sure what you're asking, unless you are asking "what is RavenDB?" If so, I recommend reading through the marketing materials and documentation ...


1

Its not an abuse if your organization demands it. If there are security concerns or architectural guidance/governance that dictates it then it is warranted. We went through this with a 3rd party audit a while back and one of the 3rd party audit concerns was that our service layer directly interacted with the database. We had a web application layer and ...


2

SOA has many advantages other than increasing efficiency over a raw database confection. The most important benefit is that it provides a layer of abstraction that can be used to allow an underlying database to evolve its design without the need to synchronise releases with all consumers of the data it stores (this is particularly important if the database ...


4

There are many factors about your application stack that may indicate or contra-indicate use of SOA, so it will be very hard to tell you if everything they are asking for is appropriate. I will say that I don't think you should specifically not use SOA just because the machines happen to be in the same data-center. What if you need to enforce a new ...


1

You can use this structure too... Products: -------- ProductID | CategoryID | Title | Cost | TimeStamp 1 | 1 | Audi | $0 | ----- Specifications -------------- SpecificationID | Specification 1 | Model 2 | Fuel 3 | HardDisk ProductSpecifications: ---------------------- ProductSpecificationID | ...


1

I'd wondered as well. Googling a lot I found the answer posted by Benjamin Eberlei himself (Doctrine Project Lead and Contributor): Hello, of course DBAL uses PDO internally and escapes parameters such as in your example. I think the docs are messed up here. The Paragraph relates to the two subparagraphs about quote() and quoteIdentifier() ...


1

In practice, Rails devs do this by using one of the gems for uploading and attaching images. E.g., Paperclip is maintained by Thoughtbot, very well tested and supports S3. And if you're interested, though, in experimenting and writing your own, you should take a look at Paperclip's source code to see what the current state-of-the-art is.


2

If your application is local (doesn't support remote access) you could use an embedded DB engine. It gives you the easy installation and independence from other installed programs. So you need to choose the appropriate library. What to look for when choosing? As I said, the library should be embedded. It lets you create the single executable file without ...


1

First of all, where you see hierarchy, a database expert sees relations. Take some time understanding the relational database model and make a simple model that fits your data. This classical model is tried and tested, based on mathematical foundations and is the basis for virtually every large system out there. Do not be misled by people claiming a graph ...


1

First of all. Do not bother much about it. When you separate your concerns well, retrieve data, from processing and displaying it, you will always have the chance to switch to a "better" system. Sizes of about 10,000 entries is nothing a database will complain about, even million sets aren't a big deal. Your database will have to grow as your ...


1

if we start a long running report how do we ensure the data is not modified before we get around to processing it? That's not a typical requirement. What are you afraid of that affecting? The report that is currently running, or the transactional workload? If you are worried about the reporting getting different versions of data that could pollute ...


2

IANAL, this is not legal advise. If you want to be sure, talk to a lawyer. If you are offering a web-service that appears to be a single product, then it is likely that your users will treat it as such, regardless of how it is technically realized. This means that if a sufficiently interested user tries to download the source of the site (to exercise his ...


3

I have seen that term mostly used in an Oracle context. From the Oracle docs: A database instance is a set of memory structures that manage database files. A database is a set of physical files on disk created by the CREATE DATABASE statement. The instance manages its associated data and serves the users of the database. So in that context, the ...


5

The way that I've seen "instance" used, at least in business contexts, is a deployment of a given database (schema + data). For example, I might say "this report is dangerous, because it is going against the master instance and may be slow; it should use the reporting instance." Or you might have "five instances of the testing database" on your staging ...


0

You should use PDO (PHP Data Objects) for preventing SQL Injection attacks. It supports 12 different database systems. Your Generic Class for connecting to MySQL using pdo would look like this: class Db{ public function dbConnect(){ try { $conn = new PDO('mysql:host=host_name/ip;dbname=database_name','user','password'); ...


1

It's perfectly valid, and is usually done in situations like the one you have. Others have suggested message queues, which are nice but they'll either take up memory or wind up writing the data to a backing store anyway, so now you've got another layer of software doing what you could do directly. That said, it may be easier and cleaner to use a message ...


2

You may want to consider a Message Queuing service like Rabbit MQ, this would allow you to send data to a server that would simply keep hold of it until you had a consumer/worker available to process it. You would have to consider things like memory usage on the message queue server if your datasets are very large (or find a way to send the data in smaller ...


0

Just create helper class with static helper methods. Example: public class DataHelper { public static String asString(final Object value) { return asString(value, null); } public static String asString(final Object value, final String defaultValue) { if (value instanceof String) return (String) value; ...


0

It sounds to me like you 2 tables: a Product table, and an Image table. The Image table will have a foreign key back to the Product table and will store the image URL. This way, a single Product can have a bunch of Images. Product Image +-----------------+ +-----------+ |ProductID ...


2

There is actually a third type of users, perhaps that is causing some of your confusion. There is the SQL User, aka login, in companies these may be Active Directory users or groups. This type of user has the right to connec to the SQL database engine and one or more databases. This user does not have to use the application to do whatever he can do. The ...


3

There are two classes of users here: users of the database users of your web application They are entirely different. (Or should be.) The database users would be on the order of root (the database "superuser") and wordpress (if you were running WordPress, say, and chose that as the name to represent WordPress when connecting to the database). All of ...


0

You might want to take a look at carbon and whisper, part of the graphite project. Carbon can handle very large amounts of time series data. Though, now that I read the docs (it's been a few years since I've used it), it's only for numerical data. You said you also have string data so you might not find this useful. Though, you might be able to glean some ...


1

You might want to consider using a noSQL database for this specific data. This way you can just put your object in a record, no matter what the 'columns' are. Depending on the chosen database system (and implemented solution), you would be able to 'overwrite' a record with different data if you want. Of course, you can also save your historic data and just ...


-1

If you treat this problem as a workflow problem, you can employ one of the workflow tools such as jBPM or Windows Workflow Foundation and focus on the business logic and let the tool handle the persistence for you.


5

Sounds like you have 3 major categories of data you are trying to store: General job data (job id, job requester id, job receiver id etc) State transitions (job started, job finished) State-specific job data (optional) job-related events (price changed, job receiver user reassigned etc) The key is to separate event-like data from everything else. Schema ...


4

How about a hybrid of the two? A large table with a JobID and state (and perhaps other information common to all jobs and states), with other tables to manage the additional state information. That reduces (or eliminates) the duplication of data, but keeps things more manageable.


3

Most O/RM frameworks provide a means to initialize and seed a database. Via Code. For example, Entity Framework allows you to create a custom database initializer and implement a seed method to provide seed data (If you just want to have it generate the database, creating a seed function is not necessary). If you're not using an O/RM, you can use the ...


6

I would do a separation between the schema of your database and the actual initial content. For a simple and small application, you could create a schema.sql and a seed.sql. The schema holds all the statements to create the database and its tables. The seed contains INSERT statements. If you want to go one step further, seed the database through your code. ...


2

The first 3 things you need to do is profile, profile, and of course, profile. You are trying to fix a problem that you don't know you actually have. While its good to try to anticipate problems, it takes a lot of experience with databases to be able to really 'sense' them accurately. Set up a test script - it sounds like it should be only a few lines ...


0

Looks a fairly solid design apart from the college_major area which seems to be giving you problems as well :) Personally, I would split this table into two: Change the College_Major table to be a true many to many resolver (i.e. no intake int). This would become a reference table which is only changed when a college establishes a new major. Intake, which ...



Top 50 recent answers are included