Tag Info

New answers tagged

0

If you want to edit content from a postgres database in a web browser then you need a framework that support the various pieces and glues them together. You'll still need to write the application itself. Some of the frameworks that would support this include: php, rails and django Editing information from a database using a web interface is not a trivial ...


3

Loading the data to memory in a sane manner is the job of the database engine... You DO NOT need to manually perform that task, your database engine will perform that task for you, its purpose is to process queries and cache the required data. Unless you are firing 1000's of queries a second, dont be afraid to fire multiple queries to a database, it is ...


3

The time taken to query a local database on disk should be orders of magnitude less than the time required to backup a file or communicate over the internet. (Your database isn't on the online server, is it? In which case keep a cached copy locally - assuming this isn't shared between users. Use a version number to check that the local host is using the same ...


2

What database capabilities are needed depends on the application. There are applications which only read data but don't write any. There are applications which only write data, while the reading is done by another application. There are applications which read and insert data, but must by specification be unable to ever update or delete any data, ...


-1

The actual minimal set of statements required for a useable application with some sort of transactional integrity:-- start unit of work write/insert read/select by record id rewrite/update by record id delete/erase by record id commit unit of work rollback/cancel unit of work No need for schema/column definition, complex joins etc as these can be handled ...


1

whether it would be a useful strategy to make everything aware of it's parent project That is a standard strategy. It is called "denormalization". Assumed your "project elements" never change the project they belong to your project's primary ID key will never change the additional memory needed for the IDs is no problem it actually solves your ...


2

Don't do it! There are so many options these days for actual databases in every context that one should almost never use something else as if it were a database. For small and simple projects, you can at least use SQLite - it's probably used by several apps on your phone!


0

Before you decide how to organize your database tables for multiple clients ("the great multi-tenant vs. multi-instance debate"), you should consider how you intend to: scale your service as your number of clients/branded sites grows, scale your service as the number of users grows (either for individual clients/sites, or in aggregate), keep your site(s) ...


0

In most cases, typical web service is built with multiple small programs. Conceptually, you run a program to print a HTML file. In the program, you use database client library to access database. This program quits immediately as it finishes printing a HTML page. At this point, your program just prints the result to console. To interact over the network, ...


0

Ideally, the interface for your program-in-the-middle would look as similar as possible to your existing program's interface to the database. You might want to start by building a layer in your existing program that interacts with the database, and all other components in your program interact with the database by calling the functions in this new layer. ...


0

There are certainly various strategies to solve this problem. One possible way is to do it client-server. Use case model: The front-end app will be desktop app installed on user's device without its own database. When front-end user needs to select from menuitems it will invoke GetMenuItems method on the server and will receive all the menu items ...


0

In practice, it is difficult to release a new database version. While it is nice to have a module with the current DDL, in many cases you will likely be modifying an existing database. I would keep it as a separate module. The practice for DDL that I use, is to generate an upgrade (and downgrade) script for each release. Changes that break the current ...


0

I'm familiar with storing DDL scripts in repositories that use an ORM (i.e. ruby on rails). When I've seen DML mixed in with the DML's the results I have seen is: You can set up a database from scratch using them but you lose the ability to easily go back and forwards for individual steps.


2

The concept you're talking about is generally referred to as an embedded database (or sometimes, a serverless database). There are many out there; I don't think lists are a good format for this site, but you could try SQLite, for example. If you need a more fully-fledged RDBMS, something like Firebird embedded might be appropriate.


1

What we used in a company I used to work at is Liquibase. It is a solution in Java, but since you only ever need to run it once per DB update it will likely work for other languages as well. I'm pretty sure there are other solutions that work in a similar way, so I'm just going to describe how it functions in general so you can search for something that ...


0

Don't share a connection, unless you have multiple commands in a single transaction (which requires you to keep the connection open). Open / Close after each action which you state as 'obviously bad' is actually the way to go, as connection pooling makes sure you don't lose much (if at all) time. It also looks like you're re-inventing some data-access ...


1

Abstract classes don't share. The primary benefit of the service locator in this instance is that a request will only open a single adapter to the database and share that adapter with all objects that request it. Whereas in your structure of extending from abstract classes each instance will setup a new adapter to run its statements against the database. ...


2

Naive solution: Have both threads wait a random amount of time before trying again. Eventually one thread will go before the other (probably sooner rather than later.)


1

Implement some sort of timeout or dead-man mechanism. For example, here is a (simplified) Enqueue method on a blocking queue: public void Enqueue(T item) { int count = 0; lock (_locker) { while (queue.Count >= MaximumSize) { Monitor.Wait(_locker), 100) // Wait for 1/10 of a second. count++; ...


0

I've been using document dbs (ravendb to be specific) as my data store of choice for 3+ years now and I really don't want to look back. At least for that sort of nosql databases the biggest question is "what goes in this document? What goes in another document? What goes in a related document?" Unfortunately there isn't a lot of good guidance on this. Then ...


2

NoSQL isn't a very well defined term and all the solutions that run under this name have very different features, so a lot may be possible or not depending on what exactly you are planning to do with it. Basically you could use some of the more general solutions like maybe MongoDB or Cassandra to simply replace your current relational database. In some ...


0

My main reason to keep them separate is to try and avoid what's known in Object Oriented programming as a 'god class'. ORM's relate tables and fields to classes and attributes, so it becomes relevant as the SQL level too (even without an ORM there's a similar principle at play generally). The User class (and by association the user table) is frequently the ...


0

> what are some of the pitfalls ? your app is not scalable. in other words: you cannot use a cloud/cluster to improve performance by adding more servers, if you have to many (thousands of) simultanious users. As long as the number of users is limited so that the "in memory graph" can be handled with one server it is ok.


1

This is a fairly standard asynchronous programming pattern - I don't know if it has a name, but it is certainly the way that you might work with a lot of cloud solutions where you are working with NoSQL databases and most of the time you are dropping data into a queue from your application as it is updated and then expecting it will be persisted into the ...


1

One pitfall is that if there is a power outage you will loose values which have not yet been persisted. The architecture you describe is similar to that which commercial in-memory databases use (SAP Hana, Microsoft "Hekaton" etc.). These address this problem by using efficient write-ahead logging. You may be able to implement a version of that if data ...


1

There are, at least, three cases when having a person table for basic attributes and a second table for other attributes with a one-to-one relationship, is desirable: BLOB data like a picture. A separate table allows data to be stored separately for performance reasons, for example in a separate tablespace. Data that doesn't apply to everybody or that only ...


0

"Then let's say I want to create a method that returns a list of all users with their data. Which way is better?" Arrays: These will be fast, easy, and simple. If you have a few elements in each array, things will be easy to track and focus on. e.g. You'll know that index 0 has the user id, index 1 has the name etc. There is a reason why zend framework 2 ...


1

#2: Create separate properties for each field retrieved from database, on class creation load all data fields into respective properties and operate with that properties separately? This second option (using a class) is far better in the long term. A common PHP anti-pattern is to pass around everything as key-value arrays, and it eventually becomes a ...


1

Since access to the data storage will not be concurrent and given only the "monitoring" program will write to it (according to your answers to some comments), my recommendation is: The safe way to go now seems to be a database, but you shouldn't be concerned right now with the administration of one Use SQLite locally in the machine the monitor runs in, ...


2

Do not build a database in your database. The performance will suck and so will the code to manage it. Attributes that drive application logic should be real columns in the database on the appropriate table with a name matching their purpose. Use an EAV when you need to support an arbitrary number of user-defined attributes that are transparent to your ...


0

From my experience, your main problem is how to let the user specify the queries, rather than the data model, and thus old school relational may well work for you. Here's why. If you are pulling data from many different sources, you will end up putting them through some sort of interface. As you do this, you will discover an underlying interface, meaning ...


1

@Amberlamps your question is very generic and from one perspective, AakashM did answer it in a comment already. However let's look at it's basics to illustrate some ideas and techniques and their design considerations.. For a single user, what is the least amount of records (of the smallest size) that will address your need. On the surface (m) records per ...


0

With the information you have provided , I would recommend using MS SQL server to store and compare the data. No XML or intermediate representations. Collect, transform and dump everything directly to the DB. If right now it is running on VBscript and MS SQL Server I am assuming it is not super critical. The reads from the de-normalised schema could be ...


1

In DB2 and Oracle, tablespace is roughly the child 'containers' within a database. You can, for example, organize your huge tables to be created on a specific tablespace, for managing the disk storage. In MS SQL server there is no concept of tablespaces AFAIK. It uses file groups for the purpose of organizing storage and there is no one-to-one correlation ...


0

You could use a slightly difference structure in your table, if you still wanted to go with a table-based solution: key_values ---------- id parent_id key value type_constraint_id type_contraints --------------- id name and then populate it like this: key_values ---------- id | parent_id | key | value | type_constraint_id ...



Top 50 recent answers are included