Tag Info

New answers tagged

0

Hopefully this doesn't sound too harsh, but neither solution is very scalable or performant. Unlike a lot of other answers I actually prefer your solution over his for what its worth! This is going to be totally dependent on your specific needs, but if you only care if the user has received the LATEST newsletter, you could give a unique auto incrementing ...


4

Basically, the whole thing just doesn't seem like it was 'made for me' and my small micro-blog I think, this is the basic statement here. Although your question is about Do common relational database systems work 'out of the box'?, what you are looking for is more: do I need a full featured DB for microblogging?. And there is a clear answer: No, you ...


10

They do work out of the box, for the most part, but you do have to know how to use them. They don't come pre-populated with your application's data model, because they don't know what that is, so they're a blank slate, in that respect. SQLite will support small to medium websites with nominal concurrency and relatively low traffic, which describes probably ...


2

The database is a framework. How much you need advanced features depends on your business needs. For what you've described in terms of needs, you need SQL tables, but not the long list of other things you mention. Start small and simple is the way to go. Think of it as building scaffold. For a shed a few 4x4's does the trick, though only provides a frame, ...


3

The approach that I follow is based on the following premises: Developers are not to be bothered with production data. That's for the operations department to worry about. Configuration xml files, scripts, etc must be kept at a minimum. Everything must be in the source code repository. The source code repository is to contain only diff-able text files, ...


3

I propose looking into in code migrations for your language or technology. I have .NET stack and I can use Entity Framework Migrations where every schema change is single migration that can be automatically applied to database when needed. What is also possible is downgrading database, so pattern for db migration is that you have method for Up() and Down() ...


2

Yes, storing things such as yes or true will take more space than a tinyint. This should not be surprising. It also makes indexing and thus joins less efficient for the database. It also has the penalty of possible confusion for what is the correct value (yes vs y). However, there are many approaches that look similar to storing strings in the database (in ...


16

Yes, storing strings instead of numbers can use more space. The reason that high-profile pltforms are doing it anyway is that they think the benefits of that solution are greater than the cost. What are the benefits? You can easily read a database dump and understand what it's about without memorizing the enum tables, and even semi-official GUIs might ...


0

You need to Allow for the user to configure the connection string. FYI: To get around you password issue use integrated security. "Driver={SQLServer};Server=localhost; Database=local; Trusted_Connection=yes;"


0

Option A sounds like the way to go as you can set workers it the API independently instead of a huge tasks that only a single worker can manage. I have a very similar scenario using kombu and Celery: We get a message posted to RMQ by some integration to a RMQ queue We have a kombu consumer draining events When event is received we execute the callback ...


0

You should use a DAL, but not for the reasons stated :) You performance problem will probably not be fixed by introducing a layer of indirection (even if it might be desirable for other reasons). You should look into what actually causes the performance problem. Some common problems: The n+1 antipattern which causes far to many database queries. E.g. if ...


0

Whether you use a DAL or not your application is still going to directly interact with the database. It is generally just good practice to structure your code in such a way that things like data access is in a centralised "place" in your codebase. I also generally abstract any data access to a set of methods defined on an interface. If and when you decide ...


0

found solution here if anybody needs it... http://niceideas.ch/roller2/badtrash/entry/java_create_enum_instances_dynamically and this is the one with compile-time solution: https://bojanv55.wordpress.com/2015/05/25/java-dynamic-enums/


1

I designed and implemented a hierarchy like this many years ago (before generics) so here are some comments. They may help stop you from repeating my mistakes :) The proliferation of methods like parseNumber(), parseName() suggests that the class hierarchy needs adjusment, yet your hierarchy looks well designed. My approach would be a combination of ...


0

I think the key line from the article is : "Likewise, sometimes the output will be a single object X, which is easy to represent. But sometimes the output will be a grid of aggregate data, or a single integer count" It seems to me the author is making a good point in that if your code is for example getting the Number of customers in Spain for some bit of ...


1

Data is not 'object in nature' or 'relational in nature'. Any kind of data can be represented in both relational or a object model/graph structure. What is appropriate depends on how the data is going to be used by the applications. Often you might even have both. For example data used on a website could be stored in a relational database, but on-demand ...


0

Since users will be somehow authenticated during usage, you could "flag" trial accounts status and keep track of their activity: User A logs in. User A performs an action against the service A combination of the user ID + timestamp is tracked Check the earliest timestamp associated with the same user ID IF the check passes (the earliest and the current are ...


0

You are correct in that you cant ensure logout with a web application, where you essentially download a client program and then make intermittent requests for data the server. There are a few work arounds for this problem that I know of 1: define 'logged out' as automatically occurring after a period of inactivity This may not be best for you with such ...


-1

I suppose that with this number of users it is not hosting but dedicated servers where you can install everything you need to your service. If it is right my suggestion is to use some external storage like Redis where login token (or other user identifier that passed from client to server) will be the key and value is all data you want to know about the user ...


0

Have you considered Sphinx? http://sphinxsearch.com if you can use a 3rd party tool this would be ideal for what your're trying to achieve, its much more efficient at full text search than any RDBMS that I have personally used.


2

You can use triggers. CREATE TRIGGER notifyMe ON table1 AFTER INSERT, UPDATE, DELETE AS EXEC msdb.dbo.sp_send_dbmail @profile_name = 'DB AutoMailer', @recipients = 'user@example.com', @body = 'The DB has changed', @subject = 'DB Change'; GO


0

It looks like you could integrate CheckAccess into a higher-level data-fetching function. var GetSomeData = function(req) { var data = Data.fetch(req.param_id); if (data.userId === req.user._id) { return {'error': 401}; } return {'success': data}; } // ... // in client code var reply = GetSomeData(req); if (reply.error) { ...


2

In some respect you are right: They both refer to the same domainobject, which is called order. But you are wrong in as far, it is not a real duplication than a different representation - originated from different purposes. If you want to persist your order, you e.g. want access to each and every column. But you do not want to leak that to the outside. ...


0

(Disclaimer: I only saw it being used in this way. I might have misunderstood the real purpose of doing so. Treat this answer with suspicion.) Here is another missing bit: the conversion between Order and OrderModel. The Order class is tied to your ORM, while the OrderModel is tied to the design of your View Model. Typically, the two methods will be ...


7

The purpose of the View Model is to provide decoupling in two ways: by providing data in the shape that the View requires (independent of the model), and (especially in MVVM) by pushing some or all of the View logic back from the View to the View Model. In a fully normalized model, Customer would not be represented in the Model by a string, but rather by an ...


16

So am I missing something important here? YES While these look like the same thing, and represent the same thing in the domain, they are not the same (OOP) objects. One is the Order as known by the data storage part of the code. The other is the Order as known by the UI. While it's a pleasant coincidence that these classes have the same properties, ...


0

From your statement " the DB will be locked for an uncontrollable amount of time during the external API call, potentially affecting performance" I infer that the external call could take a lot longer than the DB call. So if this is the case, then I would make the request asynchronous and send a response to the user/UI saying that the request has been ...


0

Entity Framework is an Object-Relational Mapper; it translates the results of SQL queries into objects and collections. For example, this query: SELECT name, address, city, state, zip FROM customers; might produce a collection IEnumerable<customer> result of objects that looks like this: public class Customer { public string Name { get; ...


1

Maybe consider a variation of two-phase commit: Make and commit your changes to the database first, then do your API calls. If the API calls fail, then make compensatory changes to the database (basically, update the database with the previous values). This had the virtue of not locking the database for any appreciable length of time, but gives you a method ...


2

It's far easier to roll back changes made in a database that it is at the "other end" of an API call. Here's how I'd do it: Start a database transaction and make the changes there. Do the API calls. If those work, then commit the database changes; if not, roll the changes back.



Top 50 recent answers are included