Skip to main content

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
-1 votes
1 answer
81 views

Passing In-Memory Specification to Repository

I am working on my DDD know-what/how and have the following questions related to the Specification Pattern, the Repository Pattern, persistence agnosticism, and performance. Consider, for the sake of ...
STHA's user avatar
  • 71
1 vote
1 answer
126 views

Persisting data in a mobile app backed by a rest API back-end, advices [closed]

So I am working on this mobile application using MAUI, which is backed by a Rest API in ASP.NET Core. I want to be able to use the app offline, and the user can create/edit some data. This data is ...
Toto's user avatar
  • 155
1 vote
4 answers
256 views

How to Access the Private State of an Entity in the Save Method of its Repository

Consider the domain entity, Order, which can be persisted by the OrderRepository. Orders maintain state that is stored in the database. However, it does not expose all of it directly. That is, parts ...
STHA's user avatar
  • 71
4 votes
9 answers
1k views

Can a Domain Object always be "completely ignorant of persistence" and yet still possible to persist?

Domain Object, while not necessarily a design pattern, can at least be considered as a design "concept", and one of its points is: https://wiki.c2.com/?DomainObject Domain objects should ...
The_Sympathizer's user avatar
0 votes
1 answer
384 views

Architecture for storing generic data

(I am facing this issue with code written in Swift, but would appreciate any high-level pseudocode solution, just so that I may wrap my head around the architecture) I need to find an architecture ...
Skwiggs's user avatar
  • 117
1 vote
0 answers
461 views

How to post domain events with aggregate root Id before the root is persited?

This seems pretty newby question but I still can't find a answer I'm ok with. I'm doing a microservice and decided to have a Message as an aggregate root. This Message represents a kind of ...
lavrik's user avatar
  • 111
3 votes
1 answer
466 views

Should repositories return self persisting entities?

In domain driven design A repository is a collection like "interface" that hides data source access. It furnish add, remove and retrieval method just like a collection would. It does it ...
Ced's user avatar
  • 599
1 vote
3 answers
1k 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: ...
Ch3shire's user avatar
  • 121
0 votes
1 answer
268 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 ...
Caeta's user avatar
  • 177
0 votes
1 answer
186 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 ...
Hugal31's user avatar
  • 151
0 votes
1 answer
3k 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 ...
apriestley's user avatar
4 votes
3 answers
3k 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 ...
geeko's user avatar
  • 256
0 votes
0 answers
48 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 (...
Omegaspard's user avatar
0 votes
2 answers
1k 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… ...
qUneT's user avatar
  • 53
0 votes
2 answers
118 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 ...
PastorPL's user avatar
  • 129
1 vote
1 answer
38 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 ...
Daniel Pop's user avatar
4 votes
1 answer
466 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 ...
Mixed_Signals's user avatar
1 vote
1 answer
2k 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'...
deamon's user avatar
  • 876
0 votes
0 answers
318 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) { ...
rytisk's user avatar
  • 109
1 vote
1 answer
121 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,...
Oblivial's user avatar
3 votes
5 answers
695 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 ...
Carlos Coelho's user avatar
0 votes
1 answer
134 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. ...
Gabriel Robaina's user avatar
2 votes
1 answer
493 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 ...
AlexSC's user avatar
  • 259
4 votes
1 answer
245 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 ...
Timo's user avatar
  • 402
7 votes
1 answer
2k 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 ...
Luís Soares's user avatar
4 votes
2 answers
4k 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 ...
Christophe Debove's user avatar
2 votes
0 answers
217 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 ...
Cap Barracudas's user avatar
3 votes
2 answers
2k 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 ...
Shayan's user avatar
  • 199
3 votes
3 answers
294 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 ...
JoseHdez_2's user avatar
-2 votes
1 answer
219 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 ...
dir's user avatar
  • 115
1 vote
0 answers
230 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 ...
schrödingcöder's user avatar
1 vote
2 answers
1k 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 ...
abstract christmas tree's user avatar
2 votes
1 answer
1k 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 ...
dacracot's user avatar
  • 503
0 votes
0 answers
41 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 ...
Daniel Benzie's user avatar
-1 votes
1 answer
317 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 ...
Ian Swift's user avatar
3 votes
2 answers
2k 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 ...
floriank's user avatar
  • 483
1 vote
0 answers
51 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 ...
Evan Gould's user avatar
-3 votes
3 answers
463 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 ...
Rigo Sarmiento's user avatar
16 votes
2 answers
4k 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 ...
Double M's user avatar
  • 446
8 votes
4 answers
1k 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. $...
Daniel Benzie's user avatar
3 votes
2 answers
2k 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 ...
dabadaba's user avatar
  • 2,256
0 votes
1 answer
6k 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 ...
user3198603's user avatar
  • 1,896
4 votes
2 answers
2k 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 ...
Vqf5mG96cSTT's user avatar
1 vote
1 answer
3k 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 ...
ocf1's user avatar
  • 19
2 votes
1 answer
223 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 {...
aasukisuki's user avatar
2 votes
2 answers
237 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: ...
OneWorld's user avatar
  • 302
2 votes
1 answer
825 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 ...
Allenph's user avatar
  • 149
1 vote
2 answers
225 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 ...
nicholaswmin's user avatar
  • 1,933
2 votes
2 answers
6k 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 ...
IEnjoyEatingVegetables's user avatar
2 votes
2 answers
376 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