Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [persistence]

In computer science, persistence refers to the characteristic of state that outlives the process that created it. From Wikipedia: http://en.wikipedia.org/wiki/Persistence_%28computer_science%29

8
votes
2answers
254 views

Is domain/persistence model isolation usually this awkward?

I'm diving into the concepts to Domain-Driven Design (DDD) and found some principles strange, especially regarding the isolation of domain and persistence model. Here is my basic understanding: A ...
3
votes
4answers
130 views

How are account balances persisted

I am currently building a finance application that contains "accounts" Each account has a balance that is dynamically generated based on platform charges vs payments. e.g simplified example. $...
0
votes
1answer
86 views

Can I use the memento pattern with multiple relationships and persistence?

I need to implement a rollback system and the memento pattern gets mentioned regularly as a solution to this requirement, but in all cases a single object is used and it works in memory, persistence ...
0
votes
0answers
25 views

Mapping Domain Object to Persistence Layer avoiding Abstract Factory

I am trying to implement the Metadata Mapping pattern for mapping domain object to db through reflection. I am getting difficulties in decoupling my classes from MongoDb. You can see in classes ...
0
votes
1answer
69 views

Cache vs DB design decision?

Number of times this question comes to my and my team mind, should we persist or cache the data. I understand some time there is functional requirement that we need to persist in DB. But in my case ...
2
votes
2answers
89 views

Should methods be part of your persisted entities?

We are coding a small game and have a Player class. This Player class has certain properties which you would persist in a database like Id, Level, Health. We would like a Player to be able to kill ...
1
vote
1answer
77 views

Fastest way to persist an append-only ordered event stream

I'm looking to persist a stream of events and I want it to be: fast in both latency and throughput, looking at at least 100k events per second ordered (not by timestamp, as multiple events within the ...
2
votes
1answer
67 views

Persisting domain state without exposing underlying provider(s)

Working on a DDD application where I need to persist state. Here's a very simple example: public interface IRoot { public int Id { get; } void UpdateValue(int value); } public interface IState {...
0
votes
0answers
16 views

Persisting as XML using the model class or create a standalone class

Over the past two years I've written an image sorting and processing program for our lab, using JavaFX. The class Project contains all the information: collections of Images, Tags, Labels etc, as ...
3
votes
2answers
107 views

Object design: Class property vs. list of objects

We have an object-oriented database. So, our persistence is truly object oriented. The example is the object person and the attribute VIP. We have to store, if a person is a VIP or not. Usecase: ...
2
votes
1answer
327 views

How are CQRS write models initially populated?

I have a system that interacts with a REST API as the data source. This system is based on DDD and all of my current models are CRUD models. There is one model that the REST API is only able to query ...
1
vote
2answers
106 views

Efficient data conversion in Event Sourcing

We're using a similar concept to Event Sourcing to store the data/actions of a collaborative system we have running. The system has some 2-3k users that use it daily and it's growing. As time goes ...
-1
votes
2answers
295 views

What is data persistence in the context of software engineering?

I imagine it is simply, as it is named, the existence of data throughout layers of a software application. I ask because I have not been able to find a clear definition that states something of the ...
2
votes
2answers
86 views

Handling sort-order / display-order integer as a field in collection/table [duplicate]

Say we have a column in table or a property in a collection called "sortOrder" which simply is an integer which denotes which order it is to appear when displayed. I am trying to figure out the ...
1
vote
2answers
111 views

Best approach to persist settings in files

I am in the process of migrating the way an app makes persistence of its settings. It wrote and read data from registry; now it is desired it load/save XML files on the C:\AppData\MyApp\Version ...
0
votes
2answers
290 views

Achieving “Persistence Ignorance” by having a persistence model separate from the domain model

I have recently come across the idea of persistence ignorance, the idea that your domain model should be ignorant of the persistence layer of the application, and that got me thinking. I have been ...
3
votes
1answer
330 views

Persistent Model to Domain Model mapping without exposing domain object's attributes

I know this is a common question, but I haven't found another that solves my doubts. Usually, if the project is small, I've persistence annotations in the same object that represents the domain ...
0
votes
3answers
260 views

Which database strategy should I choose?

I am going to log some events happening in my program. My program is working on a database that I cannot change (add table). These events can be stored in a single table with no relations. I would ...
5
votes
3answers
249 views

How to notify a repository about persistence changes

I have a repository, which at the moment, reads from the database every time it is called. However, the data is only updated once a day, and to improve performance, I'd like the repository to store ...
0
votes
2answers
371 views

DDD: How to avoid breaking encapsulation and leaking technical concerns to the domain during model rehydration?

When applying DDD principles in Ruby, I feel that Active Record pattern ends up polluting the domain model, while I'm not sure how to implement JSON deserialization without breaking encapsulation. ...
0
votes
2answers
311 views

Correct way to separate JPA with Service layer

I have two tables: area ( id int PK autoincrement code varchar ) products ( id int PK autoincrement name varchar area_id int PK to AREA ... ) The classes are persisted using eclipselink ...
5
votes
1answer
477 views

MVVM Persistence from view model

I'm new to MVVM, I get the general idea, but there's one thing that I've been having a tough time finding an answer for. Inevitably an application will have a save button in the UI. The UI talks to ...
1
vote
2answers
2k views

DDD infrastructure layer: implement service+persistence or just persistence

Short intro: I build an application, using .NET, Entity Framework (EF) as ORM and an SQL Server for persistence. My knowledge of SQL Server goes far beyond simple requests, and I use it to drastically ...
7
votes
2answers
3k views

Should I use a layer between service and repository for a clean architecture - Spring

I'm working in an architecture, it is going to offer a rest api for web client and mobile apps. I'm using Spring(spring mvc, spring data jpa, ...etc). The domain model is coded with JPA specification. ...
3
votes
1answer
251 views

How is persistence-ignorance relevant to a file format–centered application?

I have a small side-project of about 3,000 sloc. I'm experimenting with building a DDD-like domain model into it, so I have more experience with this style for work. The project is centered around ...
2
votes
1answer
454 views

Is undo and redo possible/feasible with two-way data binding (vs uni-directional data flow)?

I'm developing an experimental application for work that requires fully persistent undos and redos. I decided to use react/redux/immutable JS tech stack to solve this problem because I saw it worked ...
6
votes
3answers
491 views

Does using the strategy pattern for persistence methods make it “okay” to include CRUD methods in a business object?

Would like to start off by saying, I am asking this as a purely academic exercise; I am quite happy to just continue to use the repository pattern. I have heard "I put persistence methods in my ...
1
vote
1answer
233 views

Exploiting Apache Spark Data

and sorry if the question seems a bit naive. I'm currently reading tutorials about Kafka & Spark and there's something I can't figure out : how to exploit / expose the data Spark received. Here'...
8
votes
2answers
232 views

Is it ok to have dependencies inside a class that's meant to be exchangable?

Let's say I'm having a domain-model and I want to read and save it from any persistence layer - right now it might be a json file but in the future it could be xml or a database (which might also ...
4
votes
1answer
240 views

DDD entities and legacy databases

Let's say we have a legacy database. We find out the Orders and OrderLines tables contain each 100 columns. Some of them cannot be null, they are not and will not be part of our business logic but ...
1
vote
0answers
203 views

Migrating from monolith to microservices reusing data layer

We are basically in process of moving from monolith system to microservices and we avoided migrating monolith system all at once, or as they call it a "big bang" https://www.nginx.com/blog/...
3
votes
2answers
190 views

Delete user data when they sign out?

I'm writing an app, and I would like users to have the ability to sign in across multiple devices and still have their data. My question is, when the user signs out of their account on device X, ...
1
vote
1answer
94 views

Domain objects for reading vs saving

Suppose an object that has like 100 properties, but to create a new object only a few pieces of information are needed. We are using WCF, and I see the following options: 1) Use the same domain ...
0
votes
2answers
351 views

NSUserDefaults, Core Data or neither?

Everytime I press a certain button, it should remove a random index from a dictionary and then save that dictionary everytime its modified. I have done this using NSUserDefaults. I have found that ...
1
vote
0answers
151 views

Maintaining consistency with loosely coupled business and data layers

Take the following sequence of events: Business layer requests data x and y from data layer. Data layer returns version 1 of x and y. Business layer starts performing logic based on data x and y. ...
3
votes
2answers
202 views

How to correctly model aggregation with respect to persistence?

When modeling bigger domain entities you will probably have some kind of relation between these entities. These relations will usually result in entities referencing different entities. If i am not ...
1
vote
1answer
1k views

Message persistence in Message Queues

I have looked into several message queues as referenced in this link. Several of the larger and more popular ones are in memory only. I can understand the need for this in some situations however in ...
7
votes
2answers
146 views

Is there a practical reason not to use a .NET “setting” to store data that is not a setting?

.NET applications developed using Visual Studio have an easy way to store and recover user settings. You can add the default value of a setting in a special class and have read/write access to it at ...
2
votes
2answers
95 views

When do I prefer a local DB over serialization for local data storage?

I recently started developing a small calendar application, in which I can add and view several calendar entries, which contain several data like name, date, alarm settings and so on. Those values ...
2
votes
0answers
204 views

Saving tabular, spreadsheet-like data in a relational database?

I'm hoping this question isn't too broad or too prone to opinionated answers, since I could really use some pointers. I'm trying to come up with a way to persist tabular, spreadsheet-like1, data in a ...
3
votes
1answer
469 views

Persistence Strategies - Filling a cache strategy

Let's say I have an interface IDataAccessObject<TSource> with CRUD methods to access a data source. I have an implementation StrategyDataAccessObject<TSource>, which uses an strategy ...
3
votes
1answer
427 views

Enterprise Architecture: Where to put persistence/dbContext management? [closed]

I'm working on architecting a somewhat enterprise-level solution and have a question about how to best handle the persistence details. My overall setup is that there's a core set of business logic/...
1
vote
2answers
755 views

Persistence models for Event Sourcing

I am intrigued by the Event Sourcing pattern but am struggling to design an event sourcing model and put it in concrete form. First off, I want to make sure that I understand the main use cases of ...
7
votes
3answers
1k views

What data type should Gateway return in Repository Pattern to eliminate refactoring when switching persistence mechanisms?

Following this description of the Repository Pattern, we have three main concerns that need their own classes: The "Repository," which takes and returns Domain Models. The "Gateway," which takes data ...
0
votes
0answers
201 views

Persisting and manipulating JS ArrayBuffer data on the server

My node.js app has to deal with (sometimes large; a few MB) tables of numerical data. I'm about to use JavaScript's native binary objects for this purpose (i.e. ArrayBuffer and friends), because they'...
3
votes
2answers
562 views

iOS Best practice for handling model objects

There are different levels I'm asking this question at. Case 1: Let's think about the typical drill-down design. Say a table view controller has an array of custom objects, and tapping a cell will ...
4
votes
1answer
592 views

DDD – duplicity between Aggregates – should I use one table?

I understand that there exists duplicity of data between Bounded Contexts. The thing is that I'm not really sure about duplicity of data between Aggregate roots. Example: I have product in Product ...
4
votes
1answer
170 views

Rich client persistence without a database

We have a pretty sizable .NET rich client app that currently uses nHibernate and Firebird embedded for persistence. Due to the nature of the app, we need to load the entire database into memory when ...
1
vote
2answers
452 views

Is there a detriment to using SQLite over a pList for persistence?

I'm making a fairly simple application and I've got a settings menu that stores times and some boolean values. I have the application storing and retrieving data already but I started to wonder if ...
2
votes
2answers
388 views

DDD using an ORM and a Active Directory Server for Persistence

With Domain Driven Design one would model out the domain. One would then use an ORM of some sort to take care of the persistence. Say you have a Product entity which has a Name, SKU and an Owner. This ...