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

Filter by
Sorted by
Tagged with
0 votes
2 answers
35 views

Design pattern for persistent data storage - load and save arbitrary file, database, api etc

I have the following problem - I write the code for object data manager, and one of requirements is being able to save/load data into some persistent data storage. I want to make it as the following: ...
user avatar
  • 101
0 votes
1 answer
55 views

Approach for store multiple relationships POO objects in relational database

I'm developing a system in which a ClassA object can have multiple ClassB and ClassC objects. And for store these objects in a relational DB model I create the following tables: This is a simplified ...
user avatar
  • 177
0 votes
1 answer
76 views

Architecture of a desktop application persistence model

I am working on a C++ desktop application using the MVC design-pattern. In a nutshell, it allows to monitor the position of a real robot in a 3D environment and create tasks for it by modifying the ...
user avatar
  • 141
0 votes
1 answer
478 views

Encapsulation of External API in Infrastructure Layer AS Persistence

My question is about DDD, the Infrastructure layer, it's relation to the Domain, and specifically how we can take advantage of the ability to "swap out" one persistence implementation for ...
user avatar
3 votes
3 answers
601 views

Importance of loading/saving complete aggregates at once in DDD

In the context of a web application where we handle only one command per request in a stateless fashion, do we always have to load/save aggregates as one atomic unit? Why is it recommended not to ...
user avatar
  • 197
0 votes
0 answers
24 views

Bigdata architecture: persisting raw data and streaming them at the same time

In a case where we have multiple source of data, we need to : persist each source of data in its raw form. process the data source eventually with each other to transform them in a presentable state (...
user avatar
0 votes
2 answers
226 views

About layered architecture and the persistence layer

I’m pretty sure I’ve made some wrong assumptions in my questions so bear that in mind. At some point, the methods inside objects that are part of the persistence layer will be called/accessed for say… ...
user avatar
  • 23
0 votes
2 answers
59 views

BPMN - How to handle "under the hood" data change

I have an issue that I'm not sure how to handle regarding modeling. I'm using as my BPMS Flowable My situation: I have a flow (picture below) where are 2 user activities. Each activity manipulates on ...
user avatar
  • 129
1 vote
1 answer
33 views

Failed uploads layer

I am trying to find an optimal way to handle the following scenario: I have an application where there are a lot of file uploads on a certain endpoint, but the validation is rather strict as per the ...
user avatar
4 votes
1 answer
149 views

Do Domain Objects Have To Be Persisted?

Does a domain object have to be persisted, or does this violate some convention about domain objects? For example, let's say I'm using an object called AuthenticationState to represent authentication ...
user avatar
1 vote
1 answer
522 views

Bulk Update of DDD Aggregate Roots

In my applications users can perform actions on a few thousand aggregate root instances with a single click. The problem is that the UI is blocked for several seconds (~ 3) what feels too slow. So, I'...
user avatar
  • 786
0 votes
0 answers
166 views

Storing tree data in a database for fast reading of the whole hierarchy

I have a class that looks something like this: class Entity { public string Id { get; set; } public List<Entity> Children { get; set; } public void DoStuff(Data data) { ...
user avatar
  • 109
1 vote
1 answer
51 views

Java, dealing with XML and JPA Annotated Classes

I use xjc to compile XSD files to Java Classes, and want to edit/extend them to make them persistable through JPA. I cant figure out what the best "Coupling?" would be and how to organize it,...
user avatar
3 votes
5 answers
341 views

Should the Model be able to persist itself? When?

I might start by saying that I am aware that usually there's a Repository layer bookRepository.persist(book) that abstracts the interaction with the database, but something about using the model ...
user avatar
0 votes
1 answer
90 views

Using a domain model to persist metrics

I am currently developing a spring boot web application in which no entity is persistent, and hence will not be saved on a database. Although, I need to be able to query some business metrics from it. ...
user avatar
2 votes
1 answer
169 views

How to correctly translate UML Association, Aggregation and Composition to a Hibernate mapping?

There is a number of questions about the differences between UML Association, Aggregation and Composition out there and many many answers, some practical and some phylosofical. Here I'm asking we talk ...
user avatar
  • 259
3 votes
1 answer
91 views

Persistent data structure changes for changing domain model

I've learned many ways to keep a domain model flexible over the years, but there is a remaining case where the setup resists change. Suppose that we have kept our domain model properly isolated: we ...
user avatar
  • 372
7 votes
1 answer
806 views

How to prevent concurrency problems when using the repository pattern?

Considering that: when using the repository pattern you deal with entities - those are the atomic units you persist (regardless of Hibernate or "manually") when changing an entity you save it as a ...
user avatar
3 votes
2 answers
1k views

Is putting an Id to a value object a bad id?

I have a Customer which can have sereval address. Sereval customers can possibily live at the same address. So in my relational database a classic many to many relationship. As : An address can not ...
user avatar
2 votes
0 answers
86 views

Database vs Logs - Persistence approach evaluation

I have a node js app, in which I need to perform background jobs. My plan is to use a data structure which will contain all the jobs needs done. My design also suggests that this data structure needs ...
user avatar
3 votes
2 answers
920 views

Clean Architecture and Persistence Annotations

If one wants to comply with the clean architecture principle 100%, they must not annotate the entities in the entities layer with database-specific annotations (like Hibernate, Neo4j, etc.). So, two ...
user avatar
  • 199
3 votes
3 answers
245 views

Ways to mark the parts of a JSON that need to be updated ("dirty bit")

I have a JSON object of arbitrary complexity, representing several entities (not my design choice). I want to partially persist it, only for the changed entities. What would be the best way to mark ...
user avatar
-2 votes
1 answer
111 views

Database with auto-expiration

I am midway through my software development project in Node.js and have encountered a fork in the road. I need to create a "database" or a JSON file, that will automatically delete an entry after it ...
user avatar
  • 115
1 vote
0 answers
186 views

How to avoid coupling of domain objects with UI data in a store-based Angular app?

The state of my TypeScript/Angular app contains objects from the UI layer and from the business domain layer. I'm exploring store-based solutions (eg ngrx, ngxs) to keep this state in memory. As ...
user avatar
1 vote
2 answers
500 views

How to abstract the data layer when using Spring Data?

I have decided to try to create my own board game implementation. Probably going to use a REST-api to expose the contract. I'll figure out what database, communication, ... tools I'm going to use once ...
user avatar
1 vote
1 answer
594 views

How do you alleviate stale data in a multi-user web application?

Displayed data can be changed in the underlying database by any user. How do you show the change to all the other users? For instance, I have database tables for building and associated rooms. Any ...
user avatar
  • 493
0 votes
0 answers
38 views

How to store message content in a webservice

I am building a service responsible for sending email/sms communications. The service receives a request that contains information necessary to build an email/sms template and the recipient ...
user avatar
-1 votes
1 answer
166 views

Is it a bad idea to persist a javascript function?

I'm working on eventual consistency. In short I have a bunch of promises and I want to make sure they get retried until they succeed. It would make my life a lot easier if I could just persist the ...
user avatar
2 votes
2 answers
1k views

How to deal with an event if the domain aggregate was not yet persisted?

When I call paid() on my aggregate it sets all the properties internally that need to be changed based on this action. But at this time the change has not been saved to the DB, so I can't reliably ...
user avatar
  • 461
1 vote
0 answers
44 views

iOS CloudKit - Store NSData representations of classes or create individual records with individual fields?

I have an app that already locally archives user created objects and has for several years. Each archived object can have several nested objects or arrays of objects in it--all of which conform to ...
user avatar
-3 votes
3 answers
267 views

Is storing configurations in memory more performance and maintenance efficient? [closed]

My teammate has this class which contains a lot of Strings: public class Config { /** * List of status */ public static final String IN = "bla*"; public static final String ...
user avatar
16 votes
2 answers
3k 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 ...
user avatar
  • 446
5 votes
4 answers
637 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. $...
user avatar
3 votes
2 answers
1k 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 ...
user avatar
  • 2,106
0 votes
1 answer
4k 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 ...
user avatar
  • 1,856
3 votes
2 answers
943 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 ...
user avatar
  • 157
1 vote
1 answer
2k 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 ...
user avatar
  • 19
2 votes
1 answer
107 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 {...
user avatar
2 votes
2 answers
157 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: ...
user avatar
  • 282
2 votes
1 answer
693 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 ...
user avatar
  • 149
1 vote
2 answers
202 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 ...
user avatar
  • 1,829
2 votes
2 answers
5k 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 ...
user avatar
2 votes
2 answers
258 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 ...
user avatar
1 vote
2 answers
321 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 ...
user avatar
  • 141
0 votes
2 answers
993 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 ...
user avatar
  • 318
5 votes
2 answers
779 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 ...
user avatar
  • 201
0 votes
3 answers
290 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 ...
user avatar
4 votes
3 answers
272 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 ...
user avatar
0 votes
2 answers
1k 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. ...
user avatar
0 votes
2 answers
823 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 ...
user avatar
  • 111