<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: The Pink Database Paradigm (PinkDB)	</title>
	<atom:link href="https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/</link>
	<description>Database-centric development</description>
	<lastBuildDate>Sun, 09 Feb 2025 09:08:30 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="hub" href="https://websubhub.com/hub"/>
<atom:link rel="self" href="https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/feed/"/>
	<item>
		<title>
		By: Philipp Salvisberg		</title>
		<link>https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/#comment-42116</link>

		<dc:creator><![CDATA[Philipp Salvisberg]]></dc:creator>
		<pubDate>Tue, 09 Feb 2021 08:43:53 +0000</pubDate>
		<guid isPermaLink="false">https://www.salvis.com/blog/?p=8633#comment-42116</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/#comment-42115&quot;&gt;Jürgen&lt;/a&gt;.

Thank you Jürgen. Comments are welcome anytime.

&lt;blockquote&gt;I guess you feel that validating data is the duty of the stored procedures in the API schema layer.&lt;/blockquote&gt;

IMO you should use constraints whenever possible/feasible to validate data. Not null, check and integrity constraints. Everything else can be validated between API and data layer. The database must be responsible for the data consistency. It should not be possible to create invalid data by using the API. No matter which client is used. 

I agree that there is a certain logic which is usually duplicated outside of the database to validate the data. You could make this logic reusable as part of the database API. However, this comes with a price tag. A network roundtrip for every validation check. In a GUI I usually want to check as early as possible. This means on a field base, if possible. Sometimes even during entry of a field (filtering valid values). This kind of checks are typically written in a different way than the checks within the database that are capable to handle one ore more rows. Sometimes there are not even explicit checks. For example the values for a combobox field. The GUI framework prohibits the entry of a wrong value. However, on-save the database checks it nonetheless.

To reduce the duplication of validation logic I would keep the logic in the database. The database validates 100%. Some parts need to be duplicated to improve the user experience and let the user know as early as possible about the validation failures. However, some parts will be validated delayed. When pressing save. This is acceptable quite often in my experience.

I can live with &quot;some&quot; duplicated logic as long as the integrity of the database is not compromised.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/#comment-42115">Jürgen</a>.</p>
<p>Thank you Jürgen. Comments are welcome anytime.</p>
<blockquote><p>I guess you feel that validating data is the duty of the stored procedures in the API schema layer.</p></blockquote>
<p>IMO you should use constraints whenever possible/feasible to validate data. Not null, check and integrity constraints. Everything else can be validated between API and data layer. The database must be responsible for the data consistency. It should not be possible to create invalid data by using the API. No matter which client is used. </p>
<p>I agree that there is a certain logic which is usually duplicated outside of the database to validate the data. You could make this logic reusable as part of the database API. However, this comes with a price tag. A network roundtrip for every validation check. In a GUI I usually want to check as early as possible. This means on a field base, if possible. Sometimes even during entry of a field (filtering valid values). This kind of checks are typically written in a different way than the checks within the database that are capable to handle one ore more rows. Sometimes there are not even explicit checks. For example the values for a combobox field. The GUI framework prohibits the entry of a wrong value. However, on-save the database checks it nonetheless.</p>
<p>To reduce the duplication of validation logic I would keep the logic in the database. The database validates 100%. Some parts need to be duplicated to improve the user experience and let the user know as early as possible about the validation failures. However, some parts will be validated delayed. When pressing save. This is acceptable quite often in my experience.</p>
<p>I can live with &#8220;some&#8221; duplicated logic as long as the integrity of the database is not compromised.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jürgen		</title>
		<link>https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/#comment-42115</link>

		<dc:creator><![CDATA[Jürgen]]></dc:creator>
		<pubDate>Tue, 09 Feb 2021 07:55:05 +0000</pubDate>
		<guid isPermaLink="false">https://www.salvis.com/blog/?p=8633#comment-42115</guid>

					<description><![CDATA[Hi Philipp,
sorry for commenting on this somewhat older post. I totally agree with your thoughts and would like to add one thought from my point of view: Validation of data.

It is not mentioned in your post but I guess you feel that validating data is the duty of the stored procedures in the API schema layer. 
Based on the experience I made I feel that its worthwhile separating the validation logic from the persistence logic logically to enable the connect user layer to validate but not persist data. As a use case think about APEX validation logic which lives in a separate life cycle from the persistence flow.I believe it is important to point this out as validation of data is often seen as the duty of the application layer, especially in low code tools like APEX. This is not feasible in my opinion as this will double the validation logic or, if you don&#039;t validate within the data layer, open the possibility to write non plausible data into the data layer. Writing validation code in the application layer may even force you to grant access to data that is only needed for validation purposes, violating the least possible privilege concept.]]></description>
			<content:encoded><![CDATA[<p>Hi Philipp,<br />
sorry for commenting on this somewhat older post. I totally agree with your thoughts and would like to add one thought from my point of view: Validation of data.</p>
<p>It is not mentioned in your post but I guess you feel that validating data is the duty of the stored procedures in the API schema layer.<br />
Based on the experience I made I feel that its worthwhile separating the validation logic from the persistence logic logically to enable the connect user layer to validate but not persist data. As a use case think about APEX validation logic which lives in a separate life cycle from the persistence flow.I believe it is important to point this out as validation of data is often seen as the duty of the application layer, especially in low code tools like APEX. This is not feasible in my opinion as this will double the validation logic or, if you don&#8217;t validate within the data layer, open the possibility to write non plausible data into the data layer. Writing validation code in the application layer may even force you to grant access to data that is only needed for validation purposes, violating the least possible privilege concept.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Use Database as Persistence Layer Only - Philipp Salvisberg&#039;s Blog		</title>
		<link>https://www.salvis.com/blog/2018/07/18/the-pink-database-paradigm-pinkdb/#comment-7703</link>

		<dc:creator><![CDATA[Use Database as Persistence Layer Only - Philipp Salvisberg&#039;s Blog]]></dc:creator>
		<pubDate>Sat, 25 Aug 2018 14:57:18 +0000</pubDate>
		<guid isPermaLink="false">https://www.salvis.com/blog/?p=8633#comment-7703</guid>

					<description><![CDATA[[&#8230;] on a larger scale. The solution is simple. Use the database as processing engine as recommended by PinkDB and [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] on a larger scale. The solution is simple. Use the database as processing engine as recommended by PinkDB and [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
